Class SimpleTypeGT

    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleTypeGT​(String id, String name, URI namespace, int type, SimpleType[] parents, Facet[] constraints, int finaL)
      Creates a new SimpleTypeGT object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canCreateAttributes​(Attribute attribute, Object value, Map<String,​Object> hints)  
      boolean canEncode​(Element element, Object value, Map<String,​Object> hints)
      Can I write this object out as element specified?
      void encode​(Element element, Object value, PrintHandler output, Map<String,​Object> hints)
      Encode value as element on the provided output.
      Element findChildElement​(String name1)
      Convinience method used to search this type's children for the requested element by localName.
      int getChildType()
      Returns an int of either List, Union or Restriction
      Facet[] getFacets()
      The list of facets for this Restriction ...
      int getFinal()
      This specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.
      String getId()
      The Schema ID for this simpleType definition.
      Class getInstanceType()
      This will return the intended Java Class for this element type.
      String getName()
      This returns the XML Schema declaration name of this type (both complex and simple types have names ...)
      URI getNamespace()
      This is used for validation of an XML document, and represents the targetNamespace of that this type resides in.
      SimpleType[] getParents()
      A simple simpleType when either a List or Restriction ...
      Object getValue​(Element element, ElementValue[] value, Attributes attrs, Map<String,​Object> hints)
      This method ignores the attributes from the xml node
      AttributeValue toAttribute​(Attribute attribute, Object value, Map<String,​Object> hints)
      returns the value as a string
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleTypeGT

        public SimpleTypeGT​(String id,
                            String name,
                            URI namespace,
                            int type,
                            SimpleType[] parents,
                            Facet[] constraints,
                            int finaL)
        Creates a new SimpleTypeGT object.
    • Method Detail

      • getInstanceType

        public Class getInstanceType()
        Description copied from interface: Type
        This will return the intended Java Class for this element type. For generic complex types this will be an object array. SimpleTypes will match as they are parsed, and custom extensions will also return the appropriate class value.
        Specified by:
        getInstanceType in interface Type
        See Also:
        org.geotools.xml.xsi.Type#getInstanceType()
      • findChildElement

        public Element findChildElement​(String name1)
        Description copied from interface: Type
        Convinience method used to search this type's children for the requested element by localName.
        Specified by:
        findChildElement in interface Type
        Parameters:
        name1 - the element's localName to search for.
        See Also:
        Type.findChildElement(java.lang.String)
      • getFinal

        public int getFinal()
        Description copied from interface: SimpleType
        This specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.
        Specified by:
        getFinal in interface SimpleType
        See Also:
        org.geotools.xml.xsi.SimpleType#getFinal()
      • getId

        public String getId()
        Description copied from interface: SimpleType
        The Schema ID for this simpleType definition.
        Specified by:
        getId in interface SimpleType
        See Also:
        org.geotools.xml.xsi.SimpleType#getId()
      • getName

        public String getName()
        Description copied from interface: Type
        This returns the XML Schema declaration name of this type (both complex and simple types have names ...)
        Specified by:
        getName in interface Type
        See Also:
        org.geotools.xml.xsi.Type#getLocalName()
      • getNamespace

        public URI getNamespace()
        Description copied from interface: Type
        This is used for validation of an XML document, and represents the targetNamespace of that this type resides in.
        Specified by:
        getNamespace in interface Type
        See Also:
        org.geotools.xml.xsi.Type#getLocalName()
      • getParents

        public SimpleType[] getParents()
        Description copied from interface: SimpleType
        A simple simpleType when either a List or Restriction ... A set when a Union
        Specified by:
        getParents in interface SimpleType
        See Also:
        org.geotools.xml.xsi.Type#getParent()
      • getValue

        public Object getValue​(Element element,
                               ElementValue[] value,
                               Attributes attrs,
                               Map<String,​Object> hints)
                        throws OperationNotSupportedException,
                               SAXException
        This method ignores the attributes from the xml node
        Specified by:
        getValue in interface Type
        Returns:
        Object
        Throws:
        OperationNotSupportedException
        SAXException
        See Also:
        schema.Type#getValue(java.lang.Object, org.xml.sax.Attributes)
      • canEncode

        public boolean canEncode​(Element element,
                                 Object value,
                                 Map<String,​Object> hints)
        Description copied from interface: Type
        Can I write this object out as element specified?
        Specified by:
        canEncode in interface Type
        Parameters:
        element - The element which may be used to represent the Object. This is included to allow for child definitions to include addition information where appropriate.
        value - An Object which may or may not be encodeable by this type. The value may also be null.
        Returns:
        True when the encode method can interpret the given element/value pair into valid xml.
        See Also:
        Type.canEncode(org.geotools.xml.schema.Element, java.lang.Object, java.util.Map)
      • encode

        public void encode​(Element element,
                           Object value,
                           PrintHandler output,
                           Map<String,​Object> hints)
                    throws IOException,
                           OperationNotSupportedException
        Description copied from interface: Type
        Encode value as element on the provided output.

        This is encoding because the PrintHandler does not have to go back to a stream.

        Specified by:
        encode in interface Type
        Parameters:
        element - The original element declaration to which we should encode.
        value - The Object to encode.
        output - This is where the output should be written to.
        hints - For providing additional context information to specific schemas.
        Throws:
        IOException - When there is an error with the Writer.
        OperationNotSupportedException - When this type cannot be encoded ... and wasn't checked first.
        See Also:
        Type.encode(org.geotools.xml.schema.Element, java.lang.Object, org.geotools.xml.PrintHandler, java.util.Map)