use of org.xmlpull.infoset.XmlElement in project airavata by apache.
the class NodeImpl method parse.
/**
* @param nodeElement
* @throws GraphException
*/
protected void parse(XmlElement nodeElement) throws GraphException {
XmlElement idElement = nodeElement.element(GraphSchema.NODE_ID_TAG);
this.id = idElement.requiredText();
XmlElement nameElement = nodeElement.element(GraphSchema.NODE_NAME_TAG);
this.name = nameElement.requiredText();
// XmlElement labelElement = nodeElement
// .element(GraphSchema.NODE_STREAM_LABEL_TAG);
// if (null != labelElement) {
// this.label = labelElement.requiredText();
// }
Iterable<XmlElement> inputPortElements = nodeElement.elements(null, GraphSchema.NODE_INPUT_PORT_TAG);
for (XmlElement inputPort : inputPortElements) {
this.inputPortIDs.add(inputPort.requiredText());
}
Iterable<XmlElement> outputPortElements = nodeElement.elements(null, GraphSchema.NODE_OUTPUT_PORT_TAG);
for (XmlElement outputPort : outputPortElements) {
this.outputPortIDs.add(outputPort.requiredText());
}
XmlElement controlInPortElement = nodeElement.element(GraphSchema.NODE_CONTROL_IN_PORT_TAG);
if (controlInPortElement != null) {
this.controlInPortID = controlInPortElement.requiredText();
}
Iterable<XmlElement> controlOutPortElements = nodeElement.elements(null, GraphSchema.NODE_CONTROL_OUT_PORT_TAG);
for (XmlElement controlOutPort : controlOutPortElements) {
this.controlOutPortIDs.add(controlOutPort.requiredText());
}
XmlElement eprPortElement = nodeElement.element(GraphSchema.NODE_EPR_PORT_TAG);
if (eprPortElement != null) {
this.eprPortID = eprPortElement.requiredText();
}
XmlElement xElement = nodeElement.element(GraphSchema.NODE_X_LOCATION_TAG);
this.position.x = (int) Double.parseDouble(xElement.requiredText());
XmlElement yElement = nodeElement.element(GraphSchema.NODE_Y_LOCATION_TAG);
this.position.y = (int) Double.parseDouble(yElement.requiredText());
XmlElement configElement = nodeElement.element(GraphSchema.NODE_CONFIG_TAG);
if (configElement != null) {
parseConfiguration(configElement);
}
XmlElement componentElement = nodeElement.element(GraphSchema.NODE_COMPONENT_TAG);
if (componentElement != null) {
// XXX Not used since the introduction of .xwf
parseComponent(componentElement);
}
}
use of org.xmlpull.infoset.XmlElement in project airavata by apache.
the class ConstantNode method toXML.
@Override
protected XmlElement toXML() {
XmlElement nodeElement = super.toXML();
nodeElement.setAttributeValue(GraphSchema.NS, GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_CONSTANT);
return nodeElement;
}
use of org.xmlpull.infoset.XmlElement in project airavata by apache.
the class DoWhileNode method addConfigurationElement.
@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;
}
use of org.xmlpull.infoset.XmlElement in project airavata by apache.
the class InputNode method addConfigurationElement.
@Override
protected XmlElement addConfigurationElement(XmlElement nodeElement) {
XmlElement configElement = super.addConfigurationElement(nodeElement);
if (this.defaultValue != null) {
XmlElement element = configElement.addElement(GraphSchema.NS, VALUE_TAG_NAME);
element.addChild(this.defaultValue);
}
XmlElement element = configElement.addElement(GraphSchema.NS, VISIBILITY_TAG_NAME);
element.addChild(Boolean.toString(this.visibility));
return configElement;
}
use of org.xmlpull.infoset.XmlElement in project airavata by apache.
the class OutputNode method toXML.
/**
* @return the node xml
*/
@Override
public XmlElement toXML() {
XmlElement nodeElement = super.toXML();
nodeElement.setAttributeValue(GraphSchema.NS, GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_OUTPUT);
return nodeElement;
}
Aggregations