|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.xml.schema.XMLSchemaInfoSet
public class XMLSchemaInfoSet
Provides convenient methods to retrieve "relevant" element and type declarations of an XML schema infoset.
This functionality is very handy for extracting higher-level structures defined using XML schema, such as GML feature types.
GMLSchemaInfoSet
Field Summary | |
---|---|
protected org.apache.xerces.xs.XSModel |
xsModel
The Xerces schema model. |
Constructor Summary | |
---|---|
XMLSchemaInfoSet(LSInput... inputs)
Creates a new XMLSchemaInfoSet instance that reads the schema documents from the given inputs. |
|
XMLSchemaInfoSet(String... schemaUrls)
Creates a new XMLSchemaInfoSet instance that reads the schema documents from the given URLs. |
|
XMLSchemaInfoSet(org.apache.xerces.xs.XSModel xmlSchema)
Creates a new XSModelAnalyzer for the given (Xerces) XML schema infoset. |
Method Summary | |
---|---|
List<String> |
getComponentLocations(String namespace)
Returns the locations of all schema files that contributed to the given namespace. |
org.apache.xerces.xs.XSElementDeclaration |
getElementDecl(QName name)
Returns the global element declaration with the given name. |
org.apache.xerces.xs.XSElementDeclaration |
getElementDecl(String localName,
String namespace)
|
Map<String,String> |
getNamespacePrefixes()
Returns the prefix to namespace bindings used in the original XML schema documents. |
org.apache.xerces.xs.XSNamespaceItemList |
getNamespaces()
|
Set<String> |
getSchemaNamespaces()
Returns all namespaces that participate in this infoset. |
List<org.apache.xerces.xs.XSElementDeclaration> |
getSubstitutions(QName elementName,
String namespace,
boolean transitive,
boolean onlyConcrete)
Returns the declarations of all elements that are substitutable for a given element name. |
List<org.apache.xerces.xs.XSElementDeclaration> |
getSubstitutions(org.apache.xerces.xs.XSElementDeclaration elementDecl,
String namespace,
boolean transitive,
boolean onlyConcrete)
Returns the declarations of all elements that are substitutable for a given element declaration. |
List<org.apache.xerces.xs.XSTypeDefinition> |
getSubtypes(org.apache.xerces.xs.XSTypeDefinition typeDef,
String namespace,
boolean transitive,
boolean onlyConcrete)
Returns the subtypes for the given type definition. |
org.apache.xerces.xs.XSTypeDefinition |
getTypeDef(QName name)
|
org.apache.xerces.xs.XSTypeDefinition |
getTypeDef(String localName,
String namespace)
|
org.apache.xerces.xs.XSModel |
getXSModel()
Returns the XML schema infoset (represented as a Xerces XSModel ). |
static org.apache.xerces.xs.XSModel |
loadModel(LSInput... inputs)
Creates a Xerces XSModel from the given input schemas, using the RedirectingEntityResolver , so
OGC schemas URLs are redirected to a local copy. |
static org.apache.xerces.xs.XSModel |
loadModel(String... schemaUrls)
Creates a Xerces XSModel from the schemas at the given URLs, using the RedirectingEntityResolver ,
so OGC schemas URLs are redirected to a local copy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.xerces.xs.XSModel xsModel
Constructor Detail |
---|
public XMLSchemaInfoSet(org.apache.xerces.xs.XSModel xmlSchema)
XSModelAnalyzer
for the given (Xerces) XML schema infoset.
xmlSchema
- schema infoset, must not be null
public XMLSchemaInfoSet(String... schemaUrls) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException
XMLSchemaInfoSet
instance that reads the schema documents from the given URLs.
schemaUrls
- locations of the schema documents, must not be null
and contain at least one entry
ClassCastException
ClassNotFoundException
InstantiationException
IllegalAccessException
public XMLSchemaInfoSet(LSInput... inputs) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException
XMLSchemaInfoSet
instance that reads the schema documents from the given inputs.
inputs
- schema documents, must not be null
and contain at least one entry
ClassCastException
ClassNotFoundException
InstantiationException
IllegalAccessException
Method Detail |
---|
public org.apache.xerces.xs.XSElementDeclaration getElementDecl(QName name)
NOTE: Use this method instead of XSModel#getElementDeclaration(...) -- sometimes this convenience method returns null for element declarations that definitely exist (observed for XPlanGML 4.0 schemas with ADE).
name
- qualified name, must not be null
null
if it does not existpublic org.apache.xerces.xs.XSElementDeclaration getElementDecl(String localName, String namespace)
public org.apache.xerces.xs.XSTypeDefinition getTypeDef(QName name)
public org.apache.xerces.xs.XSTypeDefinition getTypeDef(String localName, String namespace)
public Set<String> getSchemaNamespaces()
null
public Map<String,String> getNamespacePrefixes()
null
(but does not necessarily contain bindings for
all namespaces)public List<String> getComponentLocations(String namespace)
namespace
- namespace, must not be null
null
if the namespace does not belong to the schemapublic org.apache.xerces.xs.XSNamespaceItemList getNamespaces()
public org.apache.xerces.xs.XSModel getXSModel()
XSModel
).
null
public List<org.apache.xerces.xs.XSElementDeclaration> getSubstitutions(org.apache.xerces.xs.XSElementDeclaration elementDecl, String namespace, boolean transitive, boolean onlyConcrete)
elementDecl
- element declaration, must not be null
namespace
- only element declarations in this namespace are returned, set to null
for all namespacestransitive
- if true, also substitutions for substitutions (and so on) are includedonlyConcrete
- if true, only concrete (non-abstract) declarations are returned
public List<org.apache.xerces.xs.XSTypeDefinition> getSubtypes(org.apache.xerces.xs.XSTypeDefinition typeDef, String namespace, boolean transitive, boolean onlyConcrete)
typeDef
- type definition, must not be null
namespace
- only type definitions in this namespace are returned, set to null
for all namespacestransitive
- if true, also subtypes of subtypes (and so on) are includedonlyConcrete
- if true, only concrete (non-abstract) definitions are returned
public List<org.apache.xerces.xs.XSElementDeclaration> getSubstitutions(QName elementName, String namespace, boolean transitive, boolean onlyConcrete)
elementName
- qualified name of the element, must not be null
namespace
- only element declarations in this namespace are returned, set to null
for all namespacestransitive
- if true, also substitutions for substitutions (and so one) are includedonlyConcrete
- if true, only concrete (non-abstract) declarations are returned
public static org.apache.xerces.xs.XSModel loadModel(String... schemaUrls) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException
XSModel
from the schemas at the given URLs, using the RedirectingEntityResolver
,
so OGC schemas URLs are redirected to a local copy.
schemaUrls
- locations of the schema documents, must not be null
and contain at least one entry
null
ClassCastException
ClassNotFoundException
InstantiationException
IllegalAccessException
public static org.apache.xerces.xs.XSModel loadModel(LSInput... inputs) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException
XSModel
from the given input schemas, using the RedirectingEntityResolver
, so
OGC schemas URLs are redirected to a local copy.
inputs
- schema document inputs, must not be null
and contain at least one entry
null
ClassCastException
ClassNotFoundException
InstantiationException
IllegalAccessException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |