public class DelegatedData extends Object implements Data
| Modifier and Type | Class and Description |
|---|---|
protected class |
DelegatedData.DelegatedIterator
Wrapping implementation of iterator that makes sure any Data object returned by the underlying
iterator is wrapped with the right DelegatedData type.
|
| Constructor and Description |
|---|
DelegatedData(Data delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(Data from)
Does a deep copy the attributes and values from one node to another
|
void |
copy(String toPath,
Data from)
Does a deep copy of the attributes and values from one node to another.
|
Data |
createChild(String path)
Retrieves the HDF object that is the root of the subtree at hdfpath, create the subtree if it
doesn't exist
|
String |
getAttribute(String key)
Returns the value of the node attribute with the given name, or
null if there is no
value. |
int |
getAttributeCount()
Returns the number of attributes on this node.
|
Iterable<Map.Entry<String,String>> |
getAttributes()
Returns an iterable collection of attribute name/value pairs.
|
boolean |
getBooleanValue()
Returns the boolean value of this HDF node, or false if this node has no value.
|
boolean |
getBooleanValue(String path)
Retrieves the value at the specified path in this HDF node's subtree.
|
Data |
getChild(String path)
Retrieves the object that is the root of the subtree at hdfpath, returning null if the subtree
doesn't exist
|
int |
getChildCount()
Returns number of child nodes.
|
Iterable<? extends Data> |
getChildren()
Returns children of this node.
|
protected Data |
getDelegate() |
EscapeMode |
getEscapeMode()
Indicates the escaping, if any that was applied to this HDF node.
|
String |
getFullPath()
Returns the full path to this node via its parent links.
|
int |
getIntValue()
Returns the integer value of this HDF node, or 0 if this node has no value.
|
int |
getIntValue(String path)
Retrieves the value at the specified path in this HDF node's subtree.
|
int |
getIntValue(String path,
int defaultValue)
Retrieves the integer value at the specified path in this HDF node's subtree.
|
String |
getName()
Returns the name of this HDF node.
|
Data |
getNextSibling()
Retrieves the node representing the next sibling of this Data node, if any.
|
Data |
getParent()
Get the parent node.
|
Data |
getRoot()
Return the root of the tree where the current node lies.
|
Data |
getSymlink()
Retrieve the symbolic link this node points to.
|
String |
getValue()
Returns the value of this HDF node, or null if this node has no value.
|
String |
getValue(String path)
Retrieves the value at the specified path in this HDF node's subtree.
|
String |
getValue(String path,
String defaultValue)
Retrieves the value at the specified path in this HDF node's subtree.
|
boolean |
hasAttribute(String key)
Returns
true if the node contains an attribute with the given name, false
otherwise. |
boolean |
isFirstSibling()
Is this the first of its siblings?
|
boolean |
isLastSibling()
Is this the last of its siblings?
|
protected Iterator<DelegatedData> |
newChildIterator()
Subclasses can override this method to return specialized child iterators.
|
protected DelegatedData |
newInstance(Data newDelegate)
Subclasses will want to override this method to return a Data object of their specific type.
|
void |
optimize()
Optimizes the Data structure for performance.
|
void |
removeTree(String path)
Remove the specified subtree.
|
void |
setAttribute(String key,
String value)
Sets an attribute key and value on the current node, replacing any existing value.
|
void |
setEscapeMode(EscapeMode mode)
Set the escaping that was applied to this HDF node.
|
void |
setSymlink(Data symLink)
Set this node to be a symbolic link to another node.
|
void |
setSymlink(String sourcePath,
Data destination)
Set the source node to be a symbolic link to the destination.
|
void |
setSymlink(String sourcePath,
String destinationPath)
Set the source node to be a symbolic link to the destination.
|
void |
setValue(String value)
Set the value of this node.
|
void |
setValue(String path,
String value)
Sets the value at the specified path in this HDF node's subtree.
|
String |
toString() |
void |
toString(StringBuilder out,
int indent) |
protected static Data |
unwrap(Data data) |
void |
write(Appendable out,
int indent)
Write out the String representation of this HDF node.
|
public DelegatedData(Data delegate)
protected DelegatedData newInstance(Data newDelegate)
newDelegate - the Data object to wrap with a new delegatorprotected Data getDelegate()
public String getName()
Datapublic String getValue()
Datapublic int getIntValue()
DatagetIntValue in interface Datapublic boolean getBooleanValue()
DatagetBooleanValue in interface Datapublic void setValue(String value)
Datapublic String getFullPath()
DatagetFullPath in interface Datapublic void setAttribute(String key, String value)
DatasetAttribute in interface Datakey - the name of the attribute to add/modify.value - the value to assign it. Value of null will clear the attribute.public String getAttribute(String key)
Datanull if there is no
value.getAttribute in interface Datapublic boolean hasAttribute(String key)
Datatrue if the node contains an attribute with the given name, false
otherwise.hasAttribute in interface Datapublic int getAttributeCount()
DatagetAttributeCount in interface Datapublic Iterable<Map.Entry<String,String>> getAttributes()
DatagetAttributes in interface Datapublic Data getRoot()
Datapublic boolean isFirstSibling()
DataisFirstSibling in interface Datapublic boolean isLastSibling()
DataisLastSibling in interface Datapublic Data getNextSibling()
DatagetNextSibling in interface Datanull if this is the last sibling.public int getChildCount()
DatagetChildCount in interface Dataprotected Iterator<DelegatedData> newChildIterator()
public Iterable<? extends Data> getChildren()
DatagetChildren in interface Datapublic Data getChild(String path)
Datapublic Data createChild(String path)
DatacreateChild in interface Datapublic void removeTree(String path)
DataremoveTree in interface Datapublic void setSymlink(String sourcePath, String destinationPath)
DatasetSymlink in interface Datapublic void setSymlink(String sourcePath, Data destination)
DatasetSymlink in interface Datapublic void setSymlink(Data symLink)
DatasetSymlink in interface Datapublic Data getSymlink()
DatagetSymlink in interface Datapublic void copy(String toPath, Data from)
Datapublic void copy(Data from)
Datapublic String getValue(String path, String defaultValue)
Datapublic int getIntValue(String path, int defaultValue)
DatagetIntValue in interface Datapublic String getValue(String path)
Datapublic int getIntValue(String path)
DatagetIntValue in interface Datapublic boolean getBooleanValue(String path)
DatagetBooleanValue in interface Datapublic void setValue(String path, String value)
Datapublic String toString()
public void toString(StringBuilder out, int indent)
public void write(Appendable out, int indent) throws IOException
Datawrite in interface DataIOExceptionpublic void optimize()
Datapublic void setEscapeMode(EscapeMode mode)
DatasetEscapeMode in interface DataData.getEscapeMode()public EscapeMode getEscapeMode()
DatagetEscapeMode in interface DataEscapeMode.ESCAPE_NONE if the
value is not escaped. EscapeMode.ESCAPE_IS_CONSTANT if value is a string or
numeric literal.Data.setEscapeMode(com.google.clearsilver.jsilver.autoescape.EscapeMode),
EscapeModeCopyright © 2010–2015 Google. All rights reserved.