|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.clearsilver.jsilver.data.DelegatedData
com.google.clearsilver.jsilver.data.ChainedData
public class ChainedData
Implementation of Data that allows for multiple underlying Data objects and checks each one in order for a value before giving up. Behaves like local HDF and global HDF in the JNI implementation of Clearsilver. This is only meant to be a root Data object and hardcodes that fact.
Note: If you have elements foo.1, foo.2, foo.3 in first Data object and foo.4, foo.5, foo.6 in second Data object, then fetching children of foo will return only foo.1 foo.2 foo.3 from first Data object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.clearsilver.jsilver.data.DelegatedData |
---|
DelegatedData.DelegatedIterator |
Field Summary | |
---|---|
static boolean |
DEBUG_MULTIPLE_ASSIGNMENTS
|
static Logger |
logger
|
Constructor Summary | |
---|---|
ChainedData(Data... dataList)
|
|
ChainedData(Data data)
Optmization for case of single item. |
|
ChainedData(List<Data> dataList)
|
Method Summary | |
---|---|
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 |
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 |
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 |
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. |
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 |
toString(StringBuilder out,
int indent)
|
void |
write(Appendable out,
int indent)
Write out the String representation of this HDF node. |
Methods inherited from class com.google.clearsilver.jsilver.data.DelegatedData |
---|
copy, copy, getAttribute, getAttributeCount, getAttributes, getBooleanValue, getChildCount, getChildren, getDelegate, getEscapeMode, getFullPath, getIntValue, getName, getNextSibling, getParent, getRoot, getSymlink, getValue, hasAttribute, isFirstSibling, isLastSibling, newChildIterator, removeTree, setAttribute, setEscapeMode, setSymlink, setSymlink, setSymlink, setValue, setValue, toString, unwrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Logger logger
public static final boolean DEBUG_MULTIPLE_ASSIGNMENTS
Constructor Detail |
---|
public ChainedData(Data data)
data
- a single data object to wrap.public ChainedData(Data... dataList)
public ChainedData(List<Data> dataList)
Method Detail |
---|
protected DelegatedData newInstance(Data newDelegate)
DelegatedData
newInstance
in class DelegatedData
newDelegate
- the Data object to wrap with a new delegator
public Data getChild(String path)
Data
getChild
in interface Data
getChild
in class DelegatedData
public Data createChild(String path)
Data
createChild
in interface Data
createChild
in class DelegatedData
public String getValue(String path, String defaultValue)
Data
getValue
in interface Data
getValue
in class DelegatedData
public int getIntValue(String path, int defaultValue)
Data
getIntValue
in interface Data
getIntValue
in class DelegatedData
public String getValue(String path)
Data
getValue
in interface Data
getValue
in class DelegatedData
public int getIntValue(String path)
Data
getIntValue
in interface Data
getIntValue
in class DelegatedData
public boolean getBooleanValue(String path)
Data
getBooleanValue
in interface Data
getBooleanValue
in class DelegatedData
public void toString(StringBuilder out, int indent)
toString
in interface Data
toString
in class DelegatedData
public void write(Appendable out, int indent) throws IOException
Data
write
in interface Data
write
in class DelegatedData
IOException
public void optimize()
Data
optimize
in interface Data
optimize
in class DelegatedData
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |