public final class XmlSchemaWalker extends Object
XmlSchema
from a starting XmlSchemaElement
,
notifying attached visitors as it descends.Constructor and Description |
---|
XmlSchemaWalker(XmlSchemaCollection xmlSchemas)
Initializes the
XmlSchemaWalker with the
XmlScheamCollection to reference when following an
XmlSchemaElement . |
XmlSchemaWalker(XmlSchemaCollection xmlSchemas,
XmlSchemaVisitor visitor)
Initializes the
XmlSchemaWalker with an
XmlSchemaVisitor to notify as the schema is walked. |
Modifier and Type | Method and Description |
---|---|
XmlSchemaWalker |
addVisitor(XmlSchemaVisitor visitor)
Adds a new visitor to be notified as the XML Schemas are walked.
|
void |
clear()
Clears the internal state in preparation for another walk through the
schema.
|
Set<QName> |
getUserRecognizedTypes()
The user-defined types set with the call to
setUserRecognizedTypes(Set) , or null if none. |
XmlSchemaWalker |
removeVisitor(XmlSchemaVisitor visitor)
Removes the visitor to be notified as the XML Schemas are walked.
|
void |
setUserRecognizedTypes(Set<QName> userRecognizedTypes)
Defines the set of types the calling code recognizes.
|
void |
walk(XmlSchemaElement element)
Initiates a walk through the
XmlSchemaCollection starting with
the provided root XmlSchemaElement . |
public XmlSchemaWalker(XmlSchemaCollection xmlSchemas)
XmlSchemaWalker
with the
XmlScheamCollection
to reference when following an
XmlSchemaElement
.public XmlSchemaWalker(XmlSchemaCollection xmlSchemas, XmlSchemaVisitor visitor)
XmlSchemaWalker
with an
XmlSchemaVisitor
to notify as the schema is walked.
(Other visitors may continue to be added after this one.)
xmlSchemas
- The set of schemas to walk.visitor
- The visitor to visit during the walk.public XmlSchemaWalker addVisitor(XmlSchemaVisitor visitor)
visitor
- The visitor to be notified.XmlSchemaWalker
instance for method chaining.public XmlSchemaWalker removeVisitor(XmlSchemaVisitor visitor)
visitor
- The visitor to remove.XmlSchemaWalker
instance for method chaining.public void clear()
public void setUserRecognizedTypes(Set<QName> userRecognizedTypes)
XmlSchemaTypeInfo
that is passed to the
XmlSchemaVisitor
s, with lower types in the hierarchy taking
precedence over higher types.
This information is useful when translating from XML Schema to another schema, as this automatically associates the destination type with the source XML Schema type.
userRecognizedTypes
- The set of types the user recognizes and would
like recognized when traversed.public Set<QName> getUserRecognizedTypes()
setUserRecognizedTypes(Set)
, or null
if none.public void walk(XmlSchemaElement element)
XmlSchemaCollection
starting with
the provided root XmlSchemaElement
. Any visitors will be notified
as the walk progresses.
Once this method completes, call clear()
before starting another
walk through the XML Schemas.
element
- The root element to start the walk from.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.