Class Position

java.lang.Object
org.apache.jackrabbit.webdav.ordering.Position
All Implemented Interfaces:
OrderingConstants, XmlSerializable

public class Position extends 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.
See Also:
  • Constructor Details

  • Method Details

    • getType

      public String getType()
      Return the type of this Position object, which may be any of the following valid types: first, last, after, before
      Returns:
      type
    • getSegment

      public String getSegment()
      Returns the segment used to create this Position object or null if no segment is present with the type.
      Returns:
      segment or null
      See Also:
    • toXml

      public Element toXml(Document document)
      Description copied from interface: XmlSerializable
      Returns the xml representation of the implementing object as Element. The given Document is used as factory and represents the owner document of the returned DOM element.
      Specified by:
      toXml in interface XmlSerializable
      Parameters:
      document -
      Returns:
      a w3c element representing this object
      See Also:
    • createFromXml

      public static Position createFromXml(Element positionElement)
      Create a new 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 >
       
      Parameters:
      positionElement - Xml element defining the position.
      Throws:
      IllegalArgumentException - if the given Xml element is not valid.