Class SchemaProcessor


  • public class SchemaProcessor
    extends java.lang.Object
    A Schema processor that collects the XSD simple types of elements and attributes declarations.

    Maps of element/attribute local name to a set of XSDataType are created when a schema is processed.

    • Field Detail

      • _schema

        private java.util.List<java.net.URL> _schema
      • _filter

        private java.util.Set<XSDataType> _filter
      • _elementMap

        private java.util.Map<java.lang.String,​java.util.Set<XSDataType>> _elementMap
      • _attributeMap

        private java.util.Map<java.lang.String,​java.util.Set<XSDataType>> _attributeMap
      • _element

        private javax.xml.namespace.QName _element
      • _attribute

        private javax.xml.namespace.QName _attribute
      • _isListSimpleType

        private boolean _isListSimpleType
    • Constructor Detail

      • SchemaProcessor

        public SchemaProcessor​(java.net.URL schema)
      • SchemaProcessor

        public SchemaProcessor​(java.util.List<java.net.URL> schema)
    • Method Detail

      • getElementToXSDataTypeMap

        public java.util.Map<java.lang.String,​java.util.Set<XSDataType>> getElementToXSDataTypeMap()
      • getAttributeToXSDataTypeMap

        public java.util.Map<java.lang.String,​java.util.Set<XSDataType>> getAttributeToXSDataTypeMap()
      • process

        public void process()
                     throws java.lang.Exception
        Process the schema.
        Throws:
        java.lang.Exception
      • process

        public void process​(java.util.Set<XSDataType> filter)
                     throws java.lang.Exception
        Process the schema.

        Parameters:
        filter - if not null only include elements/attributes with simple types if it is present in the Set of XS data type. Otherwise all elements/attributes with simple types are included.
        Throws:
        java.lang.Exception
      • addToMap

        private void addToMap​(java.util.Map<java.lang.String,​java.util.Set<XSDataType>> map,
                              java.lang.String localName,
                              java.lang.String typeName)
      • reset

        private void reset()
      • qname

        private javax.xml.namespace.QName qname​(com.sun.xml.xsom.XSDeclaration d)
      • print

        private void print()
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception