de.init.its.ds
Class ItsTagElement

java.lang.Object
  extended by de.init.its.ds.ItsTagElement
All Implemented Interfaces:
IitsTagElement, java.io.Serializable

public class ItsTagElement
extends java.lang.Object
implements IitsTagElement

This class represents an ITS node. Each node has a number of its attributes. each attribute contains the local ITS attribute and its value.

Author:
mkandora
See Also:
Serialized Form

Constructor Summary
ItsTagElement()
           
 
Method Summary
 void addAllAttributes(java.util.Collection<IitsAttribute> attributes)
          Adds all attributes to this ITS tag Element
 void addAttribute(IitsAttribute itsAttribute)
          adds an its attribute to the element
 void addAttribute(ItsAttributes dcname, java.lang.String dcvalue)
          adds an its attribute to the element
 void addAttribute(java.lang.String dcname, java.lang.String dcvalue)
          adds an its attribute to the element
 void addChild(IitsTagElement element)
          Adds an IITagsElement to this element
 java.util.List<IitsAttribute> getAttributes()
          Returns a list of all its attributes
 java.util.List<IitsTagElement> getChildren()
          Returns all child its tag elements, if any
 IitsId getId()
          Returns the id of this element
 IitsTagElement getLastChild()
          returns the last inserted child from this element
 IitsTagElement getNextChild()
          returns the next IitsTagElement
 IitsTagElement getParentElement()
          returns the parent element
 boolean hasChildren()
          Returns if this Element has any child nodes
 boolean hasMoreChildren()
          returns true if there are more child elements available
 boolean hasParent()
          Returns true if this element has a parent element
 boolean isEmpty()
          Returns true, if this element is an orphan (has no parent nor children nor any values)
 boolean isParent()
          returns true if this element is parent
 boolean isRoot()
          Returns true if this tag element is the root element (eg. is parent and has no parent element)
 void removeChild(IitsTagElement child)
          Removes a child from this branch.
 java.util.Map<ItsAttributes,java.util.List<java.lang.String>> renderAttributes()
          Convenience method to render all attributes as map
 void reset()
          resets the iterator
 void setId(IitsId id)
          Sets the id of this its element
 void setParent(boolean parent)
          set this element as parent
 void setParentElement(IitsTagElement e)
          Sets the ItsTageElements parent
 java.lang.String toString()
           
 void update(java.util.Map<ItsAttributes,java.util.List<java.lang.String>> values)
          Updates this elements values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItsTagElement

public ItsTagElement()
Method Detail

addChild

public void addChild(IitsTagElement element)
Description copied from interface: IitsTagElement
Adds an IITagsElement to this element

Specified by:
addChild in interface IitsTagElement

removeChild

public void removeChild(IitsTagElement child)
Description copied from interface: IitsTagElement
Removes a child from this branch. No further operation is done here eg. all children will NOT be moved one level up.

Specified by:
removeChild in interface IitsTagElement

getChildren

public java.util.List<IitsTagElement> getChildren()
Description copied from interface: IitsTagElement
Returns all child its tag elements, if any

Specified by:
getChildren in interface IitsTagElement
Returns:

hasChildren

public boolean hasChildren()
Description copied from interface: IitsTagElement
Returns if this Element has any child nodes

Specified by:
hasChildren in interface IitsTagElement
Returns:

getId

public IitsId getId()
Description copied from interface: IitsTagElement
Returns the id of this element

Specified by:
getId in interface IitsTagElement
Returns:

setId

public void setId(IitsId id)
Description copied from interface: IitsTagElement
Sets the id of this its element

Specified by:
setId in interface IitsTagElement

getNextChild

public IitsTagElement getNextChild()
Description copied from interface: IitsTagElement
returns the next IitsTagElement

Specified by:
getNextChild in interface IitsTagElement
Returns:

hasMoreChildren

public boolean hasMoreChildren()
Description copied from interface: IitsTagElement
returns true if there are more child elements available

Specified by:
hasMoreChildren in interface IitsTagElement
Returns:

getParentElement

public IitsTagElement getParentElement()
Description copied from interface: IitsTagElement
returns the parent element

Specified by:
getParentElement in interface IitsTagElement
Returns:

setParentElement

public void setParentElement(IitsTagElement e)
Description copied from interface: IitsTagElement
Sets the ItsTageElements parent

Specified by:
setParentElement in interface IitsTagElement

isParent

public boolean isParent()
Description copied from interface: IitsTagElement
returns true if this element is parent

Specified by:
isParent in interface IitsTagElement
Returns:

setParent

public void setParent(boolean parent)
Description copied from interface: IitsTagElement
set this element as parent

Specified by:
setParent in interface IitsTagElement

getAttributes

public java.util.List<IitsAttribute> getAttributes()
Description copied from interface: IitsTagElement
Returns a list of all its attributes

Specified by:
getAttributes in interface IitsTagElement
Returns:

renderAttributes

public java.util.Map<ItsAttributes,java.util.List<java.lang.String>> renderAttributes()
Description copied from interface: IitsTagElement
Convenience method to render all attributes as map

Specified by:
renderAttributes in interface IitsTagElement
Returns:

addAttribute

public void addAttribute(IitsAttribute itsAttribute)
Description copied from interface: IitsTagElement
adds an its attribute to the element

Specified by:
addAttribute in interface IitsTagElement

addAttribute

public void addAttribute(java.lang.String dcname,
                         java.lang.String dcvalue)
Description copied from interface: IitsTagElement
adds an its attribute to the element

Specified by:
addAttribute in interface IitsTagElement
Parameters:
dcname - the name of the data category attribute
dcvalue - the value of the data category attribute

addAttribute

public void addAttribute(ItsAttributes dcname,
                         java.lang.String dcvalue)
Description copied from interface: IitsTagElement
adds an its attribute to the element

Specified by:
addAttribute in interface IitsTagElement
Parameters:
dcname - the name of the data category attribute
dcvalue - the value of the data category attribute

getLastChild

public IitsTagElement getLastChild()
Description copied from interface: IitsTagElement
returns the last inserted child from this element

Specified by:
getLastChild in interface IitsTagElement
Returns:
IitsTagElement

addAllAttributes

public void addAllAttributes(java.util.Collection<IitsAttribute> attributes)
Description copied from interface: IitsTagElement
Adds all attributes to this ITS tag Element

Specified by:
addAllAttributes in interface IitsTagElement
Parameters:
attributes - a collection of IitsAttribute

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRoot

public boolean isRoot()
Description copied from interface: IitsTagElement
Returns true if this tag element is the root element (eg. is parent and has no parent element)

Specified by:
isRoot in interface IitsTagElement
Returns:
true if element is root element

hasParent

public boolean hasParent()
Description copied from interface: IitsTagElement
Returns true if this element has a parent element

Specified by:
hasParent in interface IitsTagElement
Returns:
true, if element has parent

isEmpty

public boolean isEmpty()
Description copied from interface: IitsTagElement
Returns true, if this element is an orphan (has no parent nor children nor any values)

Specified by:
isEmpty in interface IitsTagElement
Returns:

reset

public void reset()
Description copied from interface: IitsTagElement
resets the iterator

Specified by:
reset in interface IitsTagElement

update

public void update(java.util.Map<ItsAttributes,java.util.List<java.lang.String>> values)
Description copied from interface: IitsTagElement
Updates this elements values

Specified by:
update in interface IitsTagElement