Package org.geotools.xsd.impl
Class SchemaIndexImpl
- Object
-
- SchemaIndexImpl
-
- All Implemented Interfaces:
SchemaIndex
public class SchemaIndexImpl extends Object implements SchemaIndex
-
-
Constructor Summary
Constructors Constructor Description SchemaIndexImpl(XSDSchema[] schemas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildAttributeGroupIndex()
protected void
buildAttriubuteIndex()
protected void
buildComplexTypeIndex()
protected void
buildElementIndex()
protected void
buildSimpleTypeIndex()
protected OrderedMap<QName,XSDParticle>
children(XSDElementDeclaration parent)
void
destroy()
Cleans up the index before desctruction.protected <T> Collection<T>
find(Class<?> c)
XSDAttributeDeclaration
getAttributeDeclaration(QName qName)
Returns the attribute declaration with the specified qualified name.XSDAttributeGroupDefinition
getAttributeGroupDefinition(QName qName)
Returns the attribute group definition with the specified qualified name.protected HashMap
getAttributeGroupIndex()
protected HashMap
getAttributeIndex()
List
getAttributes(XSDElementDeclaration element)
Returns the attributes of a specified elements.XSDElementDeclaration
getChildElement(XSDElementDeclaration parent, QName childName)
Returns a child element specified by name of a parent element.List<XSDParticle>
getChildElementParticles(XSDElementDeclaration parent)
Returns a list of the particles which correspond to child element declarations.XSDComplexTypeDefinition
getComplexTypeDefinition(QName qName)
Returns the complex type definition with the specified qualified name.protected HashMap
getComplexTypeIndex()
XSDElementDeclaration
getElementDeclaration(QName qName)
Returns the element declaration with the specified qualified name.protected HashMap
getElementIndex()
XSDImport[]
getImports()
XSDInclude[]
getIncludes()
XSDSchema[]
getSchemas()
XSDSimpleTypeDefinition
getSimpleTypeDefinition(QName qName)
Returns the simple type definition with the specified qualified name.protected HashMap
getSimpleTypeIndex()
XSDTypeDefinition
getTypeDefinition(QName qName)
Returns the type definition with the specified qualified name.protected XSDNamedComponent
lookup(Map index, QName qName)
-
-
-
Method Detail
-
destroy
public void destroy()
Description copied from interface:SchemaIndex
Cleans up the index before desctruction.- Specified by:
destroy
in interfaceSchemaIndex
-
getSchemas
public XSDSchema[] getSchemas()
- Specified by:
getSchemas
in interfaceSchemaIndex
- Returns:
- The schema itself.
-
getImports
public XSDImport[] getImports()
-
getIncludes
public XSDInclude[] getIncludes()
-
getElementDeclaration
public XSDElementDeclaration getElementDeclaration(QName qName)
Description copied from interface:SchemaIndex
Returns the element declaration with the specified qualified name.- Specified by:
getElementDeclaration
in interfaceSchemaIndex
- Parameters:
qName
- the qualified name of the element.- Returns:
- The element declaration, or null if no such element declaration exists.
-
getAttributeDeclaration
public XSDAttributeDeclaration getAttributeDeclaration(QName qName)
Description copied from interface:SchemaIndex
Returns the attribute declaration with the specified qualified name.- Specified by:
getAttributeDeclaration
in interfaceSchemaIndex
- Parameters:
qName
- the qualified name of the attribute.- Returns:
- The attribute declaration, or null if no such attribute declaration exists.
-
getAttributeGroupDefinition
public XSDAttributeGroupDefinition getAttributeGroupDefinition(QName qName)
Description copied from interface:SchemaIndex
Returns the attribute group definition with the specified qualified name.- Specified by:
getAttributeGroupDefinition
in interfaceSchemaIndex
- Parameters:
qName
- the qualified name of the attribute group.- Returns:
- The attribute group definition, or null if no such attribute group definition exists.
-
getComplexTypeDefinition
public XSDComplexTypeDefinition getComplexTypeDefinition(QName qName)
Description copied from interface:SchemaIndex
Returns the complex type definition with the specified qualified name.- Specified by:
getComplexTypeDefinition
in interfaceSchemaIndex
- Parameters:
qName
- qualified name of the complex type.- Returns:
- The complex type definition, or null if no such complex type definition exists.
-
getSimpleTypeDefinition
public XSDSimpleTypeDefinition getSimpleTypeDefinition(QName qName)
Description copied from interface:SchemaIndex
Returns the simple type definition with the specified qualified name.- Specified by:
getSimpleTypeDefinition
in interfaceSchemaIndex
- Parameters:
qName
- qualified name of the simple type.- Returns:
- The simple type definition, or null if no such simple type definition exists.
-
getTypeDefinition
public XSDTypeDefinition getTypeDefinition(QName qName)
Description copied from interface:SchemaIndex
Returns the type definition with the specified qualified name.- Specified by:
getTypeDefinition
in interfaceSchemaIndex
- Parameters:
qName
- qualified name of the type.- Returns:
- The type definition, or null if no such type definition exists.
-
children
protected OrderedMap<QName,XSDParticle> children(XSDElementDeclaration parent)
-
getChildElement
public XSDElementDeclaration getChildElement(XSDElementDeclaration parent, QName childName)
Description copied from interface:SchemaIndex
Returns a child element specified by name of a parent element.- Specified by:
getChildElement
in interfaceSchemaIndex
- Parameters:
parent
- The parent element.childName
- The name of the child.- Returns:
- The element declaration, or null if no such child exists.
-
getChildElementParticles
public List<XSDParticle> getChildElementParticles(XSDElementDeclaration parent)
Description copied from interface:SchemaIndex
Returns a list of the particles which correspond to child element declarations.- Specified by:
getChildElementParticles
in interfaceSchemaIndex
- Parameters:
parent
- The parent element.- Returns:
- A list of
XSDParticle
.
-
getAttributes
public List getAttributes(XSDElementDeclaration element)
Description copied from interface:SchemaIndex
Returns the attributes of a specified elements.- Specified by:
getAttributes
in interfaceSchemaIndex
- Parameters:
element
- The element.- Returns:
- The list of attributed definied for the element.
-
find
protected <T> Collection<T> find(Class<?> c)
-
getElementIndex
protected HashMap getElementIndex()
-
getAttributeIndex
protected HashMap getAttributeIndex()
-
getAttributeGroupIndex
protected HashMap getAttributeGroupIndex()
-
getComplexTypeIndex
protected HashMap getComplexTypeIndex()
-
getSimpleTypeIndex
protected HashMap getSimpleTypeIndex()
-
buildElementIndex
protected void buildElementIndex()
-
buildAttriubuteIndex
protected void buildAttriubuteIndex()
-
buildAttributeGroupIndex
protected void buildAttributeGroupIndex()
-
buildComplexTypeIndex
protected void buildComplexTypeIndex()
-
buildSimpleTypeIndex
protected void buildSimpleTypeIndex()
-
-