public class XMPPath extends java.lang.Object implements java.util.List<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.Modifier and Type | Class and Description |
---|---|
static class |
XMPPath.Compare |
Constructor and Description |
---|
XMPPath()
Creates an empty
XMPPath object |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
XMPPathSegment element) |
boolean |
add(XMPPathSegment e) |
boolean |
addAll(java.util.Collection<? extends XMPPathSegment> c) |
boolean |
addAll(int index,
java.util.Collection<? extends XMPPathSegment> c) |
void |
clear() |
XMPPath.Compare |
compare(XMPPath path)
Compares the provided path with this path.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object obj) |
XMPPathSegment |
get(int index) |
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator<XMPPathSegment> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<XMPPathSegment> |
listIterator() |
java.util.ListIterator<XMPPathSegment> |
listIterator(int index) |
static XMPPath |
parse(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> prefixContract)
Creates an
XMPPath object by parsing an XMP path String and creates one path segment
for each detected segment in the path. |
XMPPathSegment |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
java.lang.String |
serialize()
Serializes the
XMPPath object to a String representation. |
java.lang.String |
serialize(java.util.Map<java.lang.String,java.lang.String> prefixContract)
Serializes the
XMPPath object to a String representation. |
XMPPathSegment |
set(int index,
XMPPathSegment element) |
int |
size() |
java.util.List<XMPPathSegment> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public static XMPPath parse(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> prefixContract) throws XMPPathParserException
XMPPath
object by parsing an XMP path String and creates one path segment
for each detected segment in the path.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!XMPPathParserException
- If the path has an invalid format or a prefix is found that is not defined in the prefixContractpublic java.lang.String serialize()
XMPPath
object to a String representation.
This will produce a long form of the path using the full namespace strings.XMPPath
public java.lang.String serialize(java.util.Map<java.lang.String,java.lang.String> prefixContract)
XMPPath
object to a String representation.
This produces a short form of the path using the prefixes provided by the contract.prefixContract
- A Map that contains the mapping between Namespaces and their prefixes.
The key must be the prefix and the value the namespace!XMPPath
public int size()
size
in interface java.util.Collection<XMPPathSegment>
size
in interface java.util.List<XMPPathSegment>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<XMPPathSegment>
isEmpty
in interface java.util.List<XMPPathSegment>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<XMPPathSegment>
contains
in interface java.util.List<XMPPathSegment>
public java.util.Iterator<XMPPathSegment> iterator()
iterator
in interface java.lang.Iterable<XMPPathSegment>
iterator
in interface java.util.Collection<XMPPathSegment>
iterator
in interface java.util.List<XMPPathSegment>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<XMPPathSegment>
toArray
in interface java.util.List<XMPPathSegment>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<XMPPathSegment>
toArray
in interface java.util.List<XMPPathSegment>
public boolean add(XMPPathSegment e)
add
in interface java.util.Collection<XMPPathSegment>
add
in interface java.util.List<XMPPathSegment>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<XMPPathSegment>
remove
in interface java.util.List<XMPPathSegment>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<XMPPathSegment>
containsAll
in interface java.util.List<XMPPathSegment>
public boolean addAll(java.util.Collection<? extends XMPPathSegment> c)
addAll
in interface java.util.Collection<XMPPathSegment>
addAll
in interface java.util.List<XMPPathSegment>
public boolean addAll(int index, java.util.Collection<? extends XMPPathSegment> c)
addAll
in interface java.util.List<XMPPathSegment>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<XMPPathSegment>
removeAll
in interface java.util.List<XMPPathSegment>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<XMPPathSegment>
retainAll
in interface java.util.List<XMPPathSegment>
public void clear()
clear
in interface java.util.Collection<XMPPathSegment>
clear
in interface java.util.List<XMPPathSegment>
public XMPPathSegment get(int index)
get
in interface java.util.List<XMPPathSegment>
public XMPPathSegment set(int index, XMPPathSegment element)
set
in interface java.util.List<XMPPathSegment>
public void add(int index, XMPPathSegment element)
add
in interface java.util.List<XMPPathSegment>
public XMPPathSegment remove(int index)
remove
in interface java.util.List<XMPPathSegment>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<XMPPathSegment>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<XMPPathSegment>
public java.util.ListIterator<XMPPathSegment> listIterator()
listIterator
in interface java.util.List<XMPPathSegment>
public java.util.ListIterator<XMPPathSegment> listIterator(int index)
listIterator
in interface java.util.List<XMPPathSegment>
public java.util.List<XMPPathSegment> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<XMPPathSegment>
public XMPPath.Compare compare(XMPPath path)
path
- the path to compare withjava.lang.IllegalArgumentException
- If path is nullpublic int hashCode()
hashCode
in interface java.util.Collection<XMPPathSegment>
hashCode
in interface java.util.List<XMPPathSegment>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<XMPPathSegment>
equals
in interface java.util.List<XMPPathSegment>
equals
in class java.lang.Object
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"