public interface Data
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.
|
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?
|
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) |
void |
write(Appendable out,
int indent)
Write out the String representation of this HDF node.
|
String getName()
String getValue()
int getIntValue()
boolean getBooleanValue()
void setValue(String value)
String getFullPath()
void setAttribute(String key, String value)
key
- the name of the attribute to add/modify.value
- the value to assign it. Value of null
will clear the attribute.String getAttribute(String key)
null
if there is no
value.boolean hasAttribute(String key)
true
if the node contains an attribute with the given name, false
otherwise.int getAttributeCount()
Iterable<Map.Entry<String,String>> getAttributes()
Data getRoot()
Data getParent()
boolean isFirstSibling()
boolean isLastSibling()
Data getNextSibling()
null
if this is the last sibling.int getChildCount()
Data getChild(String path)
Data createChild(String path)
void removeTree(String path)
void setSymlink(String sourcePath, String destinationPath)
void setSymlink(String sourcePath, Data destination)
void setSymlink(Data symLink)
Data getSymlink()
void copy(String toPath, Data from)
toPath
- destination path for the deep copy.from
- Data object that should be copied over.void copy(Data from)
from
- Data object whose value should be copied over.String getValue(String path, String defaultValue)
int getIntValue(String path, int defaultValue)
String getValue(String path)
int getIntValue(String path)
boolean getBooleanValue(String path)
void setValue(String path, String value)
void toString(StringBuilder out, int indent)
void write(Appendable out, int indent) throws IOException
IOException
void optimize()
EscapeMode getEscapeMode()
EscapeMode.ESCAPE_NONE
if the
value is not escaped. EscapeMode.ESCAPE_IS_CONSTANT
if value is a string or
numeric literal.setEscapeMode(com.google.clearsilver.jsilver.autoescape.EscapeMode)
,
EscapeMode
void setEscapeMode(EscapeMode mode)
getEscapeMode()
Copyright © 2010–2016 Google. All rights reserved.