org.eclipse.webdav.dom
Class PropertyBehavior

java.lang.Object
  extended by org.eclipse.webdav.dom.ElementEditor
      extended by org.eclipse.webdav.dom.PropertyBehavior

public class PropertyBehavior
extends ElementEditor

An element editor for the WebDAV propertybehavior element. See RFC2518 section 12.12 for the element's definition.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Field Summary
protected static String[] childNames
          An ordered collection of the element names of the propertybehavior element's children.
static String[] fgNamesKeepAlive
          An ordered collection of the element names of the propertybehavior element's children in the "keep alive" form
static String[] fgNamesOmit
          An ordered collection of the element names of the propertybehavior element's children in the "omit" form
 
Fields inherited from class org.eclipse.webdav.dom.ElementEditor
DAV_NS, root, XML_NS_NAME, XML_NS_PREFIX, XML_PREFIX
 
Constructor Summary
PropertyBehavior(Element root)
          Creates a new editor on the given WebDAV propertybehavior element.
 
Method Summary
 void addProperty(String propertyHref)
          Adds the given property href to this propertybehavior's list of live properties.
static PropertyBehavior create(Document document)
          Creates a new WebDAV propertybehavior element and sets it as the root of the given document.
 Enumeration getProperties()
          Returns an Enumeration over this propertybehavior's property hrefs.
 boolean isKeepAllAlive()
          Returns true if this propertybehavior is in the "keep all alive" form, otherwise, returns false.
 boolean isOmit()
          Returns true if this propertybehavior is in the "omit" form, otherwise, returns false.
 void setIsKeepAllAlive(boolean isKeepAllAlive)
          Sets whether this propertybehavior is in the "keep all alive" form or not.
 void setIsOmit(boolean isOmit)
          Sets whether this propertybehavior is in the "omit" form or not.
 
Methods inherited from class org.eclipse.webdav.dom.ElementEditor
addChild, addChild, addChild, appendChild, appendChild, cloneNode, create, declareNS, decodeHref, encodeHref, ensure, ensure, ensureDAVElement, ensureDAVElement, ensureNotNull, ensureNull, ensureText, extractElement, extractNode, getChild, getChildElement, getChildText, getDAVChild, getElement, getFirstChild, getFirstChild, getFirstText, getLastChild, getNamespaces, getNamespaces, getNextSibling, getNextSibling, getNextSibling, getNSLocalName, getNSLocalName, getNSName, getNSPrefix, getNSPrefix, getQualifiedName, getSibling, getText, getTwin, hasChild, insertBefore, insertBefore, isDAVElement, isDAVElement, isElement, isText, makeNSStandalone, reduceNS, reduceNS, resolve, setChild, setChild, setChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

childNames

protected static final String[] childNames
An ordered collection of the element names of the propertybehavior element's children.


fgNamesOmit

public static String[] fgNamesOmit
An ordered collection of the element names of the propertybehavior element's children in the "omit" form


fgNamesKeepAlive

public static String[] fgNamesKeepAlive
An ordered collection of the element names of the propertybehavior element's children in the "keep alive" form

Constructor Detail

PropertyBehavior

public PropertyBehavior(Element root)
                 throws MalformedElementException
Creates a new editor on the given WebDAV propertybehavior element. The element is assumed to be well formed.

Parameters:
root - a propertybehavior element
Throws:
MalformedElementException - if there is reason to believe that the element is not well formed
Method Detail

addProperty

public void addProperty(String propertyHref)
Adds the given property href to this propertybehavior's list of live properties. The property href must not be null and the form of this property behavior must not already be omit or keepAllAlive.

Parameters:
propertyHref - the property href to add

create

public static PropertyBehavior create(Document document)
Creates a new WebDAV propertybehavior element and sets it as the root of the given document. Returns an editor on the new propertybehavior element. The document must not be null, and must not already have a root element.

Parameters:
document - the document that will become the root of a new propertybehavior element
Returns:
an element editor on a propertybehavior element

getProperties

public Enumeration getProperties()
                          throws MalformedElementException
Returns an Enumeration over this propertybehavior's property hrefs. The methods isMerge() and isKeepAllAlive return false if this propertybehavior is in the "keep some alive" form.

Returns:
an Enumeration of Strings
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed, or this propertybehavior is not in the "keep some alive" form
See Also:
isKeepAllAlive(), isOmit()

isKeepAllAlive

public boolean isKeepAllAlive()
                       throws MalformedElementException
Returns true if this propertybehavior is in the "keep all alive" form, otherwise, returns false.

Returns:
a boolean indicating whether this propertybehavior is in the "keep all alive" form or not
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

isOmit

public boolean isOmit()
               throws MalformedElementException
Returns true if this propertybehavior is in the "omit" form, otherwise, returns false.

Returns:
a boolean indicating whether this propertybehavior is in the "omit" form or not
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

setIsKeepAllAlive

public void setIsKeepAllAlive(boolean isKeepAllAlive)
Sets whether this propertybehavior is in the "keep all alive" form or not.

Parameters:
isKeepAllAlive - a boolean indicating whether this propertybehavior will be in the "keep all alive" form

setIsOmit

public void setIsOmit(boolean isOmit)
Sets whether this propertybehavior is in the "omit" form or not.

Parameters:
isOmit - a boolean indicating whether this propertybehavior will be in the "omit" form


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.