| Modifier and Type | Method and Description |
|---|---|
boolean |
addIfAttribute(QName id)
Conditionally adds a new attribute path step.
|
boolean |
addIfElement(QName id)
Conditionally adds a new element path step.
|
Path.Builder |
addStep(MetadataKey<?> step)
Adds a new path step to the end of the path.
|
Path |
build()
Returns a new
Path instance based upon the current state of the
builder. |
public Path.Builder addStep(MetadataKey<?> step)
ElementKey, then the step will
be valid if there is a child element type with the same QName. If
the step parameter is an AttributeKey, then it will be valid if
there is a matching child attribute type with the same QName. If
invalid, a PathException will be thrown. No validation is
performed for relative paths.step - metadata key for new path stepPathException - if this path has been bound to a
metadata instance and no key with the given step can be found, or
if the path is an attribute path. Once a path has an attribute key
no more steps may be added.public boolean addIfElement(QName id)
QName matches a valid child element type for the
current selected element. If the path is relative a new
ElementKey step corresponding to the name will be unconditionally
added.id - qualified name of child element step to addtrue if added successfully, false otherwise.PathException - if this path is an attribute path. Once a path has
an attribute key no more steps may be added.public boolean addIfAttribute(QName id)
QName matches a valid child attribute type for
the current selected element. If the path is relative a new
ElementKey step corresponding to the name will be unconditionally
added.id - qualified name of child attribute step to addtrue if added successfully, false otherwise.PathException - if this path is an attribute path. Once a path has
an attribute key no more steps may be added.