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 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)){
               
                if (t.getParent() instanceof ComplexType){
                    t = (ComplexType) t.getParent();
                }else
                    t=null;
            }

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

        public boolean cache(Element element, Map hints) {
            if ((hints == null) || (hints.get(XMLHandlerHints.STREAM_HINT) == null)) {
                return true;
            }

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

            while (e != null) {
                if ((e.getName() != null)
                        && e.getName().equals(BoxType.getInstance().getName())) {
                    return true;
                }

                e = (e.getParent() instanceof ComplexType)
                    ? (ComplexType) e.getParent() : null;
            }

            return false;
        }
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 FeatureCollection)
                && ((SimpleFeatureCollection)value).getBounds()!=null);
        }
View Full Code Here

                output.startElement(GMLSchema.NAMESPACE, "featureMember", null);

                if (e == null) { // first time
                    e = output.findElement(f.getFeatureType().getTypeName());
                    // should go to an abstract FT eventually
                    ComplexType t = e.getType() instanceof ComplexType? (ComplexType)e.getType():null;
                    while(t!=null && t!=AbstractFeatureType.getInstance())
                        t = t.getParent() instanceof ComplexType? (ComplexType)t.getParent():null;
                    if(t!=AbstractFeatureType.getInstance()){
                        // not the right element ... try by type
                        e = output.findElement(value);
                        // should go to an abstract FT eventually
                        t = e.getType() instanceof ComplexType? (ComplexType)e.getType():null;
                        while(t!=null && t!=AbstractFeatureType.getInstance())
                            t = t.getParent() instanceof ComplexType? (ComplexType)t.getParent():null;
                        if(t!=AbstractFeatureType.getInstance()){
                            throw new OperationNotSupportedException("Could not find a correct Element for FeatureType "+f.getFeatureType().getTypeName());
                        }
                    }
                }
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 Geometry));
        }
View Full Code Here

        public boolean canEncode(Element element, Object value, Map hints) {
            if (!(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 == this;
        }
View Full Code Here

            if ((value == null) || (element == null)
                    || !(value instanceof Geometry)) {
                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

        public boolean canEncode(Element element, Object value, Map hints) {
            if ((value == null) || !(value instanceof Point)) {
                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

        /**
         * @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 Point));
        }
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.