Search in sources :

Example 66 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class MethodDefinition method parseDef.

public static MethodDefinition parseDef(XMLElement e) {
    Map<String, ParameterDefinition> params = new HashMap<>();
    String name = (String) e.getAttribute("name");
    Vector<XMLElement> paramV = e.getChildren();
    for (int i = 0; i < paramV.size(); i++) {
        XMLElement c = paramV.get(i);
        ParameterDefinition pd = ParameterDefinition.parseDef(c, i);
        params.put(pd.getName(), pd);
    }
    return new MethodDefinition(name, params);
}
Also used : HashMap(java.util.HashMap) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 67 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class TslMetaDataHandler method addScriptElement.

/**
 * @param x
 * @param element
 */
private void addScriptElement(XMLElement x, String element) {
    XMLElement xn = new CaseSensitiveXMLElement();
    xn.setName("script");
    x.addChild(xn);
    xn.setAttribute("name", element);
    addAdapters(xn, element);
    addCalls(xn, element);
    addCalledBy(xn, element);
    addIncludes(xn, element);
    addIncomingIncludes(xn, element);
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 68 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class TslMetaDataHandler method addCalls.

private void addCalls(XMLElement xn, String element) {
    TreeSet<String> s = callsScriptMap.get(element);
    if (s == null) {
        return;
    }
    for (Iterator<String> iter = s.iterator(); iter.hasNext(); ) {
        String include = iter.next();
        XMLElement xnincl = new CaseSensitiveXMLElement();
        xnincl.setName("calls");
        xnincl.setAttribute("name", include);
        xn.addChild(xnincl);
    }
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 69 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class TslMetaDataHandler method parseMetaData.

/**
 * @param e
 */
private void parseMetaData(XMLElement e) {
    if (!"metadata".equals(e.getName())) {
        logger.info("Unknown root tag in metadata: " + e.getName());
        return;
    }
    Vector<XMLElement> v = e.getChildren();
    for (Iterator<XMLElement> iter = v.iterator(); iter.hasNext(); ) {
        XMLElement element = iter.next();
        if (!"script".equals(element.getName())) {
            logger.info("Unknown tag within metadata: " + element.getName());
            return;
        }
        String scriptName = element.getStringAttribute("name");
        scriptList.add(scriptName);
        parseScriptData(scriptName, element);
    }
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 70 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class TslMetaDataHandler method addIncomingIncludes.

/**
 * @param xn
 * @param element
 */
private void addIncomingIncludes(XMLElement xn, String element) {
    TreeSet<String> s = includedByScriptMap.get(element);
    if (s == null) {
        return;
    }
    for (Iterator<String> iter = s.iterator(); iter.hasNext(); ) {
        String include = iter.next();
        XMLElement xnincl = new CaseSensitiveXMLElement();
        xnincl.setName("includedby");
        xnincl.setAttribute("name", include);
        xn.addChild(xnincl);
    }
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Aggregations

XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)120 CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)109 MapTag (com.dexels.navajo.document.navascript.tags.MapTag)12 IOException (java.io.IOException)12 NS3Compatible (com.dexels.navajo.document.navascript.tags.NS3Compatible)10 ArrayList (java.util.ArrayList)8 ParamTag (com.dexels.navajo.document.navascript.tags.ParamTag)7 InputStreamReader (java.io.InputStreamReader)7 HashMap (java.util.HashMap)7 APIException (com.dexels.navajo.article.APIException)6 ExpressionTag (com.dexels.navajo.document.navascript.tags.ExpressionTag)5 FieldTag (com.dexels.navajo.document.navascript.tags.FieldTag)5 FileInputStream (java.io.FileInputStream)5 FileReader (java.io.FileReader)5 Property (com.dexels.navajo.document.Property)4 IncludeTag (com.dexels.navajo.document.navascript.tags.IncludeTag)4 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)4 File (java.io.File)4 Message (com.dexels.navajo.document.Message)3 BlockTag (com.dexels.navajo.document.navascript.tags.BlockTag)3