public class Position extends java.lang.Object implements OrderingConstants, XmlSerializable
Position encapsulates the position in ordering information
contained in a Webdav request. This includes both the
Position header and the position
Xml element present in the request body of an ORDERPATCH request.HEADER_ORDERING_TYPE, HEADER_POSITION, NAMESPACE, ORDERING_TYPE, ORDERING_TYPE_CUSTOM, ORDERING_TYPE_UNORDERED, SUPPORTED_LIVE_PROPERTY_SET, SUPPORTED_METHOD_SET, XML_AFTER, XML_BEFORE, XML_FIRST, XML_LAST, XML_ORDER_MEMBER, XML_ORDERING_TYPE, XML_ORDERPATCH, XML_POSITION, XML_SEGMENT| Constructor and Description |
|---|
Position(java.lang.String type)
Create a new
Position object with the specified type. |
Position(java.lang.String type,
java.lang.String segment)
Create a new
Position object with the specified type and
segment. |
| Modifier and Type | Method and Description |
|---|---|
static Position |
createFromXml(org.w3c.dom.Element positionElement)
Create a new
Position object from the specified position
element. |
java.lang.String |
getSegment()
Returns the segment used to create this
Position object or
null if no segment is present with the type. |
java.lang.String |
getType()
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document document)
Returns the xml representation of the implementing object as
Element. |
public Position(java.lang.String type)
Position object with the specified type.
Since any type except for first and last
must be combined with a segment, only the mentioned types are valid
arguments.type - first or lastjava.lang.IllegalArgumentException - if the given type is other than OrderingConstants.XML_FIRST
or OrderingConstants.XML_LAST.public Position(java.lang.String type,
java.lang.String segment)
Position object with the specified type and
segment.type - segment - java.lang.IllegalArgumentException - if the specified type and segment do not
form a valid pair.public java.lang.String getType()
Position object, which may be any
of the following valid types: first,
last, after, beforepublic java.lang.String getSegment()
Position object or
null if no segment is present with the type.nullgetType()public org.w3c.dom.Element toXml(org.w3c.dom.Document document)
XmlSerializableElement. The given Document is used
as factory and represents the owner document of the returned DOM element.toXml in interface XmlSerializabledocument - XmlSerializable.toXml(Document)public static Position createFromXml(org.w3c.dom.Element positionElement)
Position object from the specified position
element. The element must fulfill the following structure:<!ELEMENT position (first | last | before | after) > <!ELEMENT segment (#PCDATA) > <!ELEMENT first EMPTY > <!ELEMENT last EMPTY > <!ELEMENT before segment > <!ELEMENT after segment >
positionElement - Xml element defining the position.java.lang.IllegalArgumentException - if the given Xml element is not valid.Copyright © 2010 - 2023 Adobe. All Rights Reserved