|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.xml.Schemas
public class Schemas
Utility class for performing various opreations.
Constructor Summary | |
---|---|
Schemas()
|
Method Summary | |
---|---|
static java.util.List |
findSchemaLocationResolvers(Configuration configuration)
Finds all XSDSchemaLocationResolver 's used by the configuration. |
static SchemaIndex |
findSchemas(Configuration configuration)
Finds all the XSDSchemas used by the configuration
by looking at the configuration's schema locator and its dependencies. |
static java.util.List |
getAnyElementParticles(org.eclipse.xsd.XSDTypeDefinition type)
Returns a list of all xs:any element particles that correspond to element declarations of the specified type. |
static org.eclipse.xsd.XSDAttributeDeclaration |
getAttributeDeclaration(org.eclipse.xsd.XSDElementDeclaration element,
javax.xml.namespace.QName qName)
Returns an attribute declaration that is contained in the type of another element declaration. |
static java.util.List |
getAttributeDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
Returns a list of all attribute declarations declared in the type (or any base type) of the specified element. |
static java.util.List |
getAttributeDeclarations(org.eclipse.xsd.XSDTypeDefinition type)
Returns a list of all attribute declarations declared in the type (or any base type) of the specified element. |
static java.util.List |
getAttributeDeclarations(org.eclipse.xsd.XSDTypeDefinition type,
boolean includeParents)
Returns a list of all attribute declarations declared in the type (and optionally any base type) of the specified element. |
static org.eclipse.xsd.XSDTypeDefinition |
getBaseTypeDefinition(org.eclipse.xsd.XSDTypeDefinition type,
javax.xml.namespace.QName parentTypeName)
Returns the base type defintion of type named parentTypeName |
static org.eclipse.xsd.XSDElementDeclaration |
getChildElementDeclaration(org.eclipse.xsd.XSDElementDeclaration parent,
javax.xml.namespace.QName qName)
Returns an element declaration that is contained in the type of another element declaration. |
static java.util.List |
getChildElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
Deprecated. use getChildElementDeclarations(XSDTypeDefinition) |
static java.util.List |
getChildElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element,
boolean includeParents)
Deprecated. use getChildElementDeclarations(XSDTypeDefinition, boolean) |
static java.util.List |
getChildElementDeclarations(org.eclipse.xsd.XSDTypeDefinition type)
Returns a list of all child element declarations of the specified type, no order is guaranteed. |
static java.util.List |
getChildElementDeclarations(org.eclipse.xsd.XSDTypeDefinition type,
boolean includeParents)
Returns a list of all child element declarations of the specified type, no order is guaranteed. |
static org.eclipse.xsd.XSDParticle |
getChildElementParticle(org.eclipse.xsd.XSDTypeDefinition type,
java.lang.String name,
boolean includeParents)
Returns the particle for an element declaration that is part of a type. |
static java.util.List |
getChildElementParticles(org.eclipse.xsd.XSDTypeDefinition type,
boolean includeParents)
Returns a list of all child element particles that corresponde to element declarations of the specified type, no order is guaranteed. |
static java.util.List |
getComponentInstancesOfType(org.picocontainer.PicoContainer container,
java.lang.Class clazz)
Obtains all instances of a particular class from a container by navigating up the container hierachy. |
static java.util.List |
getDerivedElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
Returns a list of all top level elements that are of a type derived from the type of the specified element. |
static org.eclipse.xsd.XSDElementDeclaration |
getElementDeclaration(org.eclipse.xsd.XSDSchema schema,
javax.xml.namespace.QName name)
Searches schema for an element which matches name . |
static java.util.List |
getImports(org.eclipse.xsd.XSDSchema schema)
Returns a flat list of imports from the specified schema. |
static java.util.List |
getIncludes(org.eclipse.xsd.XSDSchema schema)
Returns a flat list of includes from the specified schema. |
static int |
getMaxOccurs(org.eclipse.xsd.XSDComplexTypeDefinition type,
org.eclipse.xsd.XSDElementDeclaration element)
Returns the minimum number of occurences of an element within a complex type. |
static int |
getMinOccurs(org.eclipse.xsd.XSDComplexTypeDefinition type,
org.eclipse.xsd.XSDElementDeclaration element)
Returns the minimum number of occurences of an element within a complex type. |
static javax.xml.namespace.QName |
getParticleName(org.eclipse.xsd.XSDParticle particle)
Returns the name of the element represented by the particle as a QName. |
static java.lang.String |
getTargetPrefix(org.eclipse.xsd.XSDSchema schema)
Returns the namespace prefix mapped to the targetNamespace of the schema. |
static void |
importSchema(org.eclipse.xsd.XSDSchema schema,
org.eclipse.xsd.XSDSchema importee)
Imports one schema into another. |
static boolean |
isBaseType(org.eclipse.xsd.XSDElementDeclaration e1,
org.eclipse.xsd.XSDElementDeclaration e2)
Determines if the type of an element is a sub-type of another element. |
static boolean |
nameMatches(org.eclipse.xsd.XSDNamedComponent component,
javax.xml.namespace.QName qName)
Method for comparing the name of a schema component to a qualified name. |
static org.eclipse.xsd.XSDSchema |
parse(java.lang.String location)
Parses a schema at the specified location. |
static org.eclipse.xsd.XSDSchema |
parse(java.lang.String location,
java.util.List locators,
java.util.List resolvers)
|
static org.eclipse.xsd.XSDSchema |
parse(java.lang.String location,
org.eclipse.xsd.util.XSDSchemaLocator[] locators,
org.eclipse.xsd.util.XSDSchemaLocationResolver[] resolvers)
Parses a schema at the specified location. |
static void |
unregisterComponent(org.picocontainer.PicoContainer container,
java.lang.Object key)
Unregisters a component in the container and all parent containers. |
static java.util.List |
validateImportsIncludes(java.lang.String location)
|
static java.util.List |
validateImportsIncludes(java.lang.String location,
java.util.List locators,
java.util.List resolvers)
|
static java.util.List |
validateImportsIncludes(java.lang.String location,
org.eclipse.xsd.util.XSDSchemaLocator[] locators,
org.eclipse.xsd.util.XSDSchemaLocationResolver[] resolvers)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Schemas()
Method Detail |
---|
public static final SchemaIndex findSchemas(Configuration configuration)
configuration
by looking at the configuration's schema locator and its dependencies.
configuration
- the Configuration
for which to find all its
related schemas
SchemaIndex
holding the schemas related to
configuration
public static java.util.List findSchemaLocationResolvers(Configuration configuration)
XSDSchemaLocationResolver
's used by the configuration.
configuration
- The parser configuration.
public static final org.eclipse.xsd.XSDSchema parse(java.lang.String location) throws java.io.IOException
location
- A uri pointing to the location of the schema.
java.io.IOException
- In the event of a schema parsing error.public static final org.eclipse.xsd.XSDSchema parse(java.lang.String location, org.eclipse.xsd.util.XSDSchemaLocator[] locators, org.eclipse.xsd.util.XSDSchemaLocationResolver[] resolvers) throws java.io.IOException
location
- A uri pointing to the location of the schema.locators
- An array of schema locator objects to be used when
parsing imports/includes of the main schema.resolvers
- An array of schema location resolvers used to override
schema locations encountered in an instance document or an imported
schema.
java.io.IOException
- In the event of a schema parsing error.public static final org.eclipse.xsd.XSDSchema parse(java.lang.String location, java.util.List locators, java.util.List resolvers) throws java.io.IOException
java.io.IOException
public static final void importSchema(org.eclipse.xsd.XSDSchema schema, org.eclipse.xsd.XSDSchema importee) throws java.io.IOException
schema
- The schema being imported into.importee
- The schema being imported.
java.io.IOException
public static final java.util.List validateImportsIncludes(java.lang.String location) throws java.io.IOException
java.io.IOException
public static final java.util.List validateImportsIncludes(java.lang.String location, org.eclipse.xsd.util.XSDSchemaLocator[] locators, org.eclipse.xsd.util.XSDSchemaLocationResolver[] resolvers) throws java.io.IOException
java.io.IOException
public static final java.util.List validateImportsIncludes(java.lang.String location, java.util.List locators, java.util.List resolvers) throws java.io.IOException
java.io.IOException
public static final java.util.List getChildElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
getChildElementDeclarations(XSDTypeDefinition)
element
- The parent element.
public static final java.util.List getChildElementDeclarations(org.eclipse.xsd.XSDTypeDefinition type)
type
- The type.
public static final java.util.List getChildElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element, boolean includeParents)
getChildElementDeclarations(XSDTypeDefinition, boolean)
The includeParents
flag controls if this method should
returns those elements defined on parent types.
element
- The parent element.includeParents
- Flag indicating if parent types should be processed.
public static final org.eclipse.xsd.XSDParticle getChildElementParticle(org.eclipse.xsd.XSDTypeDefinition type, java.lang.String name, boolean includeParents)
type
- The type definition.name
- The naem of the child element declaration.includeParents
- Flag to control wether parent types are included.
null
if it could
not be found.public static final java.util.List getChildElementParticles(org.eclipse.xsd.XSDTypeDefinition type, boolean includeParents)
The includeParents
flag controls if this method should returns those elements
defined on parent types.
type
- THe type.includeParents
- flag indicating if parent types should be processed
XSDParticle
.public static final java.util.List getAnyElementParticles(org.eclipse.xsd.XSDTypeDefinition type)
type
- The type.
XSDParticle
.public static final java.util.List getChildElementDeclarations(org.eclipse.xsd.XSDTypeDefinition type, boolean includeParents)
The includeParents
flag controls if this method should
returns those elements defined on parent types.
type
- The typeincludeParents
- flag indicating if parent types should be processed
public static final org.eclipse.xsd.XSDTypeDefinition getBaseTypeDefinition(org.eclipse.xsd.XSDTypeDefinition type, javax.xml.namespace.QName parentTypeName)
type
named parentTypeName.
This method will handle the case in which the parentTypeName == type.getTypeName()
.
If no such parent type is found this method will return null
.
- Parameters:
type
- The type.parentTypeName
- The name of the base type to return.
- Returns:
- The base type, or null if it could not be found.
public static final boolean isBaseType(org.eclipse.xsd.XSDElementDeclaration e1, org.eclipse.xsd.XSDElementDeclaration e2)
e1
- The element.e2
- The element to be tested as a base type.public static final int getMinOccurs(org.eclipse.xsd.XSDComplexTypeDefinition type, org.eclipse.xsd.XSDElementDeclaration element)
type
- The type definition containg the declaration element
element
- The declaration of the element.
java.lang.IllegalArgumentException
- If the element declaration cannot be
locaated withing the type definition.public static final int getMaxOccurs(org.eclipse.xsd.XSDComplexTypeDefinition type, org.eclipse.xsd.XSDElementDeclaration element)
type
- The type definition containg the declaration element
element
- The declaration of the element.
java.lang.IllegalArgumentException
- If the element declaration cannot be
locaated withing the type definition.public static final org.eclipse.xsd.XSDElementDeclaration getChildElementDeclaration(org.eclipse.xsd.XSDElementDeclaration parent, javax.xml.namespace.QName qName)
parent
- the containing element declarationqName
- the qualified name of the contained element
public static final java.util.List getDerivedElementDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
element
- The element.
public static final java.util.List getAttributeDeclarations(org.eclipse.xsd.XSDElementDeclaration element)
This method is just a shortcut for getAttributeDeclarations(element.getType()
element
- The element.
public static final java.util.List getAttributeDeclarations(org.eclipse.xsd.XSDTypeDefinition type)
element
- The element.
public static final java.util.List getAttributeDeclarations(org.eclipse.xsd.XSDTypeDefinition type, boolean includeParents)
element
- The element.includeParents
- Wether to include parent types.
public static final org.eclipse.xsd.XSDAttributeDeclaration getAttributeDeclaration(org.eclipse.xsd.XSDElementDeclaration element, javax.xml.namespace.QName qName)
element
- The containing element declaration.qName
- The qualified name of the contained attribute
public static final java.util.List getImports(org.eclipse.xsd.XSDSchema schema)
The method recurses into imported schemas. The list returned is filtered so that duplicate includes are removed. Two includes are considered equal if they have the same target namespace.
schema
- The top-level schema.
XSDImport
.public static final java.util.List getIncludes(org.eclipse.xsd.XSDSchema schema)
The method recurses into included schemas. The list returned is filtered so that duplicate includes are removed. Two includes are considered equal if they have the same uri location
schema
- The top-level schema.
XSDInclude
.public static org.eclipse.xsd.XSDElementDeclaration getElementDeclaration(org.eclipse.xsd.XSDSchema schema, javax.xml.namespace.QName name)
schema
for an element which matches name
.
schema
- The schemaname
- The element to search for
public static final boolean nameMatches(org.eclipse.xsd.XSDNamedComponent component, javax.xml.namespace.QName qName)
component
- The component in question.qName
- The qualifined name.public static java.lang.String getTargetPrefix(org.eclipse.xsd.XSDSchema schema)
schema
- The schema in question.
null
if not found.public static java.util.List getComponentInstancesOfType(org.picocontainer.PicoContainer container, java.lang.Class clazz)
container
- The container.clazz
- The class.
clazz
, or the empty list if none found.public static void unregisterComponent(org.picocontainer.PicoContainer container, java.lang.Object key)
container
- The container.key
- The key of the component.public static javax.xml.namespace.QName getParticleName(org.eclipse.xsd.XSDParticle particle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |