|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flexive.shared.XPathElement
public class XPathElement
A single XPath element (alias and multiplicity).
| Constructor Summary | |
|---|---|
XPathElement(java.lang.String alias,
int index,
boolean indexDefined)
Ctor |
|
| Method Summary | |
|---|---|
static java.lang.String |
buildXPath(boolean leadingSlash,
java.lang.String... elements)
Build an XPath from the given elements |
static java.lang.String |
changeIndex(java.lang.String XPath,
int pos,
int index)
Change the index of an xpath (requires an xpath with all explicit indices set!) This method is optimized for performance and does not check for validity! |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getAlias()
Getter for the alias |
int |
getIndex()
Getter for the multiplicity |
static int[] |
getIndices(java.lang.String XPath)
Get the FQ indices of an XPath as an int array. |
static FxPK |
getPK(java.lang.String xPath)
Extract the primary key stored in the given XPath. |
int |
hashCode()
|
boolean |
isIndexDefined()
Was the multiplicity explicitly defined? |
static boolean |
isValidXPath(java.lang.String XPath)
Check if this XPath is valid. |
static XPathElement |
lastElement(java.lang.String XPath)
Get the last (rightmost) element of an XPath. |
void |
setIndex(int index)
Setter for the multiplicity |
static java.util.List<XPathElement> |
split(java.lang.String XPath)
Split an XPath into its elements |
static java.lang.String |
stripLastElement(java.lang.String XPath)
Strip the last element (usually property) from an XPath |
static java.lang.String |
stripType(java.lang.String XPath)
Strip leading types from an XPath if present, and return the XPath in upper case. |
static XPathElement |
toElement(java.lang.String XPath,
java.lang.String alias)
Convert an alias of an XPath to an element |
java.lang.String |
toString()
get FQN of the alias |
static java.lang.String |
toXPath(java.util.List<XPathElement> xpe)
Get the XPath of an array of XPathElements with multiplicities |
static java.lang.String |
toXPathMult(java.lang.String XPath)
Get the given XPath with full multiplicity information |
static java.lang.String |
toXPathMult(java.lang.String XPath,
java.lang.String indices)
Get the given XPath with full multiplicity information. |
static java.lang.String |
toXPathNoMult(java.util.List<XPathElement> xpe)
Get the XPath of an array of XPathElements without multiplicities |
static java.lang.String |
toXPathNoMult(java.lang.String XPath)
Get the given XPath with no indices |
static java.lang.String |
xpToUpperCase(java.lang.String xpath)
Optimized uppercase method for XPaths (characters are limited to a-z). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XPathElement(java.lang.String alias,
int index,
boolean indexDefined)
alias - alias to useindex - multiplicity to applyindexDefined - was the multiplicity explicitly defined?| Method Detail |
|---|
public java.lang.String getAlias()
public int getIndex()
public void setIndex(int index)
index - the multiplicity to applypublic boolean isIndexDefined()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static java.util.List<XPathElement> split(java.lang.String XPath)
For performance reasons, this method expects that the xPath is already in upper case form.
XPath - the XPath
public static XPathElement lastElement(java.lang.String XPath)
For performance reasons, this method expects that the xPath is already in upper case form.
XPath - the XPath
public static XPathElement toElement(java.lang.String XPath,
java.lang.String alias)
XPath - full XPath, only used if exception is thrownalias - alias to convert to an XPathElement
public static boolean isValidXPath(java.lang.String XPath)
For performance reasons, this method expects that the xPath is already in upper case form.
XPath - the XPath
public static java.lang.String toXPath(java.util.List<XPathElement> xpe)
xpe - list containing XPathElement
public static java.lang.String toXPathNoMult(java.util.List<XPathElement> xpe)
xpe - list containing XPathElement
public static java.lang.String toXPathMult(java.lang.String XPath)
XPath - XPath
public static java.lang.String toXPathMult(java.lang.String XPath,
java.lang.String indices)
XPath - valid XPath without type information and without indicesindices - indices to apply (comma separated)
public static java.lang.String toXPathNoMult(java.lang.String XPath)
XPath - XPath with indices
public static int[] getIndices(java.lang.String XPath)
XPath - the xpath to examine
public static java.lang.String buildXPath(boolean leadingSlash,
java.lang.String... elements)
leadingSlash - prepend a leading slash character?elements - elements that build the XPath
public static java.lang.String stripType(java.lang.String XPath)
XPath - the XPath
public static java.lang.String stripLastElement(java.lang.String XPath)
XPath - the XPath
public static FxPK getPK(java.lang.String xPath)
xPath - the xpath
FxRuntimeException - if the given xpath is invalid or contains no PK
public static java.lang.String changeIndex(java.lang.String XPath,
int pos,
int index)
XPath - the xpath with all indices setpos - position of the element (0-based)index - the new index to apply
public static java.lang.String xpToUpperCase(java.lang.String xpath)
xpath - the XPath
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||