org.exoplatform.common.util
Class HierarchicalProperty

java.lang.Object
  extended by org.exoplatform.common.util.HierarchicalProperty

public class HierarchicalProperty
extends java.lang.Object

Created by The eXo Platform SAS .
DOM - like (but lighter) property representation

Version:
$Id: $
Author:
Gennady Azarenkov

Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.String> attributes
           
protected  java.util.List<HierarchicalProperty> children
          Child properties.
protected  javax.xml.namespace.QName name
          Property name.
protected  java.lang.String value
          Property value.
 
Constructor Summary
HierarchicalProperty(javax.xml.namespace.QName name)
          Shortcut for XMLProperty(name, null).
HierarchicalProperty(javax.xml.namespace.QName name, java.util.Calendar dateValue, java.lang.String formatPattern)
           
HierarchicalProperty(javax.xml.namespace.QName name, java.lang.String value)
           
HierarchicalProperty(java.lang.String name, java.lang.String value, java.lang.String namespaceURI)
          Constructor accepting String as property name, both prefixed (i.e.
 
Method Summary
 HierarchicalProperty addChild(HierarchicalProperty prop)
          Adds prop as a children to this property.
 java.lang.String getAttribute(java.lang.String attributeName)
           
 java.util.HashMap<java.lang.String,java.lang.String> getAttributes()
           
 HierarchicalProperty getChild(int index)
          Retrieves child property by 0 based index.
 HierarchicalProperty getChild(javax.xml.namespace.QName name)
          Retrieves child property by name.
 java.util.List<HierarchicalProperty> getChildren()
           
 javax.xml.namespace.QName getName()
           
 java.lang.String getStringName()
           
 java.lang.String getValue()
           
 void setAttribute(javax.xml.namespace.QName attributeName, java.lang.String attributeValue)
          sets the attribute
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          sets the attribute
 void setValue(java.lang.String value)
          sets the property value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.List<HierarchicalProperty> children
Child properties.


name

protected javax.xml.namespace.QName name
Property name.


value

protected java.lang.String value
Property value.


attributes

protected java.util.HashMap<java.lang.String,java.lang.String> attributes
Constructor Detail

HierarchicalProperty

public HierarchicalProperty(java.lang.String name,
                            java.lang.String value,
                            java.lang.String namespaceURI)
Constructor accepting String as property name, both prefixed (i.e. prefix:local) and not (i.e. local) are accepted

Parameters:
name - property name
value - property value (can be null)

HierarchicalProperty

public HierarchicalProperty(javax.xml.namespace.QName name,
                            java.lang.String value)
Parameters:
name -
value -

HierarchicalProperty

public HierarchicalProperty(javax.xml.namespace.QName name,
                            java.util.Calendar dateValue,
                            java.lang.String formatPattern)
Parameters:
name -
dateValue -
formatPattern -

HierarchicalProperty

public HierarchicalProperty(javax.xml.namespace.QName name)
Shortcut for XMLProperty(name, null).

Parameters:
name -
Method Detail

addChild

public HierarchicalProperty addChild(HierarchicalProperty prop)
Adds prop as a children to this property.

Parameters:
prop -
Returns:
added property

getChildren

public java.util.List<HierarchicalProperty> getChildren()
Returns:
child properties of this property

getChild

public HierarchicalProperty getChild(javax.xml.namespace.QName name)
Retrieves child property by name.

Parameters:
name -
Returns:
property or null if not found

getChild

public HierarchicalProperty getChild(int index)
Retrieves child property by 0 based index.

Parameters:
index -
Returns:

getName

public javax.xml.namespace.QName getName()
Returns:
property name

getValue

public java.lang.String getValue()
Returns:
property value

setValue

public void setValue(java.lang.String value)
sets the property value

Parameters:
value -

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
sets the attribute

Parameters:
attributeName -
attributeValue -

setAttribute

public void setAttribute(javax.xml.namespace.QName attributeName,
                         java.lang.String attributeValue)
sets the attribute

Parameters:
attributeName -
attributeValue -

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
Parameters:
attributeName -
Returns:
attribute

getAttributes

public java.util.HashMap<java.lang.String,java.lang.String> getAttributes()
Returns:
all attributes

getStringName

public java.lang.String getStringName()
Returns:
name as string prefix:localPart


Copyright © 2010 eXo Platform SAS. All Rights Reserved.