Package org.geotools.xml

Examples of org.geotools.xml.ElementInstance


                    logger.fine("Could not find declaration for: " + qualifiedName
                        + ". Checking if containing type declares a single particle.");
                }

                if (parent.getComponent() instanceof ElementInstance) {
                    ElementInstance parentElement = (ElementInstance) parent.getComponent();
                    List childParticles = index.getChildElementParticles(parentElement
                            .getElementDeclaration());

                    if (childParticles.size() == 1) {
                        XSDParticle particle = (XSDParticle) childParticles.iterator().next();
                        XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent();
View Full Code Here


        node.addChild(child.getParseNode());

        //initialize the context for the handler
        if (child instanceof ElementHandler) {
            //get the containing type (we do this for anonymous complex types)
            ElementInstance childInstance = (ElementInstance) child.getComponent();
            ContextInitializer initer = new ContextInitializer(childInstance, node,
                    child.getContext());
            parser.getBindingWalker().walk(element.getElementDeclaration(), initer, container(), getContext());
        }
    }
View Full Code Here

            }
        }
    }

    public void testElement() {
        ElementInstance element = element(" hello world ", XS.ANYSIMPLETYPE);
        assertEquals(" hello world ", element.getText());
        assertEquals(xsdSimple(XS.ANYSIMPLETYPE.getLocalPart()),
            element.getElementDeclaration().getType());
    }
View Full Code Here

    public ElementInstance element(String text, QName qname) {
        // create a fake element declaration and element instance
        XSDElementDeclaration declaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
        declaration.setTypeDefinition(xsdSimple(qname.getLocalPart()));

        ElementInstance element = new ElementImpl(declaration);
        element.setText(text);

        return element;
    }
View Full Code Here

        XSDecimalBinding strat = new XSDecimalBinding();

        XSDElementDeclaration declaration = makeDeclaration(totalDigits, new BigDecimal(minExc),
                new BigDecimal(minInc), new BigDecimal(maxInc), new BigDecimal(maxExc));

        ElementInstance element = new ElementImpl(declaration);
        element.setText(elementText);

        Node[] children = new Node[] {  };
        Object value = null;

        BigDecimal decimal = (BigDecimal) strat.parse(element, element.getText().trim());

        assertNotNull(decimal);
    }
View Full Code Here

        validateValues("12.78e-2", new Double(12.78e-2));
        validateValues("12", new Double(12));
        validateValues("-0", new Double("-0"));
        validateValues("0", new Double(0));

        ElementInstance element = element("INF", XS.DOUBLE);
        assertEquals(new Double(Double.POSITIVE_INFINITY), strategy.parse(element, "INF"));
    }
View Full Code Here

        ElementInstance element = element("INF", XS.DOUBLE);
        assertEquals(new Double(Double.POSITIVE_INFINITY), strategy.parse(element, "INF"));
    }

    public void testIntegerParse() throws Exception {
        ElementInstance element = element("12345", XS.INTEGER);
        assertEquals(new Double(12345.0), strategy.parse(element, "12345"));
    }
View Full Code Here

        XSDElementDeclaration declaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
        declaration.setName(name);
        declaration.setTargetNamespace(namespace);
        declaration.setTypeDefinition(findTypeDefinition(schema, type));

        ElementInstance element = new ElementImpl(declaration);

        element.setName(name);
        element.setNamespace(namespace);
        element.setText(text);

        return element;
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.ElementInstance

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.