Top Fields Constructors Methods
com.sun.xml.xsom.impl

public Class SchemaImpl

extends Object
implements XSSchema
Class Inheritance
All Implemented Interfaces
com.sun.xml.xsom.XSSchema, com.sun.xml.xsom.XSComponent
Imports
com.sun.xml.xsom.ForeignAttributes, .SCD, .XSAnnotation, .XSAttGroupDecl, .XSAttributeDecl, .XSComplexType, .XSComponent, .XSElementDecl, .XSIdentityConstraint, .XSModelGroupDecl, .XSNotation, .XSSchema, .XSSimpleType, .XSType, com.sun.xml.xsom.parser.SchemaDocument, com.sun.xml.xsom.visitor.XSFunction, .XSVisitor, org.xml.sax.Locator, javax.xml.namespace.NamespaceContext, java.text.ParseException, java.util.ArrayList, .Collection, .Collections, .HashMap, .Iterator, .LinkedHashMap, .List, .Map

Field Summary

Modifier and TypeField and Description
private final Map<String, XSType>
private final Map<String, XSType>
private XSAnnotation
private final Map<String, XSAttGroupDecl>
private final Map<String, XSAttGroupDecl>
private final Map<String, XSAttributeDecl>
private final Map<String, XSAttributeDecl>
private final Map<String, XSComplexType>
private final Map<String, XSComplexType>
private final Map<String, XSElementDecl>
private final Map<String, XSElementDecl>
private List<ForeignAttributes>
foreignAttributes

Lazily created list of ForeignAttributesImpls.

private final Map<String, XSIdentityConstraint>
private final Map<String, XSIdentityConstraint>
private final Locator
private final Map<String, XSModelGroupDecl>
private final Map<String, XSModelGroupDecl>
private final Map<String, XSNotation>
private final Map<String, XSNotation>
protected final SchemaSetImpl
private List<ForeignAttributes>
private final Map<String, XSSimpleType>
private final Map<String, XSSimpleType>
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite)

public void
public void
addComplexType(XSComplexType newDecl, boolean overwrite)

public void
public void
protected void
public void
addModelGroupDecl(XSModelGroupDecl newDecl, boolean overwrite)

public void
public void
addSimpleType(XSSimpleType newDecl, boolean overwrite)

public <T> T
apply(XSFunction<T> function)

Implements com.sun.xml.xsom.XSComponent.apply.

Accepts a functor.

public XSAnnotation
getAnnotation()

Implements com.sun.xml.xsom.XSComponent.getAnnotation.

Gets the annotation associated to this component, if any.

public XSAnnotation
getAnnotation(boolean createIfNotExist)

Implements com.sun.xml.xsom.XSComponent.getAnnotation.

Works like getAnnotation(), but allow a new empty XSAnnotation to be created if not exist.

public XSAttGroupDecl
public Map<String, XSAttGroupDecl>
public XSAttributeDecl
public Map<String, XSAttributeDecl>
getAttributeDecls()

Implements com.sun.xml.xsom.XSSchema.getAttributeDecls.

Gets all the XSAttributeDecls in this schema keyed by their local names.

public XSComplexType
public Map<String, XSComplexType>
getComplexTypes()

Implements com.sun.xml.xsom.XSSchema.getComplexTypes.

Gets all the XSComplexTypes in this schema.

public XSElementDecl
public Map<String, XSElementDecl>
getElementDecls()

Implements com.sun.xml.xsom.XSSchema.getElementDecls.

Gets all the XSElementDecls in this schema.

public String
getForeignAttribute(String nsUri, String localName)

Implements com.sun.xml.xsom.XSComponent.getForeignAttribute.

Gets the foreign attribute of the given name, or null if not found.

public List<ForeignAttributes>
getForeignAttributes()

Implements com.sun.xml.xsom.XSComponent.getForeignAttributes.

Gets the foreign attributes on this schema component.

public XSIdentityConstraint
getIdentityConstraint(String localName)

Implements com.sun.xml.xsom.XSSchema.getIdentityConstraint.

Gets the identity constraint of the given name, or null if not found.

public Map<String, XSIdentityConstraint>
getIdentityConstraints()

Implements com.sun.xml.xsom.XSSchema.getIdentityConstraints.

Gets all the XSIdentityConstraints in this schema, keyed by their names.

public Locator
getLocator()

Implements com.sun.xml.xsom.XSComponent.getLocator.

Gets the locator that indicates the source location where this component is created from, or null if no information is available.

public XSModelGroupDecl
public Map<String, XSModelGroupDecl>
public XSNotation
public Map<String, XSNotation>
getNotations()

Implements com.sun.xml.xsom.XSSchema.getNotations.

Gets all the XSNotations in this schema.

public XSSchema
getOwnerSchema()

Implements com.sun.xml.xsom.XSComponent.getOwnerSchema.

Gets a reference to the XSSchema object to which this component belongs.

public SchemaSetImpl
getRoot()

Implements com.sun.xml.xsom.XSSchema.getRoot.

Gets the root schema set that includes this schema.

public XSSimpleType
public Map<String, XSSimpleType>
getSimpleTypes()

Implements com.sun.xml.xsom.XSSchema.getSimpleTypes.

Gets all the XSSimpleTypes in this schema.

public SchemaDocument
getSourceDocument()

Implements com.sun.xml.xsom.XSSchema.getSourceDocument.

Sine an is not necessarily defined in one schema document (for example one schema can span across many documents through <xs:include>s.), so this method always returns null.

public String
getTargetNamespace()

Implements com.sun.xml.xsom.XSSchema.getTargetNamespace.

Gets the target namespace of the schema.

public XSType
public Map<String, XSType>
getTypes()

Implements com.sun.xml.xsom.XSSchema.getTypes.

Gets all the XSTypes in this schema (union of getSimpleTypes() and getComplexTypes()

public Iterator<XSAttGroupDecl>
public Iterator<XSAttributeDecl>
public Iterator<XSComplexType>
public Iterator<XSElementDecl>
public Iterator<XSModelGroupDecl>
public Iterator<XSNotation>
public Iterator<XSSimpleType>
public Iterator<XSType>
public Collection<XSComponent>
select(String scd, NamespaceContext nsContext)

Implements com.sun.xml.xsom.XSComponent.select.

Evaluates a schema component designator against this schema component and returns the resulting schema components.

public XSComponent
selectSingle(String scd, NamespaceContext nsContext)

Implements com.sun.xml.xsom.XSComponent.selectSingle.

Evaluates a schema component designator against this schema component and returns the first resulting schema component.

public void
public void
visit(XSVisitor visitor)

Implements com.sun.xml.xsom.XSComponent.visit.

Accepts a visitor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allTypesback to summary
private final Map<String, XSType> allTypes
allTypesViewback to summary
private final Map<String, XSType> allTypesView
annotationback to summary
private XSAnnotation annotation
attGroupsback to summary
private final Map<String, XSAttGroupDecl> attGroups
attGroupsViewback to summary
private final Map<String, XSAttGroupDecl> attGroupsView
attsback to summary
private final Map<String, XSAttributeDecl> atts
attsViewback to summary
private final Map<String, XSAttributeDecl> attsView
complexTypesback to summary
private final Map<String, XSComplexType> complexTypes
complexTypesViewback to summary
private final Map<String, XSComplexType> complexTypesView
elemsback to summary
private final Map<String, XSElementDecl> elems
elemsViewback to summary
private final Map<String, XSElementDecl> elemsView
foreignAttributesback to summary
private List<ForeignAttributes> foreignAttributes

Lazily created list of ForeignAttributesImpls.

idConstraintsback to summary
private final Map<String, XSIdentityConstraint> idConstraints
idConstraintsViewback to summary
private final Map<String, XSIdentityConstraint> idConstraintsView
locatorback to summary
private final Locator locator
modelGroupsback to summary
private final Map<String, XSModelGroupDecl> modelGroups
modelGroupsViewback to summary
private final Map<String, XSModelGroupDecl> modelGroupsView
notationsback to summary
private final Map<String, XSNotation> notations
notationsViewback to summary
private final Map<String, XSNotation> notationsView
parentback to summary
protected final SchemaSetImpl parent
readOnlyForeignAttributesback to summary
private List<ForeignAttributes> readOnlyForeignAttributes
simpleTypesback to summary
private final Map<String, XSSimpleType> simpleTypes
simpleTypesViewback to summary
private final Map<String, XSSimpleType> simpleTypesView
targetNamespaceback to summary
private final String targetNamespace

Constructor Detail

SchemaImplback to summary
public SchemaImpl(SchemaSetImpl _parent, Locator loc, String tns)

Method Detail

addAttGroupDeclback to summary
public void addAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite)
addAttributeDeclback to summary
public void addAttributeDecl(XSAttributeDecl newDecl)
addComplexTypeback to summary
public void addComplexType(XSComplexType newDecl, boolean overwrite)
addElementDeclback to summary
public void addElementDecl(XSElementDecl newDecl)
addForeignAttributesback to summary
public void addForeignAttributes(ForeignAttributesImpl fa)
addIdentityConstraintback to summary
protected void addIdentityConstraint(IdentityConstraintImpl c)
addModelGroupDeclback to summary
public void addModelGroupDecl(XSModelGroupDecl newDecl, boolean overwrite)
addNotationback to summary
public void addNotation(XSNotation newDecl)
addSimpleTypeback to summary
public void addSimpleType(XSSimpleType newDecl, boolean overwrite)
applyback to summary
public <T> T apply(XSFunction<T> function)

Implements com.sun.xml.xsom.XSComponent.apply.

Doc from com.sun.xml.xsom.XSComponent.apply.

Accepts a functor.

getAnnotationback to summary
public XSAnnotation getAnnotation()

Implements com.sun.xml.xsom.XSComponent.getAnnotation.

Doc from com.sun.xml.xsom.XSComponent.getAnnotation.

Gets the annotation associated to this component, if any.

getAnnotationback to summary
public XSAnnotation getAnnotation(boolean createIfNotExist)

Implements com.sun.xml.xsom.XSComponent.getAnnotation.

Doc from com.sun.xml.xsom.XSComponent.getAnnotation.

Works like getAnnotation(), but allow a new empty XSAnnotation to be created if not exist.

getAttGroupDeclback to summary
public XSAttGroupDecl getAttGroupDecl(String name)

Implements com.sun.xml.xsom.XSSchema.getAttGroupDecl.

getAttGroupDeclsback to summary
public Map<String, XSAttGroupDecl> getAttGroupDecls()

Implements com.sun.xml.xsom.XSSchema.getAttGroupDecls.

Doc from com.sun.xml.xsom.XSSchema.getAttGroupDecls.

Gets all the XSAttGroupDecls in this schema.

getAttributeDeclback to summary
public XSAttributeDecl getAttributeDecl(String name)

Implements com.sun.xml.xsom.XSSchema.getAttributeDecl.

getAttributeDeclsback to summary
public Map<String, XSAttributeDecl> getAttributeDecls()

Implements com.sun.xml.xsom.XSSchema.getAttributeDecls.

Doc from com.sun.xml.xsom.XSSchema.getAttributeDecls.

Gets all the XSAttributeDecls in this schema keyed by their local names.

getComplexTypeback to summary
public XSComplexType getComplexType(String name)

Implements com.sun.xml.xsom.XSSchema.getComplexType.

getComplexTypesback to summary
public Map<String, XSComplexType> getComplexTypes()

Implements com.sun.xml.xsom.XSSchema.getComplexTypes.

Doc from com.sun.xml.xsom.XSSchema.getComplexTypes.

Gets all the XSComplexTypes in this schema.

getElementDeclback to summary
public XSElementDecl getElementDecl(String name)

Implements com.sun.xml.xsom.XSSchema.getElementDecl.

getElementDeclsback to summary
public Map<String, XSElementDecl> getElementDecls()

Implements com.sun.xml.xsom.XSSchema.getElementDecls.

Doc from com.sun.xml.xsom.XSSchema.getElementDecls.

Gets all the XSElementDecls in this schema.

getForeignAttributeback to summary
public String getForeignAttribute(String nsUri, String localName)

Implements com.sun.xml.xsom.XSComponent.getForeignAttribute.

Doc from com.sun.xml.xsom.XSComponent.getForeignAttribute.

Gets the foreign attribute of the given name, or null if not found.

If multiple occurrences of the same attribute is found, this method returns the first one.

getForeignAttributesback to summary
public List<ForeignAttributes> getForeignAttributes()

Implements com.sun.xml.xsom.XSComponent.getForeignAttributes.

Doc from com.sun.xml.xsom.XSComponent.getForeignAttributes.

Gets the foreign attributes on this schema component.

In general, a schema component may match multiple elements in a schema document, and those elements can individually carry foreign attributes.

This method returns a list of ForeignAttributes, where each ForeignAttributes object represent foreign attributes on one element.

getIdentityConstraintback to summary
public XSIdentityConstraint getIdentityConstraint(String localName)

Implements com.sun.xml.xsom.XSSchema.getIdentityConstraint.

Doc from com.sun.xml.xsom.XSSchema.getIdentityConstraint.

Gets the identity constraint of the given name, or null if not found.

getIdentityConstraintsback to summary
public Map<String, XSIdentityConstraint> getIdentityConstraints()

Implements com.sun.xml.xsom.XSSchema.getIdentityConstraints.

Doc from com.sun.xml.xsom.XSSchema.getIdentityConstraints.

Gets all the XSIdentityConstraints in this schema, keyed by their names.

getLocatorback to summary
public Locator getLocator()

Implements com.sun.xml.xsom.XSComponent.getLocator.

Doc from com.sun.xml.xsom.XSComponent.getLocator.

Gets the locator that indicates the source location where this component is created from, or null if no information is available.

getModelGroupDeclback to summary
public XSModelGroupDecl getModelGroupDecl(String name)

Implements com.sun.xml.xsom.XSSchema.getModelGroupDecl.

getModelGroupDeclsback to summary
public Map<String, XSModelGroupDecl> getModelGroupDecls()

Implements com.sun.xml.xsom.XSSchema.getModelGroupDecls.

Doc from com.sun.xml.xsom.XSSchema.getModelGroupDecls.

Gets all the XSModelGroupDecls in this schema.

getNotationback to summary
public XSNotation getNotation(String name)

Implements com.sun.xml.xsom.XSSchema.getNotation.

getNotationsback to summary
public Map<String, XSNotation> getNotations()

Implements com.sun.xml.xsom.XSSchema.getNotations.

Doc from com.sun.xml.xsom.XSSchema.getNotations.

Gets all the XSNotations in this schema.

getOwnerSchemaback to summary
public XSSchema getOwnerSchema()

Implements com.sun.xml.xsom.XSComponent.getOwnerSchema.

Doc from com.sun.xml.xsom.XSComponent.getOwnerSchema.

Gets a reference to the XSSchema object to which this component belongs.

In case of XSEmpty component, this method returns null since there is no owner component.

getRootback to summary
public SchemaSetImpl getRoot()

Implements com.sun.xml.xsom.XSSchema.getRoot.

Doc from com.sun.xml.xsom.XSSchema.getRoot.

Gets the root schema set that includes this schema.

getSimpleTypeback to summary
public XSSimpleType getSimpleType(String name)

Implements com.sun.xml.xsom.XSSchema.getSimpleType.

getSimpleTypesback to summary
public Map<String, XSSimpleType> getSimpleTypes()

Implements com.sun.xml.xsom.XSSchema.getSimpleTypes.

Doc from com.sun.xml.xsom.XSSchema.getSimpleTypes.

Gets all the XSSimpleTypes in this schema.

getSourceDocumentback to summary
public SchemaDocument getSourceDocument()

Implements com.sun.xml.xsom.XSSchema.getSourceDocument.

Doc from com.sun.xml.xsom.XSSchema.getSourceDocument.

Sine an is not necessarily defined in one schema document (for example one schema can span across many documents through <xs:include>s.), so this method always returns null.

Annotations
@SuppressWarnings:deprecation
getTargetNamespaceback to summary
public String getTargetNamespace()

Implements com.sun.xml.xsom.XSSchema.getTargetNamespace.

Doc from com.sun.xml.xsom.XSSchema.getTargetNamespace.

Gets the target namespace of the schema.

getTypeback to summary
public XSType getType(String name)

Implements com.sun.xml.xsom.XSSchema.getType.

getTypesback to summary
public Map<String, XSType> getTypes()

Implements com.sun.xml.xsom.XSSchema.getTypes.

Doc from com.sun.xml.xsom.XSSchema.getTypes.

Gets all the XSTypes in this schema (union of getSimpleTypes() and getComplexTypes()

iterateAttGroupDeclsback to summary
public Iterator<XSAttGroupDecl> iterateAttGroupDecls()

Implements com.sun.xml.xsom.XSSchema.iterateAttGroupDecls.

iterateAttributeDeclsback to summary
public Iterator<XSAttributeDecl> iterateAttributeDecls()

Implements com.sun.xml.xsom.XSSchema.iterateAttributeDecls.

iterateComplexTypesback to summary
public Iterator<XSComplexType> iterateComplexTypes()

Implements com.sun.xml.xsom.XSSchema.iterateComplexTypes.

iterateElementDeclsback to summary
public Iterator<XSElementDecl> iterateElementDecls()

Implements com.sun.xml.xsom.XSSchema.iterateElementDecls.

iterateModelGroupDeclsback to summary
public Iterator<XSModelGroupDecl> iterateModelGroupDecls()

Implements com.sun.xml.xsom.XSSchema.iterateModelGroupDecls.

iterateNotationsback to summary
public Iterator<XSNotation> iterateNotations()

Implements com.sun.xml.xsom.XSSchema.iterateNotations.

iterateSimpleTypesback to summary
public Iterator<XSSimpleType> iterateSimpleTypes()

Implements com.sun.xml.xsom.XSSchema.iterateSimpleTypes.

iterateTypesback to summary
public Iterator<XSType> iterateTypes()

Implements com.sun.xml.xsom.XSSchema.iterateTypes.

selectback to summary
public Collection<XSComponent> select(String scd, NamespaceContext nsContext)

Implements com.sun.xml.xsom.XSComponent.select.

Doc from com.sun.xml.xsom.XSComponent.select.

Evaluates a schema component designator against this schema component and returns the resulting schema components.

selectSingleback to summary
public XSComponent selectSingle(String scd, NamespaceContext nsContext)

Implements com.sun.xml.xsom.XSComponent.selectSingle.

Doc from com.sun.xml.xsom.XSComponent.selectSingle.

Evaluates a schema component designator against this schema component and returns the first resulting schema component.

setAnnotationback to summary
public void setAnnotation(XSAnnotation a)
visitback to summary
public void visit(XSVisitor visitor)

Implements com.sun.xml.xsom.XSComponent.visit.

Doc from com.sun.xml.xsom.XSComponent.visit.

Accepts a visitor.