Interface SchemaDocument

All Known Implementing Classes:
SchemaDocumentImpl

public interface SchemaDocument
Represents a parsed XML schema document.

Unlike schema components defined in XS**** interfaces, which are inherently de-coupled from where it was loaded from, SchemaDocument represents a single XML infoset that is a schema document.

This concept is often useful in tracking down the reference relationship among schema documents.

Author:
Kohsuke Kawaguchi
See Also:
  • Method Details

    • getSystemId

      String getSystemId()
      Gets the system ID of the schema document.
      Returns:
      null if XSOMParser was not given the system Id.
    • getTargetNamespace

      String getTargetNamespace()
      The namespace that this schema defines.

      More precisely, this method simply returns the targetNamespace attribute of the schema document. When schemas are referenced in certain ways (AKA chameleon schema), schema components in this schema document may end up defining components in other namespaces.

      Returns:
      can be "" but never null.
    • getSchema

      XSSchema getSchema()
      Gets XSSchema component that contains all the schema components defined in this namespace.

      The returned XSSchema contains not just components defined in this SchemaDocument but all the other components defined in all the schemas that collectively define this namespace.

      Returns:
      never null.
    • getReferencedDocuments

      Set<SchemaDocument> getReferencedDocuments()
      Set of SchemaDocuments that are included/imported from this document.
      Returns:
      can be empty but never null. read-only.
    • getIncludedDocuments

      Set<SchemaDocument> getIncludedDocuments()
      Gets the SchemaDocuments that are included from this document.
      Returns:
      can be empty but never null. read-only. this set is always a subset of getReferencedDocuments().
    • getImportedDocuments

      Set<SchemaDocument> getImportedDocuments(String targetNamespace)
      Gets the SchemaDocuments that are imported from this document.
      Parameters:
      targetNamespace - The namespace URI of the import that you want to get SchemaDocuments for.
      Returns:
      can be empty but never null. read-only. this set is always a subset of getReferencedDocuments().
    • includes

      boolean includes(SchemaDocument doc)
      Returns true if this document includes the given document.

      Note that this method returns false if this document imports the given document.

    • imports

      boolean imports(SchemaDocument doc)
      Returns true if this document imports the given document.

      Note that this method returns false if this document includes the given document.

    • getReferers

      Set<SchemaDocument> getReferers()
      Set of SchemaDocuments that include/import this document.

      This works as the opposite of getReferencedDocuments().

      Returns:
      can be empty but never null. read-only.