com.sun.xml.xsom.impl.parser
Class SchemaDocumentImpl

java.lang.Object
  extended by com.sun.xml.xsom.impl.parser.SchemaDocumentImpl
All Implemented Interfaces:
SchemaDocument

public final class SchemaDocumentImpl
extends Object
implements SchemaDocument

SchemaDocument implementation.

Author:
Kohsuke Kawaguchi

Constructor Summary
protected SchemaDocumentImpl(SchemaImpl schema, String _schemaDocumentURI)
           
 
Method Summary
 boolean equals(Object o)
           
 Set<SchemaDocument> getImportedDocuments(String targetNamespace)
          Gets the SchemaDocuments that are imported from this document.
 Set<SchemaDocument> getIncludedDocuments()
          Gets the SchemaDocuments that are included from this document.
 Set<SchemaDocument> getReferencedDocuments()
          Set of SchemaDocuments that are included/imported from this document.
 Set<SchemaDocument> getReferers()
          Set of SchemaDocuments that include/import this document.
 SchemaImpl getSchema()
          Gets XSSchema component that contains all the schema components defined in this namespace.
 String getSystemId()
          Gets the system ID of the schema document.
 String getTargetNamespace()
          The namespace that this schema defines.
 int hashCode()
           
 boolean imports(SchemaDocument doc)
          Returns true if this document imports the given document.
 boolean includes(SchemaDocument doc)
          Returns true if this document includes the given document.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaDocumentImpl

protected SchemaDocumentImpl(SchemaImpl schema,
                             String _schemaDocumentURI)
Method Detail

getSystemId

public String getSystemId()
Description copied from interface: SchemaDocument
Gets the system ID of the schema document.

Specified by:
getSystemId in interface SchemaDocument
Returns:
null if XSOMParser was not given the system Id.

getTargetNamespace

public String getTargetNamespace()
Description copied from interface: SchemaDocument
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.

Specified by:
getTargetNamespace in interface SchemaDocument
Returns:
can be "" but never null.

getSchema

public SchemaImpl getSchema()
Description copied from interface: SchemaDocument
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.

Specified by:
getSchema in interface SchemaDocument
Returns:
never null.

getReferencedDocuments

public Set<SchemaDocument> getReferencedDocuments()
Description copied from interface: SchemaDocument
Set of SchemaDocuments that are included/imported from this document.

Specified by:
getReferencedDocuments in interface SchemaDocument
Returns:
can be empty but never null. read-only.

getIncludedDocuments

public Set<SchemaDocument> getIncludedDocuments()
Description copied from interface: SchemaDocument
Gets the SchemaDocuments that are included from this document.

Specified by:
getIncludedDocuments in interface SchemaDocument
Returns:
can be empty but never null. read-only. this set is always a subset of SchemaDocument.getReferencedDocuments().

getImportedDocuments

public Set<SchemaDocument> getImportedDocuments(String targetNamespace)
Description copied from interface: SchemaDocument
Gets the SchemaDocuments that are imported from this document.

Specified by:
getImportedDocuments in interface SchemaDocument
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 SchemaDocument.getReferencedDocuments().

includes

public boolean includes(SchemaDocument doc)
Description copied from interface: SchemaDocument
Returns true if this document includes the given document.

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

Specified by:
includes in interface SchemaDocument

imports

public boolean imports(SchemaDocument doc)
Description copied from interface: SchemaDocument
Returns true if this document imports the given document.

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

Specified by:
imports in interface SchemaDocument

getReferers

public Set<SchemaDocument> getReferers()
Description copied from interface: SchemaDocument
Set of SchemaDocuments that include/import this document.

This works as the opposite of SchemaDocument.getReferencedDocuments().

Specified by:
getReferers in interface SchemaDocument
Returns:
can be empty but never null. read-only.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012 Oracle. All Rights Reserved.