public class SchemaUtils extends Object
Modifier and Type | Method and Description |
---|---|
static QName |
createQNameFromXSSimpleType(XSSimpleTypeDefinition xs)
Create a QName given a Simple Type
|
XSElementDeclaration |
createXSElementDeclaration(QName xmlName,
XSTypeDefinition xst)
Given a XSTypeDefinition and the QName for the element,
create a XSElementDeclaration object
|
String |
getFormattedString(XSTypeDefinition xstype)
Get formatted string for the qname representing the xstype
|
static SchemaUtils |
getInstance() |
QName |
getQName(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(XSModel xsmodel)
Get the TargetNamespace from the schema model
|
QName |
getToolsOverrideInTypeMapping(Class javaType)
Return typemapping override for tools if any
|
XSLoader |
getXSLoader()
Get an instance of XSLoader that is capable of
parsing schema files
|
XSLoader |
getXSLoader(XMLErrorHandler xeh,
XMLEntityResolver xer)
Get an instance of XSLoader that is capable of
parsing schema files
|
static QName |
handleSimpleType(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,
XSModel xsmodel)
Check if a Complex Type exists
|
boolean |
hasGlobalElement(QName xmlName,
URL xsdLocation)
Check if a Global Element exists
|
boolean |
hasGlobalElement(QName xmlName,
XSModel xsmodel)
Check if a global element exists
|
boolean |
isArrayType(XSParticle xsparticle)
Checks if the XS Particle is of array type
|
boolean |
isEmptySchema(XSModel xsmodel)
Checks if the XSModel is empty
|
boolean |
isEmptySchema(XSModel xsmodel,
String namespace)
Checks if the XSModel is empty given a namespace
|
static boolean |
isWrapperArrayType(XSTypeDefinition xst) |
XSModel |
parseSchema(List<String> locations)
Given a list of schema locations, parse and
provide a Xerces XSModel
|
XSModel |
parseSchema(String schemaLoc)
Given a schema file, generate a schema model
|
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 XSElementDeclaration |
unwrapArrayType(XSTypeDefinition xst) |
protected static final String xsNS
public static SchemaUtils getInstance()
public boolean isArrayType(XSParticle xsparticle)
xsparticle
- public static boolean isWrapperArrayType(XSTypeDefinition xst)
public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
public static QName handleSimpleType(XSSimpleTypeDefinition simple)
simple
- public QName patchXSDQName(QName qname)
qname
- public XSElementDeclaration createXSElementDeclaration(QName xmlName, XSTypeDefinition xst)
xmlName
- Name of the elementxst
- Type of the elementpublic static QName createQNameFromXSSimpleType(XSSimpleTypeDefinition xs)
xs
- public QName getToolsOverrideInTypeMapping(Class javaType)
javaType
- public boolean hasGlobalElement(QName xmlName, 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, XSModel xsmodel)
xmlType
- QName of the Complex Type that needs to be checkedxsmodel
- Schema model that is passedpublic String getFormattedString(XSTypeDefinition xstype)
xstype
- public QName getQName(XSTypeDefinition xstype)
xstype
- public JBossXSTypeDefinition getSchemaBasicType(String localpart)
localpart
- public XSLoader getXSLoader()
public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
xeh
- XML Error handlerxer
- XML Entity Resolverpublic XSModel parseSchema(URL schemaLoc)
schemaLoc
- java.net.URL object to the schema filepublic XSModel parseSchema(String schemaLoc)
schemaLoc
- string representation to the location of schemapublic XSModel parseSchema(List<String> locations)
locations
- public boolean isEmptySchema(XSModel xsmodel)
xsmodel
- public boolean isEmptySchema(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
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.