public class ItemPath extends Object implements Serializable, Cloneable, ShortDumpable
Modifier and Type | Class and Description |
---|---|
static class |
ItemPath.CompareResult |
Modifier and Type | Field and Description |
---|---|
static ItemPath |
EMPTY_PATH |
static QName |
XSD_TYPE
Deprecated.
|
Constructor and Description |
---|
ItemPath(ItemPath parentPath,
ItemPath childPath) |
ItemPath(ItemPath parentPath,
ItemPathSegment subSegment) |
ItemPath(ItemPath parentPath,
QName subName) |
ItemPath(ItemPathSegment... segments) |
ItemPath(List<ItemPathSegment> segments) |
ItemPath(List<ItemPathSegment> segments,
ItemPathSegment subSegment) |
ItemPath(List<ItemPathSegment> segments,
List<ItemPathSegment> additionalSegments) |
ItemPath(List<ItemPathSegment> segments,
QName subName) |
ItemPath(Object... namesOrIdsOrSegments) |
ItemPath(QName... qnames) |
ItemPath(String... names) |
Modifier and Type | Method and Description |
---|---|
ItemPath |
allExceptLast()
Returns a path containing all segments except the last one.
|
ItemPath |
allUpTo(ItemPathSegment segment)
Returns a path containing all segments up to (not including) the specified one;
counted from backwards.
|
ItemPath |
allUpToIncluding(int i) |
ItemPath |
allUpToIncluding(ItemPathSegment segment)
Returns a path containing all segments up to (including) the specified one;
counted from backwards.
|
ItemPath |
allUpToLastNamed()
Returns a path containing all segments up to (and not including) the last one.
|
ItemPath |
append(ItemPath childPath) |
ItemPath |
append(QName childName) |
ItemPathType |
asItemPathType() |
static ItemPath[] |
asPathArray(QName... names) |
QName |
asSingleName() |
static QName |
asSingleName(ItemPath path) |
static void |
checkNoSpecialSymbols(ItemPath path) |
static void |
checkNoSpecialSymbolsExceptParent(ItemPath path) |
ItemPath |
clone() |
ItemPath.CompareResult |
compareComplex(ItemPath otherPath) |
ItemPath.CompareResult |
compareComplexOld(ItemPath otherPath)
Deprecated.
|
static boolean |
containsEquivalent(Collection<ItemPath> paths,
ItemPath pathToBeFound) |
boolean |
containsName(QName name) |
static boolean |
containsSingleNameSegment(ItemPath path) |
boolean |
containsSpecialSymbols() |
static boolean |
containsSpecialSymbols(ItemPath path) |
boolean |
containsSpecialSymbolsExceptParent() |
static boolean |
containsSubpath(Collection<ItemPath> paths,
ItemPath pathToBeFound)
Returns true if the collection contains a superpath of the given path.
|
static boolean |
containsSubpathOrEquivalent(Collection<ItemPath> paths,
ItemPath pathToBeFound)
Returns true if the collection contains a subpath of or equivalent path to the given path.
|
static boolean |
containsSuperpath(Collection<ItemPath> paths,
ItemPath pathToBeFound)
Returns true if the collection contains a superpath of the given path.
|
static boolean |
containsSuperpathOrEquivalent(Collection<ItemPath> paths,
ItemPath pathToBeFound)
Returns true if the collection contains a superpath of or equivalent path to the given path.
|
static ItemPathSegment |
createSegment(QName qname,
boolean variable) |
boolean |
equals(Object obj)
More strict version of ItemPath comparison.
|
boolean |
equals(Object obj,
boolean exact) |
boolean |
equivalent(ItemPath otherPath)
Compares two paths semantically.
|
ItemPathSegment |
first() |
static List<ItemPath> |
fromStringList(List<String> pathsAsStrings) |
IdItemPathSegment |
getFirstIdSegment() |
static IdItemPathSegment |
getFirstIdSegment(ItemPath itemPath) |
QName |
getFirstName() |
static QName |
getFirstName(ItemPath itemPath) |
NameItemPathSegment |
getFirstNameSegment() |
static NameItemPathSegment |
getFirstNameSegment(ItemPath itemPath) |
static QName |
getName(ItemPathSegment segment)
Convenience static method with checks
|
Map<String,String> |
getNamespaceMap() |
List<ItemPathSegment> |
getSegments() |
int |
hashCode() |
ItemPath |
head()
Returns first segment in a form of path.
|
boolean |
isEmpty() |
static boolean |
isNullOrEmpty(ItemPath itemPath) |
static boolean |
isNullOrEmpty(ItemPathType pathType) |
boolean |
isSingleName() |
boolean |
isSubPath(ItemPath otherPath) |
boolean |
isSubPathOrEquivalent(ItemPath otherPath) |
boolean |
isSuperPath(ItemPath otherPath) |
boolean |
isSuperPathOrEquivalent(ItemPath otherPath) |
ItemPathSegment |
last() |
NameItemPathSegment |
lastNamed() |
ItemPath |
namedSegmentsOnly() |
ItemPath |
normalize()
Makes the path "normal" by inserting null Id segments where they were omitted.
|
static ItemPath |
pathRestStartingWithName(ItemPath path) |
static Collection<ItemPath> |
remainder(Collection<ItemPath> paths,
ItemPath prefix,
boolean alsoEquivalent)
Strips the prefix from a set of paths.
|
ItemPath |
remainder(ItemPath prefix)
Returns the remainder of "this" path after passing all segments from the other path.
|
ItemPath |
removeIdentifiers() |
ItemPath |
rest() |
void |
setNamespaceMap(Map<String,String> namespaceMap) |
void |
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.
|
int |
size() |
boolean |
startsWith(Class<? extends ItemPathSegment> clazz) |
boolean |
startsWith(ItemPath other) |
boolean |
startsWithName(QName name) |
boolean |
startsWithVariable() |
ItemPath |
stripVariableSegment() |
ItemPath |
subPath(ItemPath subPath) |
static ItemPath |
subPath(ItemPath prefix,
ItemPathSegment subSegment)
Null-proof static version.
|
ItemPath |
subPath(ItemPathSegment subSegment) |
ItemPath |
subPath(Long id) |
ItemPath |
subPath(Object... components) |
ItemPath |
subPath(QName subName) |
ItemPath |
substract(ItemPath otherPath)
Deprecated.
|
ItemPath |
tail() |
ItemPath |
tail(int n)
Returns path containing all segments except the first N.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
shortDump, shortDumpLazily
@Deprecated public static final QName XSD_TYPE
public static final ItemPath EMPTY_PATH
public ItemPath(QName... qnames)
public ItemPath(String... names)
public ItemPath(Object... namesOrIdsOrSegments)
public ItemPath(List<ItemPathSegment> segments)
public ItemPath(List<ItemPathSegment> segments, ItemPathSegment subSegment)
public ItemPath(List<ItemPathSegment> segments, QName subName)
public ItemPath(List<ItemPathSegment> segments, List<ItemPathSegment> additionalSegments)
public ItemPath(ItemPathSegment... segments)
public ItemPath(ItemPath parentPath, ItemPathSegment subSegment)
public ItemPath subPath(ItemPathSegment subSegment)
public static ItemPath subPath(ItemPath prefix, ItemPathSegment subSegment)
public static ItemPathSegment createSegment(QName qname, boolean variable)
public List<ItemPathSegment> getSegments()
public ItemPathSegment first()
@NotNull public ItemPath rest()
public NameItemPathSegment lastNamed()
@Nullable public ItemPathSegment last()
public ItemPath head()
@NotNull public ItemPath tail(int n)
@NotNull public ItemPath tail()
@NotNull public ItemPath allExceptLast()
public ItemPath allUpToLastNamed()
public ItemPath allUpTo(ItemPathSegment segment)
public ItemPath allUpToIncluding(ItemPathSegment segment)
public ItemPath allUpToIncluding(int i)
public int size()
public boolean isEmpty()
public ItemPath normalize()
public ItemPath removeIdentifiers()
@Deprecated public ItemPath.CompareResult compareComplexOld(ItemPath otherPath)
public ItemPath.CompareResult compareComplex(ItemPath otherPath)
public static boolean containsEquivalent(Collection<ItemPath> paths, ItemPath pathToBeFound)
public static boolean containsSuperpathOrEquivalent(Collection<ItemPath> paths, ItemPath pathToBeFound)
public static boolean containsSuperpath(Collection<ItemPath> paths, ItemPath pathToBeFound)
public static boolean containsSubpathOrEquivalent(Collection<ItemPath> paths, ItemPath pathToBeFound)
public static boolean containsSubpath(Collection<ItemPath> paths, ItemPath pathToBeFound)
public ItemPath namedSegmentsOnly()
public static boolean isNullOrEmpty(ItemPath itemPath)
public static boolean isNullOrEmpty(ItemPathType pathType)
public static boolean containsSingleNameSegment(ItemPath path)
public boolean startsWith(Class<? extends ItemPathSegment> clazz)
public boolean startsWith(ItemPath other)
public boolean startsWithName(QName name)
public boolean startsWithVariable()
public ItemPath stripVariableSegment()
public QName asSingleName()
public boolean isSingleName()
public boolean isSubPath(ItemPath otherPath)
public boolean isSuperPath(ItemPath otherPath)
public boolean isSuperPathOrEquivalent(ItemPath otherPath)
public boolean isSubPathOrEquivalent(ItemPath otherPath)
public boolean equivalent(ItemPath otherPath)
@Deprecated public ItemPath substract(ItemPath otherPath)
public ItemPath remainder(ItemPath prefix)
public static Collection<ItemPath> remainder(Collection<ItemPath> paths, ItemPath prefix, boolean alsoEquivalent)
alsoEquivalent
- If true, 'prefix' in paths is processed as well (resulting in empty path). Otherwise, it is skipped.public static QName getName(ItemPathSegment segment)
IllegalArgumentException
- If the argument is an item path segment other than a named onepublic static IdItemPathSegment getFirstIdSegment(ItemPath itemPath)
public static NameItemPathSegment getFirstNameSegment(ItemPath itemPath)
public NameItemPathSegment getFirstNameSegment()
public IdItemPathSegment getFirstIdSegment()
public QName getFirstName()
public boolean containsName(QName name)
public void shortDump(StringBuilder sb)
ShortDumpable
shortDump
in interface ShortDumpable
sb
- StringBuilder to which to a compact one-line content of the object intended
for diagnostics by system administrator should be appended.public boolean equals(Object obj, boolean exact)
public boolean equals(Object obj)
public static boolean containsSpecialSymbols(ItemPath path)
public boolean containsSpecialSymbols()
public boolean containsSpecialSymbolsExceptParent()
public static void checkNoSpecialSymbols(ItemPath path)
public static void checkNoSpecialSymbolsExceptParent(ItemPath path)
public ItemPathType asItemPathType()
Copyright © 2019 Evolveum. All rights reserved.