Search in sources :

Example 21 with CaseSensitiveXMLElement

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

the class GeoPoint method createPlaceMark.

@Override
public XMLElement createPlaceMark() {
    XMLElement c = new CaseSensitiveXMLElement("Placemark");
    c.setAttribute("id", id);
    c.addTagKeyValue("name", id);
    XMLElement point = createElement();
    c.addChild(point);
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 22 with CaseSensitiveXMLElement

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

the class GeoPolygon method createElement.

@Override
public XMLElement createElement() {
    XMLElement c = new CaseSensitiveXMLElement("Polygon");
    XMLElement d = new CaseSensitiveXMLElement("outerBoundaryIs");
    XMLElement e = new CaseSensitiveXMLElement("LinearRing");
    c.addChild(d);
    d.addChild(e);
    StringBuffer sb = new StringBuffer();
    // for (GeoEdge g : createEdgeList()) {
    // sb.append(g.a);
    // sb.append(" ");
    // }
    c.addTagKeyValue("name", id);
    c.setAttribute("id", id);
    for (GeoPoint a : myStartPoints) {
        sb.append(a.getCoordinates());
        sb.append(" ");
    }
    e.addTagKeyValue("coordinates", sb.toString());
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 23 with CaseSensitiveXMLElement

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

the class GeoPolygon method createPlaceMark.

public XMLElement createPlaceMark(String label) {
    XMLElement c = new CaseSensitiveXMLElement("Placemark");
    if (label == null) {
        c.setAttribute("id", id);
        c.addTagKeyValue("name", id);
    } else {
        c.setAttribute("id", label);
        c.addTagKeyValue("name", label);
    }
    XMLElement poly = createElement();
    c.addChild(poly);
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 24 with CaseSensitiveXMLElement

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

the class NavajoFactory method readTypes.

private void readTypes() throws ClassNotFoundException, IOException {
    ClassLoader cl = getClass().getClassLoader();
    if (cl == null) {
        logger.info("Bootstrap classloader detected!");
        cl = ClassLoader.getSystemClassLoader();
    }
    InputStream is = cl.getResourceAsStream("navajotypes.xml");
    CaseSensitiveXMLElement types = new CaseSensitiveXMLElement();
    types.parseFromStream(is);
    is.close();
    Vector<XMLElement> children = types.getChildren();
    for (int i = 0; i < children.size(); i++) {
        XMLElement child = children.get(i);
        String navajotype = (String) child.getAttribute("name");
        String javaclass = (String) child.getAttribute("type");
        String generic = (String) child.getAttribute("generic");
        Class<?> c = Class.forName(javaclass);
        toJavaType.put(navajotype, c);
        toJavaGenericType.put(navajotype, generic);
        toNavajoType.put(c, navajotype);
    }
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 25 with CaseSensitiveXMLElement

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

the class ScriptCompiler method addProperty.

private void addProperty(final String key, final String type, final String value, final XMLElement xe) {
    XMLElement property = new CaseSensitiveXMLElement("property");
    xe.addChild(property);
    property.setAttribute("name", key);
    property.setAttribute("type", type);
    property.setAttribute("value", value);
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Aggregations

CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)53 XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)49 IOException (java.io.IOException)10 InputStreamReader (java.io.InputStreamReader)7 FileReader (java.io.FileReader)5 HashMap (java.util.HashMap)5 File (java.io.File)3 FileInputStream (java.io.FileInputStream)3 APIException (com.dexels.navajo.article.APIException)2 Message (com.dexels.navajo.document.Message)2 Property (com.dexels.navajo.document.Property)2 BufferedReader (java.io.BufferedReader)2 InputStream (java.io.InputStream)2 PrintWriter (java.io.PrintWriter)2 Reader (java.io.Reader)2 StringReader (java.io.StringReader)2 StringWriter (java.io.StringWriter)2 ArrayList (java.util.ArrayList)2 XMLParseException (com.dexels.navajo.document.nanoimpl.XMLParseException)1 AdapterFieldDependency (com.dexels.navajo.mapping.compiler.meta.AdapterFieldDependency)1