|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.schema.elements.SchemaPath
public class SchemaPath
Path specification within a schema definition. This implements simple XPath-like expressions, consisting of any number of path components given as element names or '*' for any element or '**' for any nesting of elements, along with optional position number or name attribute predicates in square brackets.
Nested Class Summary | |
---|---|
static class |
SchemaPath.PathStep
|
static class |
SchemaPath.StepBase
|
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
private |
SchemaPath(java.lang.Object obj,
ValidationContext vctx)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
private SchemaPath(java.lang.Object obj, ValidationContext vctx)
obj
- source object for expressionvctx
- validation contextMethod Detail |
---|
private boolean validateName(java.lang.String nameattr)
nameattr
- name value
true
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
- expression
null
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 match
null
if errorpublic OpenAttrBase partialMatchUnique(int first, int last, OpenAttrBase base)
first
- starting path step indexlast
- ending path step indexbase
- starting element for match
null
if errorpublic OpenAttrBase matchUnique(OpenAttrBase base)
base
- starting element for match
null
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 context
null
if error
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |