|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.clearsilver.jsilver.adaptor.JHdf
public class JHdf
Adaptor that wraps a JSilver Data object so it can be used as an HDF object.
Method Summary | |
---|---|
boolean |
belongsToSameRoot(HDF hdf)
Checks if the given hdf object belongs to the same root HDF object as this one. |
void |
close()
Clean up CS object state. |
void |
copy(String hdfpath,
HDF src)
Deep copy of the contents of the source HDF structure to this HDF starting at the specified HDF path node. |
String |
dump()
Generates a string representing the content of the HDF tree rooted at this node. |
void |
exportDate(String hdfName,
String tz,
int tt)
Export a date to a clearsilver tree using a specified timezone |
void |
exportDate(String hdfName,
TimeZone timeZone,
Date date)
Export a date to a clearsilver tree using a specified timezone |
HDF |
getChild(String hdfpath)
Retrieves the HDF for the first child of the root of the subtree at hdfpath, or null if no child exists of that path or if the path doesn't exist. |
CSFileLoader |
getFileLoader()
Get the file loader in use, if any. |
int |
getIntValue(String hdfName,
int defaultValue)
Retrieves the integer value at the specified path in this HDF node's subtree. |
HDF |
getObj(String hdfpath)
Retrieves the HDF object that is the root of the subtree at hdfpath, or null if no object exists at that path. |
HDF |
getOrCreateObj(String hdfpath)
Retrieves the HDF object that is the root of the subtree at hdfpath, create the subtree if it doesn't exist |
HDF |
getRootObj()
Return the root of the tree where the current node lies. |
String |
getValue(String hdfName,
String defaultValue)
Retrieves the value at the specified path in this HDF node's subtree. |
HDF |
objChild()
Returns the child of this HDF node, or null if there is no child. |
String |
objName()
Returns the name of this HDF node. |
HDF |
objNext()
Returns the child of this HDF node, or null if there is no child. |
String |
objValue()
Returns the value of this HDF node, or null if this node has no value. |
void |
optimize()
JSilver-specific method that optimizes the underlying data object. |
boolean |
readFile(String filename)
Loads the contents of the specified HDF file from disk into the current HDF object. |
boolean |
readString(String content)
Parses/loads the contents of the given string as HDF into the current HDF object. |
void |
removeTree(String hdfName)
Remove the specified subtree. |
void |
setFileLoader(CSFileLoader fileLoader)
Set the CS file loader to use |
void |
setSymLink(String hdfNameSrc,
String hdfNameDest)
Links the src hdf name to the dest. |
void |
setValue(String hdfName,
String value)
Sets the value at the specified path in this HDF node's subtree. |
String |
toString()
|
boolean |
writeFile(String filename)
Serializes HDF contents to a file (readable by readFile) |
String |
writeString()
Serializes HDF contents to a string (readable by readString) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void close()
HDF
close
in interface Closeable
close
in interface HDF
public boolean readFile(String filename) throws IOException
HDF
readFile
in interface HDF
IOException
public CSFileLoader getFileLoader()
HDF
getFileLoader
in interface HDF
public void setFileLoader(CSFileLoader fileLoader)
HDF
setFileLoader
in interface HDF
fileLoader
- the file loader that should be used.public boolean writeFile(String filename) throws IOException
HDF
writeFile
in interface HDF
IOException
public boolean readString(String content)
HDF
readString
in interface HDF
public int getIntValue(String hdfName, int defaultValue)
HDF
getIntValue
in interface HDF
public String getValue(String hdfName, String defaultValue)
HDF
getValue
in interface HDF
public void setValue(String hdfName, String value)
HDF
setValue
in interface HDF
public void removeTree(String hdfName)
HDF
removeTree
in interface HDF
public void setSymLink(String hdfNameSrc, String hdfNameDest)
HDF
setSymLink
in interface HDF
public void exportDate(String hdfName, TimeZone timeZone, Date date)
HDF
exportDate
in interface HDF
public void exportDate(String hdfName, String tz, int tt)
HDF
exportDate
in interface HDF
public HDF getObj(String hdfpath)
HDF
getObj
in interface HDF
public HDF getChild(String hdfpath)
HDF
getChild
in interface HDF
public HDF getRootObj()
HDF
HDF
every time.
Use HDF.belongsToSameRoot(HDF)
to check if two HDF
s
belong to the same root.
getRootObj
in interface HDF
public boolean belongsToSameRoot(HDF hdf)
HDF
belongsToSameRoot
in interface HDF
hdf
- The hdf object to compare to.public HDF getOrCreateObj(String hdfpath)
HDF
getOrCreateObj
in interface HDF
public String objName()
HDF
objName
in interface HDF
public String objValue()
HDF
objValue
in interface HDF
public HDF objChild()
HDF
objChild
in interface HDF
public HDF objNext()
HDF
objNext
in interface HDF
public void copy(String hdfpath, HDF src)
HDF
This method copies over the attributes and value of the node and recurses through all the children of the source node. Any symlink in the source node becomes a symlink in the copy.
copy
in interface HDF
hdfpath
- the node within this HDF where the source structure should
be copied to.src
- the source HDF to copy over.public String dump()
HDF
dump
in interface HDF
public String writeString()
HDF
writeString
in interface HDF
public String toString()
toString
in class Object
public void optimize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |