things.data
Interface ThingsPropertyView

All Superinterfaces:
ThingsProperty, ThingsPropertyViewReader
All Known Implementing Classes:
ThingsPropertyTreeBASIC, ThingsPropertyTreeRAM

public interface ThingsPropertyView
extends ThingsPropertyViewReader

The basic property view.

Version:
1.0

Version History

EPG - Initial - 16 MAY 04
 
Author:
Erich P. Gatejen

Field Summary
 
Fields inherited from interface things.data.ThingsProperty
PROPERTY_COMMENT_CHARACTER, PROPERTY_CR, PROPERTY_EMPTY, PROPERTY_ESCAPE_CHARACTER, PROPERTY_ESCAPED_CR, PROPERTY_ESCAPED_LF, PROPERTY_LF, PROPERTY_LINE_CONTINUATION, PROPERTY_LINE_CONTINUATION_STRING, PROPERTY_LINE_EQUALITY, PROPERTY_LINE_SEPARATOR, PROPERTY_LINE_SEPARATOR_ASSTRING, PROPERTY_LINE_TERMINATION, PROPERTY_PATH_SEPARATOR
 
Method Summary
 ThingsPropertyView cutting(java.lang.String path)
          A cutting to get a new a new view.
 void graft(ThingsPropertyView sourceView)
          Graft one view onto this view.
 void prune(java.lang.String path)
          Prune off the path.
 void removeProperty(java.lang.String path)
          Remove a specific property without subverting a tree.
 void save()
          Ask the underlying tree to save itself.
 void setProperty(NVImmutable item)
          Set a property value from an NVImmutable item.
 void setProperty(java.lang.String path, java.lang.String value)
          Set a property value as a string.
 void setProperty(java.lang.String path, java.lang.String value, java.lang.String defaultValue)
          Set a property value as a string.
 void setPropertyMultivalue(java.lang.String path, java.lang.String... values)
          Set a property value as a multivalue.
 
Methods inherited from interface things.data.ThingsPropertyViewReader
branch, getProperty, getProperty, getPropertyMultivalue, getPropertyNV, ply, sub
 

Method Detail

setProperty

void setProperty(java.lang.String path,
                 java.lang.String value)
                 throws ThingsException
Set a property value as a string. The property will be from the root of the view.

Parameters:
path - the property path (relative to the view root)
value - the property value as a string
Throws:
ThingsException

setProperty

void setProperty(java.lang.String path,
                 java.lang.String value,
                 java.lang.String defaultValue)
                 throws ThingsException
Set a property value as a string. The property will be from the root of the view. If the value is null, it will set it as the defaultValue instead.

Parameters:
path - the property path (relative to the view root)
value - the property value as a string
defaultValue - the default value.
Throws:
ThingsException

setProperty

void setProperty(NVImmutable item)
                 throws ThingsException
Set a property value from an NVImmutable item. The property will be from the root of the view.

Parameters:
item - the item
Throws:
ThingsException
See Also:
NVImmutable

setPropertyMultivalue

void setPropertyMultivalue(java.lang.String path,
                           java.lang.String... values)
                           throws ThingsException
Set a property value as a multivalue. The property will be from the root of the view.

Parameters:
path - the property path (relative to the view root)
values - the property values as Strings.
Throws:
ThingsException

removeProperty

void removeProperty(java.lang.String path)
                    throws ThingsException
Remove a specific property without subverting a tree.

Parameters:
path - the property path (relative to the view root). A null or bogus path will be ignored.
Throws:
ThingsException

cutting

ThingsPropertyView cutting(java.lang.String path)
                           throws ThingsException
A cutting to get a new a new view. The new view will have the path as its root.

Parameters:
path - the property path (relative to the view root). A null is not allowed.
Returns:
The new view.
Throws:
ThingsException

prune

void prune(java.lang.String path)
           throws ThingsException
Prune off the path. Properties will be removed and gone forever.

Parameters:
path - the property path (relative to the view root). A null is not allowed.
Throws:
ThingsException

graft

void graft(ThingsPropertyView sourceView)
           throws ThingsException
Graft one view onto this view. All properties will be added. The values will be copies, so the original tree will be left unaltered.

Parameters:
sourceView - view to graft on.
Throws:
ThingsException

save

void save()
          throws ThingsException
Ask the underlying tree to save itself. NO GUARANTEE the implementation actually will.

Throws:
ThingsException


Things.