Class OrderPatch
- java.lang.Object
-
- org.apache.jackrabbit.webdav.ordering.OrderPatch
-
- All Implemented Interfaces:
OrderingConstants
,XmlSerializable
public class OrderPatch extends java.lang.Object implements OrderingConstants, XmlSerializable
OrderPatch
represents the mandatory request body of an ORDERPATCH request. RFC 3648 defines the following structure for it:
<!ELEMENT orderpatch (ordering-type?, order-member*) > <!ELEMENT order-member (segment, position) > <!ELEMENT position (first | last | before | after) > <!ELEMENT segment (#PCDATA) > <!ELEMENT first EMPTY > <!ELEMENT last EMPTY > <!ELEMENT before segment > <!ELEMENT after segment >
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OrderPatch.Member
Internal classMember
represents the 'Order-Member' children elements of an 'OrderPatch' request body present in the ORDERPATCH request.
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.webdav.ordering.OrderingConstants
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 Summary
Constructors Constructor Description OrderPatch(java.lang.String orderingType, OrderPatch.Member instruction)
Create a newOrderPath
object.OrderPatch(java.lang.String orderingType, OrderPatch.Member[] instructions)
Create a newOrderPath
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OrderPatch
createFromXml(org.w3c.dom.Element orderPatchElement)
Create a newOrderPath
object.java.lang.String
getOrderingType()
Return the ordering type.OrderPatch.Member[]
getOrderInstructions()
Return an array ofOrderPatch.Member
objects defining the re-ordering instructions to be applied to the requested resource.org.w3c.dom.Element
toXml(org.w3c.dom.Document document)
Returns the xml representation of the implementing object asElement
.
-
-
-
Constructor Detail
-
OrderPatch
public OrderPatch(java.lang.String orderingType, OrderPatch.Member instruction)
Create a newOrderPath
object.- Parameters:
orderingType
-instruction
-
-
OrderPatch
public OrderPatch(java.lang.String orderingType, OrderPatch.Member[] instructions)
Create a newOrderPath
object.- Parameters:
orderingType
-instructions
-
-
-
Method Detail
-
getOrderingType
public java.lang.String getOrderingType()
Return the ordering type.- Returns:
- ordering type
-
getOrderInstructions
public OrderPatch.Member[] getOrderInstructions()
Return an array ofOrderPatch.Member
objects defining the re-ordering instructions to be applied to the requested resource.- Returns:
- ordering instructions.
-
toXml
public org.w3c.dom.Element toXml(org.w3c.dom.Document document)
Description copied from interface:XmlSerializable
Returns the xml representation of the implementing object asElement
. The givenDocument
is used as factory and represents theowner document
of the returned DOM element.- Specified by:
toXml
in interfaceXmlSerializable
- Parameters:
document
-- Returns:
-
createFromXml
public static OrderPatch createFromXml(org.w3c.dom.Element orderPatchElement) throws DavException
Create a newOrderPath
object.- Parameters:
orderPatchElement
-- Throws:
java.lang.IllegalArgumentException
- if the specified Xml element was not valid.DavException
-
-