Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlElement


    /**
     * @see edu.indiana.extreme.xbaya.graph.Graph#toXML()
     */
    public XmlElement toXML() {

        XmlElement graphElement = XMLUtil.BUILDER.newFragment(GraphSchema.NS,
                GraphSchema.GRAPH_TAG);

        graphElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.XBAYA_VERSION_ATTRIBUTE, XBayaVersion.VERSION);

        XmlElement idElement = graphElement.addElement(GraphSchema.NS,
                GraphSchema.GRAPH_ID_TAG);
        idElement.addChild(getID());

        if (this.name != null) {
            XmlElement nameElement = graphElement.addElement(GraphSchema.NS,
                    GraphSchema.GRAPH_NAME_TAG);
            nameElement.addChild(getName());
        }

        if (this.description != null) {
            XmlElement descriptionElement = graphElement.addElement(
                    GraphSchema.NS, GraphSchema.GRAPH_DESCRIPTION_TAG);
            descriptionElement.addChild(getDescription());
        }

        toXML(graphElement);

        for (NodeImpl node : this.nodes) {
            XmlElement nodeElement = node.toXML();
            graphElement.addChild(nodeElement);
        }

        for (PortImpl port : this.ports) {
            XmlElement portElement = port.toXML();
            graphElement.addChild(portElement);
        }

        for (EdgeImpl edge : this.edges) {
            XmlElement edgeElement = edge.toXML();
            graphElement.addChild(edgeElement);
        }

        return graphElement;
    }
View Full Code Here


        }
    }

    @Override
    protected XmlElement toXML() {
        XmlElement nodeElement = super.toXML();
        nodeElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_IF);
        return nodeElement;
    }
View Full Code Here

    protected void parse(XmlElement graphElement) throws GraphException {
        String version = graphElement.attributeValue(GraphSchema.NS,
                GraphSchema.XBAYA_VERSION_ATTRIBUTE);
        logger.info("parsing a workflow created by version " + version);

        XmlElement idElement = graphElement.element(GraphSchema.GRAPH_ID_TAG);
        if (idElement != null) {
            this.id = idElement.requiredText();
        }

        XmlElement nameElement = graphElement
                .element(GraphSchema.GRAPH_NAME_TAG);
        if (nameElement != null) {
            this.name = nameElement.requiredText();
        }

        XmlElement descriptionElement = graphElement
                .element(GraphSchema.GRAPH_DESCRIPTION_TAG);
        if (descriptionElement != null) {
            this.description = descriptionElement.requiredText();
        }

        for (XmlElement nodeElement : graphElement.elements(null,
                GraphSchema.NODE_TAG)) {
            NodeImpl nodeImpl = this.factory.createNode(nodeElement);
View Full Code Here

        return nodeElement;
    }

    @Override
    protected XmlElement addConfigurationElement(XmlElement nodeElement) {
        XmlElement configElement = nodeElement.addElement(GraphSchema.NS,
                GraphSchema.NODE_CONFIG_TAG);
        if (this.xpath != null) {
            XmlElement element = configElement.addElement(GraphSchema.NS,
                    XPATH_TAG_NAME);
            element.addChild(this.xpath.toString());
        }
        return configElement;
    }
View Full Code Here

        return component;
    }

    @Override
    protected XmlElement toXML() {
        XmlElement nodeElement = super.toXML();
        nodeElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_IF);
        return nodeElement;
    }
View Full Code Here

      this.instanceIDField.setText("");
    } else {
      this.instanceIDField.setText(instanceID.toString());
    }

    XmlElement metadata = this.workflow.getMetadata();
    String metadataText;
    if (metadata == null) {
      metadataText = WSConstants.EMPTY_APPINFO;
    } else {
      metadataText = XMLUtil.xmlElementToString(metadata);
View Full Code Here

    String name = this.nameTextField.getText();
    if (name != null && name.equals(StringUtil.convertToJavaIdentifier(name))) {
      String description = this.descriptionTextArea.getText();
      String metadataText = this.metadataTextArea.getText();

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

        if (e != null) {
            message += ": " + e.toString();
        }
        if (e != null) {
            String stackTrace = StringUtil.getStackTraceInString(e);
            XmlElement stackTraceElement = XMLUtil.BUILDER
                    .newFragment("stackTrace");
            stackTraceElement.addChild(stackTrace);
            this.notifier.sendingFault(this.invocationContext, message, XMLUtil
                    .xmlElementToString(stackTraceElement));
        } else {
            this.notifier.sendingFault(this.invocationContext, message);
        }
View Full Code Here

    }

    @Override
    protected void parseConfiguration(XmlElement configElement) {
        super.parseConfiguration(configElement);
        XmlElement element = configElement.element(null, VALUE_TAG_NAME);
        if (element != null) {
            // It might be a String or XmlElement
            for (Object child : element.children()) {
                if (child instanceof String) {
                    if (((String) child).trim().length() == 0) {
                        // Skip white space before xml element.
                        continue;
                    }
View Full Code Here

        }
    }

    @Override
    public XmlElement toXML() {
        XmlElement nodeElement = super.toXML();
        nodeElement.setAttributeValue(GraphSchema.NS,
                GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_INPUT);
        return nodeElement;
    }
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.