use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseDefine.
private DefineTag parseDefine(NS3Compatible parent, XMLElement xe) {
DefineTag dt = new DefineTag(myNavascript);
dt.addParent(parent);
Vector<XMLElement> children = xe.getChildren();
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("Identifier")) {
dt.setName(content);
}
if (name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
dt.setExpression(ef.consumedFragment());
}
}
return dt;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseSynchronizedBlock.
private SynchronizedTag parseSynchronizedBlock(NS3Compatible parent, XMLElement xe) throws Exception {
SynchronizedTag st = new SynchronizedTag(myNavascript);
st.addParent(parent);
Vector<XMLElement> children = xe.getChildren();
for (XMLElement child : children) {
String name = child.getName();
if (name.equals("SynchronizedArguments")) {
parseSynchronizedArguments(null, st, child);
}
if (name.equals("TopLevelStatement")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(st, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(st, ib);
}
}
}
return st;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseValidations.
private ValidationsTag parseValidations(NS3Compatible parent, XMLElement xe) {
ValidationsTag vt = new ValidationsTag(myNavascript);
vt.addParent(parent);
Vector<XMLElement> children = xe.getChildren();
CheckTag ct = null;
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("Checks")) {
return parseValidations(parent, child);
}
if (name.equals("Check")) {
ct = new CheckTag(myNavascript);
vt.addCheck(ct);
parseCheckAttributes(ct, child);
}
}
return vt;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseMessageArguments.
private void parseMessageArguments(MessageTag 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")) {
// Add _ to prevent ignore messages from not being rendered.
p.setMode(content + "_");
}
if (name.equals("MessageType")) {
p.setType(content);
}
parseMessageArguments(p, child);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseCheckAttributes.
private void parseCheckAttributes(CheckTag ct, XMLElement xe) {
Vector<XMLElement> children = xe.getChildren();
String param = null;
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.endsWith("Conditional")) {
ConditionFragment conditionFragment = new ConditionFragment();
consumeContent(conditionFragment, child);
ct.setCondition(conditionFragment.consumedFragment());
}
if (name.equals("CheckAttributes")) {
parseCheckAttributes(ct, child);
}
if (name.equals("CheckAttribute")) {
parseCheckAttributes(ct, child);
}
if (name.equals("TOKEN")) {
param = content;
}
if (name.equals("LiteralOrExpression")) {
String c = null;
if (isLiteral(child)) {
c = parseStringConstant(child);
} else {
c = parseExpression(child);
}
if (param.equals("code")) {
ct.setCode(c);
}
if (param.equals("description")) {
ct.setDescription(c);
}
}
if (name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
ct.setRule(ef.consumedFragment());
}
}
}
Aggregations