Package org.exoplatform.common.util
Class HierarchicalProperty
- java.lang.Object
-
- org.exoplatform.common.util.HierarchicalProperty
-
public class HierarchicalProperty extends Object
Created by The eXo Platform SAS .
DOM - like (but lighter) property representation- Version:
- $Id: $
- Author:
- Gennady Azarenkov
-
-
Constructor Summary
Constructors Constructor Description HierarchicalProperty(String name, String value, String namespaceURI)Constructor accepting String as property name, both prefixed (i.e.HierarchicalProperty(QName name)Shortcut for XMLProperty(name, null).HierarchicalProperty(QName name, String value)HierarchicalProperty(QName name, Calendar dateValue, String formatPattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HierarchicalPropertyaddChild(HierarchicalProperty prop)Adds prop as a children to this property.StringgetAttribute(String attributeName)HashMap<String,String>getAttributes()HierarchicalPropertygetChild(int index)Retrieves child property by 0 based index.HierarchicalPropertygetChild(QName name)Retrieves child property by name.List<HierarchicalProperty>getChildren()QNamegetName()StringgetStringName()StringgetValue()voidsetAttribute(String attributeName, String attributeValue)sets the attributevoidsetAttribute(QName attributeName, String attributeValue)sets the attributevoidsetValue(String value)sets the property value
-
-
-
Constructor Detail
-
HierarchicalProperty
public HierarchicalProperty(String name, String value, String namespaceURI)
Constructor accepting String as property name, both prefixed (i.e. prefix:local) and not (i.e. local) are accepted- Parameters:
name- property namevalue- property value (can be null)
-
HierarchicalProperty
public HierarchicalProperty(QName name, String value)
- Parameters:
name-value-
-
HierarchicalProperty
public HierarchicalProperty(QName name, Calendar dateValue, String formatPattern)
- Parameters:
name-dateValue-formatPattern-
-
HierarchicalProperty
public HierarchicalProperty(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 List<HierarchicalProperty> getChildren()
- Returns:
- child properties of this property
-
getChild
public HierarchicalProperty getChild(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 QName getName()
- Returns:
- property name
-
getValue
public String getValue()
- Returns:
- property value
-
setValue
public void setValue(String value)
sets the property value- Parameters:
value-
-
setAttribute
public void setAttribute(String attributeName, String attributeValue)
sets the attribute- Parameters:
attributeName-attributeValue-
-
setAttribute
public void setAttribute(QName attributeName, String attributeValue)
sets the attribute- Parameters:
attributeName-attributeValue-
-
getAttribute
public String getAttribute(String attributeName)
- Parameters:
attributeName-- Returns:
- attribute
-
getStringName
public String getStringName()
- Returns:
- name as string prefix:localPart
-
-