org.treebind
Interface Property

All Known Implementing Classes:
ComplexProperty, DefaultPropertyImplementation, LeafProperty

public interface Property

Properties are one of the key components of the TreeBind data model. In streaming mode, they don't appear explictely but are implicitely exposed through Sink.startProperty(Name, Name), Sink.endProperty() and Sink.addLeaf(Name, Name, Object) methods. TreeBind properties can be either LeafProperty or ComplexProperty.

Author:
Eric van der Vlist
See Also:
LeafProperty, ComplexProperty

Method Summary
 void addProperty(int position, Property property)
          Add a sub property at a specific position (for ComplexProperty only.
 void addProperty(Property property)
          Add a sub property (for ComplexProperty only.
 Name getNature()
          Get the nature of the property.
 java.util.Iterator getProperties()
          Get the subproperties of a property (for ComplexProperty only.
 java.util.Iterator getPropertiesWithNature(Name nature)
          Get the subproperties of a property with a specific nature (for ComplexProperty only.
 java.util.Iterator getPropertiesWithRole(Name role)
          Get the subproperties of a property with a specific role (for ComplexProperty only.
 java.util.Iterator getPropertiesWithRoleAndNature(Name role, Name nature)
          Get the subproperties of a property with a specific nature and a specific role (for ComplexProperty only.
 Name getRole()
          Get the role of a property.
 java.lang.Object getValue()
          Get the value of the property (for LeafProperty only).
 int nbProperties()
          Get the number of sub properties (for ComplexProperty only.
 void setNature(Name nature)
          Sets the nature of the property.
 void setRole(Name role)
          Sets the role of a property.
 void setValue(java.lang.Object value)
          Sets the value of a propety (for LeafProperty only).
 

Method Detail

addProperty

public void addProperty(int position,
                        Property property)
                 throws NotImplementedException
Add a sub property at a specific position (for ComplexProperty only.

Parameters:
property - the sub property
Throws:
NotImplementedException - when a property is added to a LeafProperty

addProperty

public void addProperty(Property property)
                 throws NotImplementedException
Add a sub property (for ComplexProperty only.

Parameters:
property - the sub property
Throws:
NotImplementedException - when a property is added to a LeafProperty

getNature

public Name getNature()
Get the nature of the property.

Returns:
the natuure

getProperties

public java.util.Iterator getProperties()
Get the subproperties of a property (for ComplexProperty only.

Returns:
an iterator over the sub properties.

getPropertiesWithNature

public java.util.Iterator getPropertiesWithNature(Name nature)
Get the subproperties of a property with a specific nature (for ComplexProperty only.

Returns:
an iterator over the sub properties.

getPropertiesWithRole

public java.util.Iterator getPropertiesWithRole(Name role)
Get the subproperties of a property with a specific role (for ComplexProperty only.

Returns:
an iterator over the sub properties.

getPropertiesWithRoleAndNature

public java.util.Iterator getPropertiesWithRoleAndNature(Name role,
                                                         Name nature)
Get the subproperties of a property with a specific nature and a specific role (for ComplexProperty only.

Returns:
an iterator over the sub properties.

getRole

public Name getRole()
Get the role of a property.

Returns:
the role

getValue

public java.lang.Object getValue()
Get the value of the property (for LeafProperty only).

Returns:
the value

nbProperties

public int nbProperties()
Get the number of sub properties (for ComplexProperty only.

Returns:
the number of sub properties

setNature

public void setNature(Name nature)
Sets the nature of the property.

Parameters:
nature - the nature

setRole

public void setRole(Name role)
Sets the role of a property.

Parameters:
role - the role

setValue

public void setValue(java.lang.Object value)
              throws NotImplementedException
Sets the value of a propety (for LeafProperty only).

Parameters:
value - the value
Throws:
NotImplementedException - when a value is set on a ComplexProperty