public class XmlSchemaInspector extends BaseXmlInspector
If
XmlSchemaInspector is used for a Java environment, consider using it in conjunction with
XmlSchemaToJavaTypeMappingProcessor
. For returning results to JavaScript environments, consider
JavaToJavaScriptTypeMappingProcessor
and XmlUtils.elementToJson
.
mLog
Constructor and Description |
---|
XmlSchemaInspector(XmlSchemaInspectorConfig config) |
Modifier and Type | Method and Description |
---|---|
protected String |
getReferenceAttribute()
Overridden to introduce a reference attribute
ref= . |
protected String |
getTopLevelTypeAttribute()
Overridden to search by
name= , not type= . |
protected Map<String,String> |
inspectProperty(Element toInspect)
Inspect the given Element and return a Map of attributes if it is a property.
|
protected void |
inspectTraits(Element toInspect,
Element toAddTo)
Inspect the
toInspect for properties and actions. |
protected Element |
traverseFromTopLevelTypeToNamedChildren(Element topLevel)
Overridden because, with XML Schema, the named children are often nested a couple of levels
deep under the top-level element.
|
getDocumentElement, getDocumentElement, getExtendsAttribute, getNameAttribute, getTypeAttribute, inspect, inspectAction, inspectAsDom, inspectTrait, inspectTraitSiblings, preprocessDocument, traverse
public XmlSchemaInspector(XmlSchemaInspectorConfig config)
protected String getTopLevelTypeAttribute()
name=
, not type=
.getTopLevelTypeAttribute
in class BaseXmlInspector
protected String getReferenceAttribute()
ref=
.getReferenceAttribute
in class BaseXmlInspector
protected Element traverseFromTopLevelTypeToNamedChildren(Element topLevel)
xs:element/xs:complexType/xs:sequence
.traverseFromTopLevelTypeToNamedChildren
in class BaseXmlInspector
protected void inspectTraits(Element toInspect, Element toAddTo)
BaseXmlInspector
toInspect
for properties and actions.
This method can be overridden by clients wishing to modify the inspection process. Most
clients will find it easier to override one of the sub-methods, such as
inspectTrait
or inspectProperty
.
inspectTraits
in class BaseXmlInspector
protected Map<String,String> inspectProperty(Element toInspect)
BaseXmlInspector
It is this method's responsibility to decide whether the given Element does, in fact, qualify as a 'property' - based on its own rules. Does nothing by default.
inspectProperty
in class BaseXmlInspector
toInspect
- DOM element to inspectCopyright © 2015. All Rights Reserved.