Package com.adobe.xmp.path
Class XMPPath
java.lang.Object
com.adobe.xmp.path.XMPPath
- All Implemented Interfaces:
Iterable<XMPPathSegment>,Collection<XMPPathSegment>,List<XMPPathSegment>,SequencedCollection<XMPPathSegment>
XMPPath is a Class that provides an easy iterative description of a specific path into the XMP tree.
Each XMPPathSegment represents one segment of the path into the XMP tree.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, XMPPathSegment element) booleanbooleanaddAll(int index, Collection<? extends XMPPathSegment> c) booleanaddAll(Collection<? extends XMPPathSegment> c) voidclear()Compares the provided path with this path.booleanbooleancontainsAll(Collection<?> c) booleanget(int index) inthashCode()intbooleanisEmpty()iterator()intlistIterator(int index) static XMPPathCreates anXMPPathobject by parsing an XMP path String and creates one path segment for each detected segment in the path.remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) Serializes theXMPPathobject to a String representation.Serializes theXMPPathobject to a String representation.set(int index, XMPPathSegment element) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
XMPPath
public XMPPath()Creates an emptyXMPPathobject
-
-
Method Details
-
parse
public static XMPPath parse(String path, Map<String, String> prefixContract) throws XMPPathParserExceptionCreates anXMPPathobject by parsing an XMP path String and creates one path segment for each detected segment in the path.- Parameters:
path- Path string to parseprefixContract- A Map that contains the mapping between Namespaces and their prefixes. This must be provided to interpret the path correctly. The key must be the prefix and the value the namespace!- Throws:
XMPPathParserException- If the path has an invalid format or a prefix is found that is not defined in the prefixContract
-
serialize
Serializes theXMPPathobject to a String representation. This will produce a long form of the path using the full namespace strings.- Returns:
- String representation of the
XMPPath
-
serialize
Serializes theXMPPathobject to a String representation. This produces a short form of the path using the prefixes provided by the contract.- Parameters:
prefixContract- A Map that contains the mapping between Namespaces and their prefixes. The key must be the prefix and the value the namespace!- Returns:
- String representation of the
XMPPath
-
size
public int size()- Specified by:
sizein interfaceCollection<XMPPathSegment>- Specified by:
sizein interfaceList<XMPPathSegment>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<XMPPathSegment>- Specified by:
isEmptyin interfaceList<XMPPathSegment>
-
contains
- Specified by:
containsin interfaceCollection<XMPPathSegment>- Specified by:
containsin interfaceList<XMPPathSegment>
-
iterator
- Specified by:
iteratorin interfaceCollection<XMPPathSegment>- Specified by:
iteratorin interfaceIterable<XMPPathSegment>- Specified by:
iteratorin interfaceList<XMPPathSegment>
-
toArray
- Specified by:
toArrayin interfaceCollection<XMPPathSegment>- Specified by:
toArrayin interfaceList<XMPPathSegment>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<XMPPathSegment>- Specified by:
toArrayin interfaceList<XMPPathSegment>
-
add
- Specified by:
addin interfaceCollection<XMPPathSegment>- Specified by:
addin interfaceList<XMPPathSegment>
-
remove
- Specified by:
removein interfaceCollection<XMPPathSegment>- Specified by:
removein interfaceList<XMPPathSegment>
-
containsAll
- Specified by:
containsAllin interfaceCollection<XMPPathSegment>- Specified by:
containsAllin interfaceList<XMPPathSegment>
-
addAll
- Specified by:
addAllin interfaceCollection<XMPPathSegment>- Specified by:
addAllin interfaceList<XMPPathSegment>
-
addAll
- Specified by:
addAllin interfaceList<XMPPathSegment>
-
removeAll
- Specified by:
removeAllin interfaceCollection<XMPPathSegment>- Specified by:
removeAllin interfaceList<XMPPathSegment>
-
retainAll
- Specified by:
retainAllin interfaceCollection<XMPPathSegment>- Specified by:
retainAllin interfaceList<XMPPathSegment>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<XMPPathSegment>- Specified by:
clearin interfaceList<XMPPathSegment>
-
get
- Specified by:
getin interfaceList<XMPPathSegment>
-
set
- Specified by:
setin interfaceList<XMPPathSegment>
-
add
- Specified by:
addin interfaceList<XMPPathSegment>
-
remove
- Specified by:
removein interfaceList<XMPPathSegment>
-
indexOf
- Specified by:
indexOfin interfaceList<XMPPathSegment>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<XMPPathSegment>
-
listIterator
- Specified by:
listIteratorin interfaceList<XMPPathSegment>
-
listIterator
- Specified by:
listIteratorin interfaceList<XMPPathSegment>
-
subList
- Specified by:
subListin interfaceList<XMPPathSegment>
-
compare
Compares the provided path with this path.- Parameters:
path- the path to compare with- Returns:
- The paths are equal if both have the same size and each segment is EQUAL. If the provided path is a subpath of this path, ANCESTOR is returned. If the provided path is an ancestor of this path, DESCENDANT is returned. In all other cases the paths are DIFFERENT.
- Throws:
IllegalArgumentException- If path is null
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<XMPPathSegment>- Specified by:
hashCodein interfaceList<XMPPathSegment>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<XMPPathSegment>- Specified by:
equalsin interfaceList<XMPPathSegment>- Overrides:
equalsin classObject
-