public class SchemaUtils extends Object
Modifier and Type | Method and Description |
---|---|
static QName |
createQNameFromXSSimpleType(org.apache.xerces.xs.XSSimpleTypeDefinition xs)
Create a QName given a Simple Type
|
org.apache.xerces.xs.XSElementDeclaration |
createXSElementDeclaration(QName xmlName,
org.apache.xerces.xs.XSTypeDefinition xst)
Given a XSTypeDefinition and the QName for the element,
create a XSElementDeclaration object
|
String |
getFormattedString(org.apache.xerces.xs.XSTypeDefinition xstype)
Get formatted string for the qname representing the xstype
|
static SchemaUtils |
getInstance() |
QName |
getQName(org.apache.xerces.xs.XSTypeDefinition xstype)
Get a QName for a xs type
|
JBossXSTypeDefinition |
getSchemaBasicType(String localpart)
Get a schema basic type
TODO: Migrate this off of the Xerces Impl
|
static String |
getSchemaDefinitions(String targetNS)
Get the schema definitions as a String
|
static File |
getSchemaTempFile(String targetNS)
Get the temp file for a given namespace
|
static String |
getTargetNamespace(org.apache.xerces.xs.XSModel xsmodel)
Get the TargetNamespace from the schema model
|
QName |
getToolsOverrideInTypeMapping(Class javaType)
Return typemapping override for tools if any
|
org.apache.xerces.xs.XSLoader |
getXSLoader()
Get an instance of XSLoader that is capable of
parsing schema files
|
org.apache.xerces.xs.XSLoader |
getXSLoader(org.apache.xerces.xni.parser.XMLErrorHandler xeh,
org.apache.xerces.xni.parser.XMLEntityResolver xer)
Get an instance of XSLoader that is capable of
parsing schema files
|
static QName |
handleSimpleType(org.apache.xerces.xs.XSSimpleTypeDefinition simple)
Generate a QName for a simple type
|
boolean |
hasComplexTypeDefinition(QName xmlType,
URL xsdLocation)
Check if a Complex Type exists
|
boolean |
hasComplexTypeDefinition(QName xmlType,
org.apache.xerces.xs.XSModel xsmodel)
Check if a Complex Type exists
|
boolean |
hasGlobalElement(QName xmlName,
URL xsdLocation)
Check if a Global Element exists
|
boolean |
hasGlobalElement(QName xmlName,
org.apache.xerces.xs.XSModel xsmodel)
Check if a global element exists
|
boolean |
isArrayType(org.apache.xerces.xs.XSParticle xsparticle)
Checks if the XS Particle is of array type
|
boolean |
isEmptySchema(org.apache.xerces.xs.XSModel xsmodel)
Checks if the XSModel is empty
|
boolean |
isEmptySchema(org.apache.xerces.xs.XSModel xsmodel,
String namespace)
Checks if the XSModel is empty given a namespace
|
static boolean |
isWrapperArrayType(org.apache.xerces.xs.XSTypeDefinition xst) |
org.apache.xerces.xs.XSModel |
parseSchema(List<String> locations)
Given a list of schema locations, parse and
provide a Xerces XSModel
|
org.apache.xerces.xs.XSModel |
parseSchema(String schemaLoc)
Given a schema file, generate a schema model
|
org.apache.xerces.xs.XSModel |
parseSchema(URL schemaLoc)
Given a schema file, generate a schema model
|
QName |
patchXSDQName(QName qname)
For the basic xsd types, patch prefix and ns uri
|
static org.apache.xerces.xs.XSElementDeclaration |
unwrapArrayType(org.apache.xerces.xs.XSTypeDefinition xst) |
protected static final String xsNS
public static SchemaUtils getInstance()
public boolean isArrayType(org.apache.xerces.xs.XSParticle xsparticle)
xsparticle
- public static boolean isWrapperArrayType(org.apache.xerces.xs.XSTypeDefinition xst)
public static org.apache.xerces.xs.XSElementDeclaration unwrapArrayType(org.apache.xerces.xs.XSTypeDefinition xst)
public static QName handleSimpleType(org.apache.xerces.xs.XSSimpleTypeDefinition simple)
simple
- public QName patchXSDQName(QName qname)
qname
- public org.apache.xerces.xs.XSElementDeclaration createXSElementDeclaration(QName xmlName, org.apache.xerces.xs.XSTypeDefinition xst)
xmlName
- Name of the elementxst
- Type of the elementpublic static QName createQNameFromXSSimpleType(org.apache.xerces.xs.XSSimpleTypeDefinition xs)
xs
- public QName getToolsOverrideInTypeMapping(Class javaType)
javaType
- public boolean hasGlobalElement(QName xmlName, org.apache.xerces.xs.XSModel xsmodel)
xmlName
- QName of the element that needs to be checkedxsmodel
- Schema model that is passedpublic boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
xmlType
- QName of the Complex Type that needs to be checkedxsmodel
- Schema model that is passedpublic boolean hasGlobalElement(QName xmlName, URL xsdLocation)
xmlType
- QName of the global element that needs to be checkedxsmodel
- Schema model that is passedpublic boolean hasComplexTypeDefinition(QName xmlType, org.apache.xerces.xs.XSModel xsmodel)
xmlType
- QName of the Complex Type that needs to be checkedxsmodel
- Schema model that is passedpublic String getFormattedString(org.apache.xerces.xs.XSTypeDefinition xstype)
xstype
- public QName getQName(org.apache.xerces.xs.XSTypeDefinition xstype)
xstype
- public JBossXSTypeDefinition getSchemaBasicType(String localpart)
localpart
- public org.apache.xerces.xs.XSLoader getXSLoader()
public org.apache.xerces.xs.XSLoader getXSLoader(org.apache.xerces.xni.parser.XMLErrorHandler xeh, org.apache.xerces.xni.parser.XMLEntityResolver xer)
xeh
- XML Error handlerxer
- XML Entity Resolverpublic org.apache.xerces.xs.XSModel parseSchema(URL schemaLoc)
schemaLoc
- java.net.URL object to the schema filepublic org.apache.xerces.xs.XSModel parseSchema(String schemaLoc)
schemaLoc
- string representation to the location of schemapublic org.apache.xerces.xs.XSModel parseSchema(List<String> locations)
locations
- public boolean isEmptySchema(org.apache.xerces.xs.XSModel xsmodel)
xsmodel
- public boolean isEmptySchema(org.apache.xerces.xs.XSModel xsmodel, String namespace)
xsmodel
- Schema Model to checknamespace
- namespace to check components forpublic static String getSchemaDefinitions(String targetNS)
targetNS
- The Target Namespacepublic static File getSchemaTempFile(String targetNS) throws IOException
IOException
public static String getTargetNamespace(org.apache.xerces.xs.XSModel xsmodel)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.