use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseConditionalBlock.
private BlockTag parseConditionalBlock(NS3Compatible parent, XMLElement currentXML, boolean isEmptyMessage) throws Exception {
BlockTag bt = new BlockTag(myNavascript);
bt.addParent(parent);
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("Conditional")) {
ConditionFragment currentFragment = new ConditionFragment();
consumeContent(currentFragment, child);
bt.setCondition(currentFragment.consumedFragment());
}
if (name.equals("InnerBody")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(bt, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(bt, ib);
}
}
}
return bt;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseMessage.
private MessageTag parseMessage(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
Vector<XMLElement> children = currentXML.getChildren();
MessageTag msgTag = new MessageTag(myNavascript);
msgTag.addParent(parent);
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("TOKEN") && content.equals("[")) {
msgTag.setType(Message.MSG_TYPE_ARRAY);
}
if (name.equals("Conditional")) {
ConditionFragment currentFragment = new ConditionFragment();
consumeContent(currentFragment, child);
msgTag.setCondition(currentFragment.consumedFragment());
}
if (name.equals("MappedArrayMessage")) {
// <map ref="[]"
MapTag mt = parsedMappedArrayMessage(null, child);
msgTag.addMap(mt);
}
if (name.equals("MappedArrayField")) {
// <map ref="$"
MapTag maf = parseMappedArrayField(findClosestMapTag(parent, ""), child);
msgTag.addMap(maf);
}
if (name.equals("MsgIdentifier")) {
msgTag.setName(content);
}
if (name.equals("MessageArguments")) {
parseMessageArguments(msgTag, child);
}
if (name.equals("InnerBody")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(msgTag, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(msgTag, ib);
}
}
if (name.equals("MessageArray")) {
msgTag.setType(Message.MSG_TYPE_ARRAY);
Vector<XMLElement> messageChildren = child.getChildren();
int count = 0;
for (XMLElement messageChild : messageChildren) {
if (messageChild.getName().equals("MessageArrayElement")) {
MessageTag messageElt = parseMessage(parent, messageChild);
messageElt.setType(Message.MSG_TYPE_ARRAY_ELEMENT);
messageElt.setName(msgTag.getName());
messageElt.setIndex(count);
msgTag.addMessage(messageElt);
count++;
}
}
}
}
return msgTag;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseSynchronizedArguments.
private void parseSynchronizedArguments(String key, SynchronizedTag 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("SContextType")) {
p.setContext(content);
}
if (name.equals("SKey")) {
key = "key";
}
if (name.equals("STimeout")) {
key = "timeout";
}
if (name.equals("SBreakOnNoLock")) {
key = "breakOnNoLock";
}
if (name.equals("LiteralOrExpression") || name.equals("Expression")) {
String c = null;
if (name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
c = ef.consumedFragment();
} else {
if (isLiteral(child)) {
c = parseStringConstant(child);
} else {
c = parseExpression(child);
}
}
if (key != null) {
if (key.equals("key")) {
p.setKey(c);
}
if (key.equals("timeout")) {
p.setTimeout(c);
}
if (key.equals("breakOnNoLock")) {
p.setBreakOnNoLock(c);
}
}
key = null;
}
parseSynchronizedArguments(key, p, child);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parsePropertyArguments.
private void parsePropertyArguments(PropertyTag 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("PropertyTypeValue")) {
p.setType(content);
}
if (name.equals("PropertyDirectionValue")) {
p.setDirection(content);
}
if (name.equals("PropertyCardinalityValue")) {
p.setCardinality(content);
}
if (name.equals("PropertyDescription")) {
boolean isLiteral = isLiteral(child);
if (isLiteral) {
p.setDescription(parseStringConstant(child));
}
}
parsePropertyArguments(p, child);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseAdapterMethod.
private void parseAdapterMethod(FieldTag parent, XMLElement currentXML) {
// MethodName
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("MethodName")) {
parent.setFieldName(content);
}
if (name.equals("KeyValueArguments")) {
parseMapOrMethodArguments(parent, child);
}
}
}
Aggregations