Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlElement


            String warning = "The name cannot be empty.";
            this.engine.getErrorWindow().error(warning);
            return;
        }

        XmlElement metadata;
        if (metadataText.length() == 0) {
            metadata = null;
        } else {
            try {
                metadata = XMLUtil.stringToXmlElement(metadataText);
View Full Code Here


        // Reformat
        List<String> emptyTexts = new ArrayList<String>();
        for (Object child : this.metadata.children()) {
            if (child instanceof XmlElement) {
                XmlElement element = (XmlElement) child;
                for (XmlNamespace ns : element.namespaces()) {
                    // move the namespace declaration up if possible.
                    if (this.metadata.lookupNamespaceByPrefix(ns.getPrefix()) == null) {
                        // If this prefix is not used yet, copy to the root.
                        this.metadata.declareNamespace(ns);
                    }
View Full Code Here

     */
    abstract public Port getConnectedPort();

    @Override
    protected void parseConfiguration(XmlElement configElement) {
        XmlElement nameElement = configElement.element(null, NAME_TAG);
        if (nameElement != null) {
            // If the name is set here, this node has been configured.
            this.configured = true;
            this.configuredName = nameElement.requiredText();
        }
        XmlElement descElement = configElement.element(null, DESCRIPTION_TAG);
        if (descElement != null) {
            this.description = descElement.requiredText();
        }
        XmlElement typeElement = configElement.element(null,
                DATA_TYPE_QNAME_TAG);
        if (typeElement != null) {
            String qnameText = typeElement.requiredText();
            if (qnameText != null && !qnameText.equals("")) {
                this.parameterType = QName.valueOf(qnameText);
            }
        }
        XmlElement metadataElement = configElement.element(null, METADATA_TAG);
        if (metadataElement != null) {
            for (XmlElement appinfo : metadataElement.requiredElementContent()) {
                // Call setMetadata to clone and reformat.
                setMetadata(appinfo);
                // It should have only one element.
                break;
            }
View Full Code Here

    }

    @Override
    protected XmlElement addConfigurationElement(XmlElement nodeElement) {

        XmlElement configElement = nodeElement.addElement(GraphSchema.NS,
                GraphSchema.NODE_CONFIG_TAG);

        if (this.configured) {
            // Don't save the name here if this node has not been configured.
            XmlElement nameElement = configElement.addElement(GraphSchema.NS,
                    NAME_TAG);
            nameElement.addChild(this.configuredName);
        }
        if (this.description != null) {
            XmlElement descriptionElement = configElement.addElement(
                    GraphSchema.NS, DESCRIPTION_TAG);
            descriptionElement.addChild(this.description);
        }
        if (this.parameterType != null) {
            XmlElement qnameElement = configElement.addElement(GraphSchema.NS,
                    DATA_TYPE_QNAME_TAG);
            qnameElement.addChild(this.parameterType.toString());
        }
        if (this.metadata != null) {
            XmlElement metadataElement = configElement.addElement(
                    GraphSchema.NS, METADATA_TAG);
            // Clone the metadata to avoid parent problem because this can be
            // called multiple times.
            metadataElement.addChild(XMLUtil.deepClone(this.metadata));
        }

        return configElement;
    }
View Full Code Here

    /**
     * @see edu.indiana.extreme.xbaya.graph.impl.PortImpl#toXML()
     */
    @Override
    protected XmlElement toXML() {
        XmlElement portElement = super.toXML();
        portElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.PORT_TYPE_ATTRIBUTE, GraphSchema.PORT_TYPE_WS_DATA);
        return portElement;
    }
View Full Code Here

            // default value
            Object value = input.getDefaultValue();
            String valueString = null;
            if (value != null) {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
View Full Code Here

     * @param graphString
     * @return the graph created
     * @throws GraphException
     */
    public static WSGraph createGraph(String graphString) throws GraphException {
        XmlElement graphElement;
        try {
            graphElement = XMLUtil.stringToXmlElement(graphString);
        } catch (RuntimeException e) {
            throw new GraphException(ErrorMessages.XML_ERROR, e);
        }
View Full Code Here

  }
 
 
 
  public XmlElement toXML() {
    XmlElement xml = super.toXML();
    xml.setAttributeValue(GraphSchema.NS,
                GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_STREAM_SOURCE);
    return xml;
  }
View Full Code Here

//    public String getUniqueID(){
//      return this.uuid;
//    }
   
    protected XmlElement toXML() {
        XmlElement portElement = super.toXML();
        portElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.PORT_TYPE_ATTRIBUTE, GraphSchema.PORT_TYPE_CEP);
//        portElement.setAttributeValue(GraphSchema.NS,
//                GraphSchema.PORT_TYPE_UUID, this.uuid);
        return portElement;
    }
View Full Code Here

            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        textComponent.setText(valueString);
        XmlElement metadata = this.node.getMetadata();
        String metadataText;
        if (metadata == null) {
            metadataText = WSConstants.EMPTY_APPINFO;
        } else {
            metadataText = XMLUtil.xmlElementToString(metadata);
View Full Code Here

TOP

Related Classes of org.xmlpull.infoset.XmlElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.