|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.common.xmlschema.XmlSchemaUtils
public final class XmlSchemaUtils
Some functions that avoid problems with Commons XML Schema.
Field Summary | |
---|---|
static String |
XSI_NIL
|
static String |
XSI_NIL_WITH_PREFIX
|
static String |
XSI_NS_ATTR
|
Method Summary | |
---|---|
static void |
addImportIfNeeded(org.apache.ws.commons.schema.XmlSchema schema,
QName qname)
For convenience, start from a qname, and add the import if it is non-null and has a namespace. |
static void |
addImportIfNeeded(org.apache.ws.commons.schema.XmlSchema schema,
String namespaceUri)
Assist in managing the required |
static String |
cleanedUpSchemaSource(org.apache.ws.commons.schema.XmlSchemaObject subject)
|
static List<String> |
enumeratorValues(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
Retrieve the string values for an enumeration. |
static org.apache.ws.commons.schema.XmlSchemaElement |
findElementByRefName(SchemaCollection xmlSchemaCollection,
QName name,
String referencingURI)
This copes with an observed phenomenon in the schema built by the ReflectionServiceFactoryBean. |
static org.apache.ws.commons.schema.XmlSchemaAll |
getAll(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static QName |
getBaseType(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static org.apache.ws.commons.schema.XmlSchemaChoice |
getChoice(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static List<org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef> |
getContentAttributes(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static List<org.apache.ws.commons.schema.XmlSchemaAnnotated> |
getContentAttributes(org.apache.ws.commons.schema.XmlSchemaComplexType type,
SchemaCollection collection)
|
static List<org.apache.ws.commons.schema.XmlSchemaObject> |
getContentElements(org.apache.ws.commons.schema.XmlSchemaComplexType type,
SchemaCollection collection)
|
static org.apache.ws.commons.schema.XmlSchemaSequence |
getContentSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static QName |
getElementQualifiedName(org.apache.ws.commons.schema.XmlSchemaElement element,
org.apache.ws.commons.schema.XmlSchema schema)
By convention, an element that is named in its schema's TNS can have a 'name' but no QName. |
static org.apache.ws.commons.schema.XmlSchemaType |
getElementType(SchemaCollection xmlSchemaCollection,
String referencingURI,
org.apache.ws.commons.schema.XmlSchemaElement element,
org.apache.ws.commons.schema.XmlSchemaType containingType)
Follow a chain of references from element to element until we can obtain a type. |
static org.apache.ws.commons.schema.XmlSchemaAnnotated |
getObjectAnnotated(org.apache.ws.commons.schema.XmlSchemaObject object,
QName contextName)
If the object is an attribute or an anyAttribute, return the 'Annotated'. |
static org.apache.ws.commons.schema.XmlSchemaParticle |
getObjectParticle(org.apache.ws.commons.schema.XmlSchemaObject object,
QName contextName)
If the object is an element or an any, return the particle. |
static org.apache.ws.commons.schema.XmlSchemaElement |
getReferredElement(org.apache.ws.commons.schema.XmlSchemaElement element,
SchemaCollection xmlSchemaCollection)
|
static org.apache.ws.commons.schema.XmlSchemaSequence |
getSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
|
static boolean |
isAttributeNameQualified(org.apache.ws.commons.schema.XmlSchemaAttribute attribute,
org.apache.ws.commons.schema.XmlSchema schema)
|
static boolean |
isAttributeQualified(org.apache.ws.commons.schema.XmlSchemaAttribute attribute,
boolean global,
org.apache.ws.commons.schema.XmlSchema localSchema,
org.apache.ws.commons.schema.XmlSchema attributeSchema)
due to a bug, feature, or just plain oddity of JAXB, it isn't good enough to just check the form of an element and of its schema. |
static boolean |
isComplexType(org.apache.ws.commons.schema.XmlSchemaType type)
|
static boolean |
isElementNameQualified(org.apache.ws.commons.schema.XmlSchemaElement element,
org.apache.ws.commons.schema.XmlSchema schema)
|
static boolean |
isElementQualified(org.apache.ws.commons.schema.XmlSchemaElement element,
boolean global,
org.apache.ws.commons.schema.XmlSchema localSchema,
org.apache.ws.commons.schema.XmlSchema elementSchema)
due to a bug, feature, or just plain oddity of JAXB, it isn't good enough to just check the form of an element and of its schema. |
static boolean |
isEumeration(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
Return true if a simple type is a straightforward XML Schema representation of an enumeration. |
static boolean |
isParticleArray(org.apache.ws.commons.schema.XmlSchemaParticle particle)
|
static boolean |
isParticleOptional(org.apache.ws.commons.schema.XmlSchemaParticle particle)
|
static boolean |
schemaImportsNamespace(org.apache.ws.commons.schema.XmlSchema schema,
String namespaceUri)
Is there an import for a particular namespace in a schema? |
static void |
setElementName(org.apache.ws.commons.schema.XmlSchemaElement element,
String name)
Wrapper around XmlSchemaElement.setName that checks for inconsistency with refName. |
static void |
setElementRefName(org.apache.ws.commons.schema.XmlSchemaElement element,
QName name)
Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with name and QName. |
static void |
unsupportedConstruct(String messageKey,
String what,
QName subjectName,
org.apache.ws.commons.schema.XmlSchemaObject subject)
|
static void |
unsupportedConstruct(String messageKey,
org.apache.ws.commons.schema.XmlSchemaType subject)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String XSI_NIL
public static final String XSI_NS_ATTR
public static final String XSI_NIL_WITH_PREFIX
Method Detail |
---|
public static void setElementName(org.apache.ws.commons.schema.XmlSchemaElement element, String name)
element
- name
- public static void setElementRefName(org.apache.ws.commons.schema.XmlSchemaElement element, QName name)
element
- name
- public static boolean isEumeration(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
type
- Simple type, possible an enumeration.
public static List<String> enumeratorValues(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
type
-
public static boolean schemaImportsNamespace(org.apache.ws.commons.schema.XmlSchema schema, String namespaceUri)
schema
- namespaceUri
-
public static void addImportIfNeeded(org.apache.ws.commons.schema.XmlSchema schema, String namespaceUri)
schema
- namespaceUri
- public static void addImportIfNeeded(org.apache.ws.commons.schema.XmlSchema schema, QName qname)
schema
- qname
- addImportIfNeeded(XmlSchema, String)
public static org.apache.ws.commons.schema.XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, String referencingURI)
name
- referencingURI
-
public static QName getBaseType(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static List<org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef> getContentAttributes(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static List<org.apache.ws.commons.schema.XmlSchemaAnnotated> getContentAttributes(org.apache.ws.commons.schema.XmlSchemaComplexType type, SchemaCollection collection)
public static List<org.apache.ws.commons.schema.XmlSchemaObject> getContentElements(org.apache.ws.commons.schema.XmlSchemaComplexType type, SchemaCollection collection)
public static org.apache.ws.commons.schema.XmlSchemaSequence getContentSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static QName getElementQualifiedName(org.apache.ws.commons.schema.XmlSchemaElement element, org.apache.ws.commons.schema.XmlSchema schema)
element
- schema
-
public static org.apache.ws.commons.schema.XmlSchemaType getElementType(SchemaCollection xmlSchemaCollection, String referencingURI, org.apache.ws.commons.schema.XmlSchemaElement element, org.apache.ws.commons.schema.XmlSchemaType containingType)
element
-
public static org.apache.ws.commons.schema.XmlSchemaAnnotated getObjectAnnotated(org.apache.ws.commons.schema.XmlSchemaObject object, QName contextName)
object
-
public static org.apache.ws.commons.schema.XmlSchemaParticle getObjectParticle(org.apache.ws.commons.schema.XmlSchemaObject object, QName contextName)
object
-
public static org.apache.ws.commons.schema.XmlSchemaElement getReferredElement(org.apache.ws.commons.schema.XmlSchemaElement element, SchemaCollection xmlSchemaCollection)
public static org.apache.ws.commons.schema.XmlSchemaSequence getSequence(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static org.apache.ws.commons.schema.XmlSchemaChoice getChoice(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static org.apache.ws.commons.schema.XmlSchemaAll getAll(org.apache.ws.commons.schema.XmlSchemaComplexType type)
public static boolean isAttributeNameQualified(org.apache.ws.commons.schema.XmlSchemaAttribute attribute, org.apache.ws.commons.schema.XmlSchema schema)
public static boolean isAttributeQualified(org.apache.ws.commons.schema.XmlSchemaAttribute attribute, boolean global, org.apache.ws.commons.schema.XmlSchema localSchema, org.apache.ws.commons.schema.XmlSchema attributeSchema)
attribute
- the attributeglobal
- if this element is a global element (complex type ref= to
it, or in a part)localSchema
- the schema of the complex type containing the
reference, only used for the 'odd case'.elementSchema
- the schema for the element.
public static boolean isComplexType(org.apache.ws.commons.schema.XmlSchemaType type)
public static boolean isElementNameQualified(org.apache.ws.commons.schema.XmlSchemaElement element, org.apache.ws.commons.schema.XmlSchema schema)
public static boolean isElementQualified(org.apache.ws.commons.schema.XmlSchemaElement element, boolean global, org.apache.ws.commons.schema.XmlSchema localSchema, org.apache.ws.commons.schema.XmlSchema elementSchema)
element
- the element.global
- if this element is a global element (complex type ref= to
it, or in a part)localSchema
- the schema of the complex type containing the
reference, only used for the 'odd case'.elementSchema
- the schema for the element.
public static boolean isParticleArray(org.apache.ws.commons.schema.XmlSchemaParticle particle)
public static boolean isParticleOptional(org.apache.ws.commons.schema.XmlSchemaParticle particle)
public static void unsupportedConstruct(String messageKey, String what, QName subjectName, org.apache.ws.commons.schema.XmlSchemaObject subject)
public static void unsupportedConstruct(String messageKey, org.apache.ws.commons.schema.XmlSchemaType subject)
public static String cleanedUpSchemaSource(org.apache.ws.commons.schema.XmlSchemaObject subject)
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |