Search in sources :

Example 6 with NS3Compatible

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);
    }
}
Also used : CommentBlock(com.dexels.navajo.document.navascript.tags.CommentBlock) NS3Compatible(com.dexels.navajo.document.navascript.tags.NS3Compatible)

Example 7 with NS3Compatible

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;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement) MapTag(com.dexels.navajo.document.navascript.tags.MapTag) NS3Compatible(com.dexels.navajo.document.navascript.tags.NS3Compatible)

Example 8 with NS3Compatible

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;
}
Also used : IncludeTag(com.dexels.navajo.document.navascript.tags.IncludeTag) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement) MapTag(com.dexels.navajo.document.navascript.tags.MapTag) NS3Compatible(com.dexels.navajo.document.navascript.tags.NS3Compatible)

Example 9 with NS3Compatible

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;
}
Also used : LoopTag(com.dexels.navajo.document.navascript.tags.LoopTag) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement) MapTag(com.dexels.navajo.document.navascript.tags.MapTag) NS3Compatible(com.dexels.navajo.document.navascript.tags.NS3Compatible)

Example 10 with NS3Compatible

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;
}
Also used : BlockTag(com.dexels.navajo.document.navascript.tags.BlockTag) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement) NS3Compatible(com.dexels.navajo.document.navascript.tags.NS3Compatible)

Aggregations

NS3Compatible (com.dexels.navajo.document.navascript.tags.NS3Compatible)11 CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)10 XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)10 MapTag (com.dexels.navajo.document.navascript.tags.MapTag)7 BlockTag (com.dexels.navajo.document.navascript.tags.BlockTag)2 FieldTag (com.dexels.navajo.document.navascript.tags.FieldTag)2 IncludeTag (com.dexels.navajo.document.navascript.tags.IncludeTag)2 LoopTag (com.dexels.navajo.document.navascript.tags.LoopTag)2 MessageTag (com.dexels.navajo.document.navascript.tags.MessageTag)2 SynchronizedTag (com.dexels.navajo.document.navascript.tags.SynchronizedTag)2 BreakTag (com.dexels.navajo.document.navascript.tags.BreakTag)1 CommentBlock (com.dexels.navajo.document.navascript.tags.CommentBlock)1 DebugTag (com.dexels.navajo.document.navascript.tags.DebugTag)1 FinallyTag (com.dexels.navajo.document.navascript.tags.FinallyTag)1 LogTag (com.dexels.navajo.document.navascript.tags.LogTag)1 ParamTag (com.dexels.navajo.document.navascript.tags.ParamTag)1 ArrayList (java.util.ArrayList)1