public class SchemaPath
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SchemaPath.PathStep |
static class |
SchemaPath.StepBase |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
m_sourceObject
Source object for path expression.
|
private SchemaPath.StepBase[] |
m_steps
Path steps.
|
private ValidationContext |
m_validationContext
Validation context used for reporting errors.
|
private static SchemaPath.StepBase |
WILDCARD_ELEMENT_STEP
Single element wildcard step.
|
private static SchemaPath.StepBase |
WILDCARD_NESTING_STEP
Nesteing element wildcard step.
|
| Modifier | Constructor and Description |
|---|---|
private |
SchemaPath(java.lang.Object obj,
ValidationContext vctx)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static SchemaPath |
buildPath(java.lang.String path,
java.lang.String elemname,
java.lang.String nameattr,
java.lang.String postext,
java.lang.Object obj,
ValidationContext vctx)
Build a path.
|
private SchemaPath.StepBase |
buildPathStep(java.lang.String step)
Build a path step.
|
private int |
convertPosition(java.lang.String postext)
Validate and convert a position value.
|
int |
getPathLength()
Get length of this path (minimum number of nested elements).
|
boolean |
isWildStart()
Check if the first path step is a wildcard.
|
private void |
match(int offset,
int end,
OpenAttrBase base,
java.util.ArrayList matches)
Find matches for expression starting from a supplied schema element.
|
OpenAttrBase |
matchUnique(OpenAttrBase base)
Find unique match for expression starting from a supplied schema element annotation.
|
java.util.List |
partialMatchMultiple(int first,
int last,
OpenAttrBase base)
Find any number of matches for subexpression starting from a supplied schema element annotation.
|
OpenAttrBase |
partialMatchUnique(int first,
int last,
OpenAttrBase base)
Find unique match for subexpression starting from a supplied schema element annotation.
|
private boolean |
validateName(java.lang.String nameattr)
Validate a name attribute value.
|
private static final SchemaPath.StepBase WILDCARD_ELEMENT_STEP
private static final SchemaPath.StepBase WILDCARD_NESTING_STEP
private final java.lang.Object m_sourceObject
private final ValidationContext m_validationContext
private SchemaPath.StepBase[] m_steps
private SchemaPath(java.lang.Object obj,
ValidationContext vctx)
obj - source object for expressionvctx - validation contextprivate boolean validateName(java.lang.String nameattr)
nameattr - name valuetrue if valid, false if notprivate int convertPosition(java.lang.String postext)
postext - position text-1 if errorprivate SchemaPath.StepBase buildPathStep(java.lang.String step)
step - expressionnull if errorprivate void match(int offset,
int end,
OpenAttrBase base,
java.util.ArrayList matches)
offset - current path step offsetend - ending match list offsetbase - starting element for matchmatches - elements matching expressionpublic int getPathLength()
public boolean isWildStart()
true if wildcard, false if notpublic java.util.List partialMatchMultiple(int first,
int last,
OpenAttrBase base)
first - starting path step indexlast - ending path step indexbase - starting element for matchnull if errorpublic OpenAttrBase partialMatchUnique(int first, int last, OpenAttrBase base)
first - starting path step indexlast - ending path step indexbase - starting element for matchnull if errorpublic OpenAttrBase matchUnique(OpenAttrBase base)
base - starting element for matchnull if errorpublic static SchemaPath buildPath(java.lang.String path, java.lang.String elemname, java.lang.String nameattr, java.lang.String postext, java.lang.Object obj, ValidationContext vctx)
path - expression (null if none)elemname - element name for final step in pathnameattr - name attribute (applied to final step in path, null if none)postext - position (applied to final step in path, null if none)obj - object defining the pathvctx - validation contextnull if error