public class Context extends Object
Constructor and Description |
---|
Context(SchemaSystem system,
ConflictHandler handler,
org.apache.xmlbeans.XmlCursor cursor)
Creates a new Context object.
|
Modifier and Type | Method and Description |
---|---|
void |
cd(String item)
Append an element to the end of the current path.
|
void |
clearAttribute(String key)
Delete a stored attribute.
|
String |
getAttribute(String key)
Get a stored attribute.
|
org.apache.xmlbeans.XmlCursor |
getCursor()
Get the internal cursor pointing to the current position of the XML
content to be validated.
|
ConflictHandler |
getHandler()
Getter for the contained ConflictHandler.
|
String |
getName()
Get a name to use for a Complex Type at the current path.
|
String |
getPath()
Get the path currently at.
|
SchemaSystem |
getSchemaSystem()
Get the SchemaSystem currently used for validation.
|
void |
popPath()
Pop a previously pushed path from the internal stack, overwriting whatever
is currently in the path.
|
void |
pushPath()
Push the current path to an internal stack, and start with an empty path.
|
void |
putAttribute(String key,
String value)
Store an attribute.
|
void |
up()
Move up one level, removing the last element from the path.
|
public Context(SchemaSystem system, ConflictHandler handler, org.apache.xmlbeans.XmlCursor cursor)
system
- The SchemaSystem holding the namespaces to be used for
validation.handler
- The ConflictHandler to use whenever a validation error occurs to
decide upon which action to take.cursor
- An XmlCursor pointing to the beginning of the XML content to
validate.public ConflictHandler getHandler()
public String getName()
public String getAttribute(String key)
key
- The key of the attribute to get.public void putAttribute(String key, String value)
key
- The name of the attribute to store.value
- The value to store.public void clearAttribute(String key)
key
- The name of the attribute to delete.public String getPath()
public void pushPath()
public void popPath()
public void cd(String item)
item
- The name of the element to trascend into.public void up()
public org.apache.xmlbeans.XmlCursor getCursor()
public SchemaSystem getSchemaSystem()
Copyright © 2019. All Rights Reserved.