com.xefer.rebel
Class XBELElement

java.lang.Object
  |
  +--com.xefer.rebel.XBELElement
Direct Known Subclasses:
XBELBookmark, XBELDocument, XBELFolder, XBELGenericElement

abstract class XBELElement
extends Object

The base class of all XBEL elements


Field Summary
(package private)  Element element
           
 
Constructor Summary
protected XBELElement()
           
  XBELElement(Element element)
           
 
Method Summary
protected  void addChild(XBELElement entity)
          Replace the current resource with the given entity
protected  void addChildDirect(XBELElement entity)
          Replace the current resource with the given entity without first importing it into the parent elements document
 void delete()
          Delete removes self from parent
 String getId()
          Gets the id attribute of the underlying XBEL element
abstract  String getLocationUrl(StringBuffer url)
          Returns the resource Location URL based on the current url and the resource type
 String getType()
          Gets the tagname of the underlying XBEL element
abstract  boolean isLocatable()
          Returns true if this XBELElement is directly locatable through a URL.
 void post(XBELElement entity)
          Handles the POSTing of a subordinate resource
 void put(XBELElement entity)
          putResource
protected  void replaceChild(XBELElement entity, XBELElement child)
          Replace on child element with another
protected  void replaceSelf(XBELElement entity)
          Replace the given child with the given entity
 void setId(String id)
          Sets the id attribute of the underlying XBEL element
 void write(ServletContext context, OutputStream stream)
          Write out the element ot the given output stream
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

element

Element element
Constructor Detail

XBELElement

protected XBELElement()

XBELElement

public XBELElement(Element element)
Method Detail

addChild

protected void addChild(XBELElement entity)
Replace the current resource with the given entity
Parameters:
child - XBELElement of the new child

addChildDirect

protected void addChildDirect(XBELElement entity)
Replace the current resource with the given entity without first importing it into the parent elements document
Parameters:
child - XBELElement of the new child

delete

public void delete()
            throws ResourceException
Delete removes self from parent
Returns:
void

getId

public String getId()
Gets the id attribute of the underlying XBEL element
Returns:
String the id of the given element

getLocationUrl

public abstract String getLocationUrl(StringBuffer url)
Returns the resource Location URL based on the current url and the resource type

getType

public String getType()
Gets the tagname of the underlying XBEL element
Returns:
String the tag name of the given element

isLocatable

public abstract boolean isLocatable()
Returns true if this XBELElement is directly locatable through a URL. F

post

public void post(XBELElement entity)
          throws ResourceException
Handles the POSTing of a subordinate resource
Parameters:
entity - XBELElement the entity to be posted
Returns:
void

put

public void put(XBELElement entity)
         throws ResourceException
putResource
Parameters:
entity - XBELElement the entity to store
Returns:
void

replaceChild

protected void replaceChild(XBELElement entity,
                            XBELElement child)
Replace on child element with another
Parameters:
entity - XBELElement of the old child
child - XBELElement of the new child

replaceSelf

protected void replaceSelf(XBELElement entity)
Replace the given child with the given entity
Parameters:
entity - XBELElement to replace the current element

setId

public void setId(String id)
Sets the id attribute of the underlying XBEL element
Parameters:
String - the id of the given element being updated

write

public void write(ServletContext context,
                  OutputStream stream)
           throws ResourceException
Write out the element ot the given output stream
Parameters:
context - ServletContext that this process is executing in
stream - OutputStream of the to be written to