use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseVarArguments.
private void parseVarArguments(ParamTag p, XMLElement currentXML) {
currentXML.setAttribute("PROCESSED", "true");
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("MessageMode")) {
p.setMode(content);
}
if (name.equals("MessageType")) {
p.setType(content);
}
parseVarArguments(p, child);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseSelectionArrayElements.
private void parseSelectionArrayElements(ParamTag paramtag, MapTag selectionMap, XMLElement currentXML) throws Exception {
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
if (name.equals("SelectionArrayElement")) {
ParamTag pt = new ParamTag(myNavascript);
pt.setType(Message.MSG_TYPE_ARRAY_ELEMENT);
pt.setName(paramtag.getName());
paramtag.addParam(pt);
parseSelectionArrayElement(pt, child);
}
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method consumeContent.
private void consumeContent(NavascriptFragment fragment, XMLElement xe) {
String content = (xe.getContent() != null && !"".equals(xe.getContent()) ? xe.getContent() : null);
xe.setAttribute("PROCESSED", "TRUE");
if (content == null) {
// do nothing
} else if (content.equals("if")) {
// do nothing
} else if (content.equals("then")) {
// end of condition
fragment.finalize();
} else if (content.equals("else")) {
} else {
fragment.consumeToken(content);
}
Vector<XMLElement> children = xe.getChildren();
for (XMLElement x : children) {
consumeContent(fragment, x);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseStringConstant.
private String parseStringConstant(XMLElement currentXML) {
currentXML.setAttribute("PROCESSED", "true");
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("LiteralOrExpression")) {
return parseStringConstant(child);
}
if (name.equals("StringConstant")) {
return content.replaceAll("\"", "");
}
}
return "";
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseLog.
private LogTag parseLog(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
LogTag dt = new LogTag(myNavascript);
dt.addParent(parent);
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
if (name.equals("Conditional")) {
ConditionFragment currentFragment = new ConditionFragment();
consumeContent(currentFragment, child);
dt.setCondition(currentFragment.consumedFragment());
}
if (name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
dt.setValue(ef.consumedFragment());
}
}
return dt;
}
Aggregations