Search in sources :

Example 1 with ValidationsTag

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

Example 2 with ValidationsTag

use of com.dexels.navajo.document.navascript.tags.ValidationsTag in project navajo by Dexels.

the class NS3ToNSXML method parseXML.

private void parseXML(NS3Compatible parent, XMLElement xe, int level) throws Exception {
    if (xe.getAttribute("PROCESSED") != null) {
        return;
    }
    String name = xe.getName();
    String content = (xe.getContent() != null && !"".equals(xe.getContent()) ? xe.getContent() : null);
    if (name.equals("DebugDefinition")) {
        parseHeaderDefinitions(xe);
    } else if (name.equals("Validations")) {
        ValidationsTag vt = parseValidations(parent, xe);
        myNavascript.addValidations(vt);
    } else if (name.equals("Var")) {
        ParamTag pt = parseVar(parent, xe);
        addChildTag(parent, pt);
    } else if (name.equals("Message")) {
        MessageTag mt = parseMessage(parent, xe);
        addChildTag(parent, mt);
    } else if (name.equals("ConditionalEmptyMessage")) {
        BlockTag mt = parseConditionalBlock(parent, xe, true);
        addChildTag(parent, mt);
    } else if (name.equals("Loop")) {
        LoopTag mt = parseLoop(parent, xe);
        addChildTag(parent, mt);
    } else if (name.equals("Synchronized")) {
        SynchronizedTag st = parseSynchronizedBlock(parent, xe);
        addChildTag(parent, st);
    } else if (name.equals("Map")) {
        MapTag mt = parseMap(parent, xe);
        addChildTag(parent, mt);
    } else if (name.equals("Break")) {
        BreakTag mt = parseBreak(parent, xe);
        addChildTag(parent, mt);
    } else if (name.equals("Include")) {
        IncludeTag it = parseInclude(parent, xe);
        addChildTag(parent, it);
    } else if (name.equals("Define")) {
        DefineTag dt = parseDefine(parent, xe);
        addDefine(dt);
    } else if (name.equals("Print")) {
        DebugTag dt = parsePrint(parent, xe);
        addChildTag(parent, dt);
    } else if (name.equals("Log")) {
        LogTag dt = parseLog(parent, xe);
        addChildTag(parent, dt);
    } else if (name.equals("Finally")) {
        FinallyTag ft = parseFinally(parent, xe);
        addChildTag(parent, ft);
    } else if (name.equals("Methods")) {
        MethodsTag mt = parseMethods(parent, xe);
        addChildTag(parent, mt);
    } else {
        Vector<XMLElement> children = xe.getChildren();
        for (XMLElement x : children) {
            if (x.getAttribute("PROCESSED") == null) {
                parseXML(parent, x, level + 1);
            }
        }
    }
}
Also used : ParamTag(com.dexels.navajo.document.navascript.tags.ParamTag) LoopTag(com.dexels.navajo.document.navascript.tags.LoopTag) DebugTag(com.dexels.navajo.document.navascript.tags.DebugTag) ValidationsTag(com.dexels.navajo.document.navascript.tags.ValidationsTag) LogTag(com.dexels.navajo.document.navascript.tags.LogTag) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement) BreakTag(com.dexels.navajo.document.navascript.tags.BreakTag) MapTag(com.dexels.navajo.document.navascript.tags.MapTag) FinallyTag(com.dexels.navajo.document.navascript.tags.FinallyTag) MethodsTag(com.dexels.navajo.document.navascript.tags.MethodsTag) BlockTag(com.dexels.navajo.document.navascript.tags.BlockTag) DefineTag(com.dexels.navajo.document.navascript.tags.DefineTag) IncludeTag(com.dexels.navajo.document.navascript.tags.IncludeTag) MessageTag(com.dexels.navajo.document.navascript.tags.MessageTag) SynchronizedTag(com.dexels.navajo.document.navascript.tags.SynchronizedTag)

Aggregations

CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)2 XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)2 ValidationsTag (com.dexels.navajo.document.navascript.tags.ValidationsTag)2 BlockTag (com.dexels.navajo.document.navascript.tags.BlockTag)1 BreakTag (com.dexels.navajo.document.navascript.tags.BreakTag)1 CheckTag (com.dexels.navajo.document.navascript.tags.CheckTag)1 DebugTag (com.dexels.navajo.document.navascript.tags.DebugTag)1 DefineTag (com.dexels.navajo.document.navascript.tags.DefineTag)1 FinallyTag (com.dexels.navajo.document.navascript.tags.FinallyTag)1 IncludeTag (com.dexels.navajo.document.navascript.tags.IncludeTag)1 LogTag (com.dexels.navajo.document.navascript.tags.LogTag)1 LoopTag (com.dexels.navajo.document.navascript.tags.LoopTag)1 MapTag (com.dexels.navajo.document.navascript.tags.MapTag)1 MessageTag (com.dexels.navajo.document.navascript.tags.MessageTag)1 MethodsTag (com.dexels.navajo.document.navascript.tags.MethodsTag)1 ParamTag (com.dexels.navajo.document.navascript.tags.ParamTag)1 SynchronizedTag (com.dexels.navajo.document.navascript.tags.SynchronizedTag)1