use of com.dexels.navajo.document.navascript.tags.NS3Compatible in project navajo by Dexels.
the class NavascriptSaxHandler method addComment.
@Override
public void addComment(String c) {
CommentBlock cb = new CommentBlock();
cb.setComment(c);
if (currentNode != null && currentNode.size() > 0) {
NS3Compatible cn = (NS3Compatible) currentNode.lastElement();
cn.addComment(cb);
}
}
use of com.dexels.navajo.document.navascript.tags.NS3Compatible in project navajo by Dexels.
the class NS3ToNSXML method parseMappedArrayField.
private MapTag parseMappedArrayField(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
MapTag ft = new MapTag(myNavascript);
ft.addParent(parent);
if (parent != null && parent instanceof MapTag) {
ft.setParent((MapTag) parent);
}
ft.setOldStyleMap(true);
Vector<XMLElement> children = currentXML.getChildren();
boolean hasFilter = false;
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("MappableIdentifier")) {
String fieldRef = parseMappableIdentifier(child);
ft.setRefAttribute(fieldRef);
}
if (name.equals("FieldName")) {
ft.setRefAttribute(content);
}
if (name.equals("TOKEN") && content.equals("filter")) {
hasFilter = true;
}
if (hasFilter && name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
ft.setFilter(ef.consumedFragment());
}
if (name.equals("InnerBody") || name.equals("InnerBodySelection")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(ft, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(ft, ib);
}
}
}
return ft;
}
use of com.dexels.navajo.document.navascript.tags.NS3Compatible in project navajo by Dexels.
the class NS3ToNSXML method parseMap.
private MapTag parseMap(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
MapTag mapTag = new MapTag(myNavascript);
mapTag.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);
mapTag.setCondition(currentFragment.consumedFragment());
}
if (name.equals("AdapterName")) {
mapTag.setName(content);
}
if (name.equals("ClassName")) {
// old style map
mapTag.setOldStyleMap(true);
mapTag.setObject(content);
}
if (name.equals("Include")) {
IncludeTag it = parseInclude(parent, child);
mapTag.addInclude(it);
}
if (name.equals("KeyValueArguments")) {
parseMapOrMethodArguments(mapTag, child);
}
if (name.equals("InnerBody")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(mapTag, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(mapTag, ib);
}
}
}
return mapTag;
}
use of com.dexels.navajo.document.navascript.tags.NS3Compatible in project navajo by Dexels.
the class NS3ToNSXML method parseLoop.
private LoopTag parseLoop(NS3Compatible parent, XMLElement currentXML) throws Exception {
// Define arraymessage adapter
LoopTag mt = new LoopTag(myNavascript);
// mt.setName("arraymessage");
mt.addParent(parent);
// Define map for mapped array message of array field
MapTag ref = new MapTag(myNavascript);
ref.setOldStyleMap(true);
mt.addMap(ref);
Vector<XMLElement> children = currentXML.getChildren();
boolean hasFilter = false;
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);
mt.setCondition(currentFragment.consumedFragment());
}
if (name.equals("MsgIdentifier")) {
ref.setRefAttribute("[" + content + "]");
}
if (name.equals("MappableIdentifier")) {
String fieldRef = parseMappableIdentifier(child);
ref.setRefAttribute(fieldRef);
}
if (name.equals("TOKEN") && content.equals("filter")) {
hasFilter = true;
}
if (hasFilter && name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
ref.setFilter(ef.consumedFragment());
}
if (name.equals("InnerBody") || name.equals("InnerBodySelection")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(ref, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(ref, ib);
}
}
}
return mt;
}
use of com.dexels.navajo.document.navascript.tags.NS3Compatible 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;
}
Aggregations