Package org.geotools.xml.schema

Examples of org.geotools.xml.schema.ComplexType


        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof Geometry));
        }
View Full Code Here


                Type type=element.getType();
                if( type instanceof SimpleType ){
                    SimpleType simple=(SimpleType) type;
                    simple.encode(element, value, output, hints);
                }else if (type instanceof ComplexType) {
                    ComplexType complex = (ComplexType) type;
                    Element[] children = complex.getChildElements();
                    boolean found=false;
                    for (int i = 0; i < children.length; i++) {
                        Element child = children[i];
                        if( child.getType().canEncode(child, value, hints) ){
                            child.getType().encode(child, value, output, hints);
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof LineString));
        }
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof Polygon));
        }
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof LinearRing));
        }
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof MultiPolygon));
        }
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof Coordinate));
        }
View Full Code Here

        /**
         * @see org.geotools.xml.schema.Type#canEncode(org.geotools.xml.schema.Element,
         *      java.lang.Object, java.util.Map)
         */
        public boolean canEncode(Element element, Object value, Map hints) {
            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;

            return ((t != null) && (value instanceof CoordinateSequence));
        }
View Full Code Here

            if ((value == null) || (element == null)
                    || value instanceof FeatureCollection || !(value instanceof SimpleFeature)) {
                return false;
            }

            ComplexType t = (element.getType() instanceof ComplexType)
                ? (ComplexType) element.getType() : null;

            while ((t != null) && (t != this))
                t = (t.getParent() instanceof ComplexType)
                    ? (ComplexType) t.getParent() : null;
            return t != null;
        }
View Full Code Here

            Attributes attrs, Map hints)
            throws SAXException, SAXNotSupportedException {
            if (element != null) {
                if (element.getType() != this) {
                    if (!(element.getType() instanceof ComplexType)) {
                        ComplexType t = (ComplexType) element.getType();

                        while ((t != null) && (t != this))
                            t = (t.getParent() instanceof ComplexType)
                                ? (ComplexType) t.getParent() : null;

                        if (t == null) {
                            throw new SAXNotSupportedException(
                                "The specified element was not a declared as a WFS_Capabilities element, or derived element");
                        }
                    } else {
                        // error -- cannot encode
                        throw new SAXNotSupportedException(
                            "The specified element was not a declared as a WFS_Capabilities element, or derived element");
                    }
                }
            }

            boolean validation = true;
            if(hints != null && hints.containsKey(DocumentFactory.VALIDATION_HINT)){
                Boolean t = (Boolean)hints.get(DocumentFactory.VALIDATION_HINT);
                if(t!=null)
                    validation = t.booleanValue();
            }
           
            if (validation && ((value == null) || (value.length != 4))) {
                throw new SAXException(
                    "The WFS Capabilites document has the wrong number of children");
View Full Code Here

TOP

Related Classes of org.geotools.xml.schema.ComplexType

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.