Package org.geotools.xml

Examples of org.geotools.xml.Node


        if (clazz == null) {
            return matches;
        }

        for (Iterator itr = children.iterator(); itr.hasNext();) {
            Node child = (Node) itr.next();
            Object parsed = child.getValue();

            if (parsed == null) {
                continue;
            }
View Full Code Here


       
        //TODO: this doesn't actually handle the case of an extended operator that does not take
        // any arguments
        if (node.hasChild(Expression.class)) {
            //case of a single operator containing a single expression
            Node n = node.getChild(Expression.class);
            Name opName = new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
           
            Filter extOp = lookupExtendedOperator(opName, Arrays.asList((Expression) n.getValue()), factory);
            if (extOp != null) {
                extOps.add(extOp);
            }
        }
        else if (node.hasChild(Map.class)) {
            List<Node> children = node.getChildren(Map.class);
            for (Node n : children) {
                Name opName = new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
                Map map = (Map) n.getValue();
               
                List<Expression> expressions = new ArrayList();
                for (Object o : map.values()) {
                    if (o instanceof Expression) {
                        expressions.add((Expression) o);
View Full Code Here

            spatial = ff.literal(polygon);
        }
        else {
            //look for an expression that is not a property name
            for (Iterator c = node.getChildren().iterator(); c.hasNext(); ) {
                Node child = (Node) c.next();
               
                //if property name, skip
                if ( child.getValue() instanceof PropertyName ) {
                    continue;
                }
               
                //if expression, use it
                if ( child.getValue() instanceof Expression ) {
                    spatial = (Expression) child.getValue();
                    break;
                }
            }
        }
View Full Code Here

        children.add(child);
        child.setParent(this);
    }

    public Node removeChild(String name) {
        Node child = getChild(name);

        if (child != null) {
            if (children.remove(child)) {
                child.setParent(null);
            }
        }

        return child;
    }
View Full Code Here

    public void addAttribute(Node attribute) {
        attributes.add(attribute);
    }

    public Node removeAttribute(String name) {
        Node attribute = getAttribute(name);

        if (attribute != null) {
            attributes.remove(attribute);
        }
View Full Code Here

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
       
        Node attr = node.getChild("containment");

        if (null != attr) {
            attr.setValue(ContainmentType.get((String)attr.getValue()));
        }

        return super.parse(instance, node, value);

    }
View Full Code Here

        //            ElementHandlerPropertyHandler.class);
        JXPathIntrospector.registerDynamicClass(NodeImpl.class, NodePropertyHandler.class);

        //        ElementHandler rootHandler =
        //          ((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
        Node root = ((DocumentHandler) handlers.firstElement()).getParseNode();
        JXPathContext jxpContext = JXPathContextFactory.newInstance().newContext(null, root);

        jxpContext.setLenient(true);

        Iterator itr = jxpContext.iterate(xpath);
View Full Code Here

*
* @source $URL$
*/
public class NodePropertyHandler implements DynamicPropertyHandler {
    public Object getProperty(Object object, String property) {
        Node node = (Node) object;

        return node.getChildren(property);
    }
View Full Code Here

        return node.getChildren(property);
    }

    public String[] getPropertyNames(Object object) {
        Node node = (Node) object;
        List children = node.getChildren();

        if ((children == null) || children.isEmpty()) {
            return new String[] {  };
        }

        String[] propertyNames = new String[children.size()];

        for (int i = 0; i < children.size(); i++) {
            Node child = (Node) children.get(i);
            propertyNames[i] = child.getComponent().getName();
        }

        return propertyNames;
    }
View Full Code Here

            }
        }

        //application schema defined attributes
        for (Iterator c = node.getChildren().iterator(); c.hasNext();) {
            Node child = (Node) c.next();
            String name = child.getComponent().getName();
            Object valu = child.getValue();

            // if the next property is of type geometry, let's set its CRS
            if (Geometry.class.isAssignableFrom(valu.getClass()) && crs != null) {
                ftBuilder.crs(crs);
            }
View Full Code Here

TOP

Related Classes of org.geotools.xml.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.