|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.moremotion.adom.ADOMNode
org.moremotion.adom.ADOM
public class ADOM
Application Data Object Model (ADOM)
ADOMs are MoreMotion's data objects to store hiearchically structured data in Request, Session or Application scopes. The responsibility of a MoreMotion programmer is to create ADOMs that contains the data required by the next MoreMotion page. The converting the ADOMs to XML strings is MoreMotion's responsibility.The data of an ADOM is stored as ADOMNode
objects which is linked to the root node of the ADOM. Note that
The data of an ADOM can also be plain XML string instead of ADOMNode collections.
Field Summary |
---|
Fields inherited from class org.moremotion.adom.ADOMNode |
---|
DT_BOOL, DT_INTEGER, DT_NUMBER, DT_STRING |
Constructor Summary | |
---|---|
ADOM()
Create a new ADOM object. |
Method Summary | |
---|---|
void |
clear()
Clears all the child nodes. |
java.lang.Object |
clone()
Clones this ADOM object and returns it |
java.lang.String |
getResBundleName()
Gets the resource bundle name of this ADOM |
ADOMNode |
getRootNode()
Returns the root node |
java.lang.String |
getSequence()
|
java.lang.String |
getXmlExplicit()
Returns the XML string which was set explicitly. |
boolean |
hasXmlExplicit()
Checks whether this ADOM stores its data as XML string or as ADOMNodes. |
boolean |
isProtected()
|
boolean |
isStale(long timeoutInSecs)
Checks whether this ADOM requires refreshing or not. |
java.util.Date |
lastTimeRefreshed()
Returns the date when this ADOM last refreshed. |
void |
loadFromFile(java.io.File file)
Loads the ADOM from the specified text file that contains a valid XML document. |
void |
loadFromFile(java.lang.String fileName)
Loads the ADOM from the specified text file that contains a valid XML document. |
void |
parseXML(java.lang.String xml)
Parses the given XML string and creates the ADOMNodes for this ADOM object |
void |
saveToFile(java.io.File file)
Saves the ADOM to the specified file as XML string using the encoding UTF-8. |
void |
saveToFile(java.lang.String fileName)
Saves the ADOM to the specified file as XML string using the encoding UTF-8. |
void |
setProtected(boolean value)
|
void |
setResBundleName(java.lang.String resBundName)
|
void |
setXmlExplicit(java.lang.String value)
Sets the value of this ADOM with a XML string. |
java.lang.String |
toString()
Returns the String representation of this node. |
Methods inherited from class org.moremotion.adom.ADOMNode |
---|
addAttribute, addNode, equals, findNode, getAttribute, getAttributeCount, getAttributes, getName, getNode, getNodeCount, getNodes, getNodesArray, getNodeValue, getNodeValues, getParent, getPath, getSubNode, getValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsObject, getValueAsString, getValueForXML, hasChild, isRoot, main, removeAttribute, removeLast, removeNode, setName, setNodeValue, setNodeValues, setParent, setValue, setValue, setValue, setValue, sort, toXml, toXml, toXmlWithIndent |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ADOM()
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class ADOMNode
java.lang.CloneNotSupportedException
public java.lang.String getSequence()
public void setResBundleName(java.lang.String resBundName)
public java.lang.String getResBundleName()
public void setProtected(boolean value)
public boolean isProtected()
public ADOMNode getRootNode()
ADOMNode
getRootNode
in class ADOMNode
public void setXmlExplicit(java.lang.String value)
If this method is used for an ADOM, the XML string given will be used as it is when converting this ADOM to XML. If the ADOM has child nodes they will be ignored.
value
- The XML string.public boolean hasXmlExplicit()
true
if the ADOM stores its data as XML string, false
otherwise.public java.lang.String getXmlExplicit()
public boolean isStale(long timeoutInSecs)
timeoutInSecs
- in seconds
public java.util.Date lastTimeRefreshed()
public void clear()
clear
in class ADOMNode
public java.lang.String toString()
toString
in class ADOMNode
public void saveToFile(java.lang.String fileName) throws ADOMException
fileName
- Name of the target file
ADOMException
- if save operation is not successful.public void saveToFile(java.io.File file) throws ADOMException
file
- File object of the target file
ADOMException
- if save operation is not successful.public void loadFromFile(java.lang.String fileName) throws ADOMException
fileName
- File name to load
ADOMException
- if load is not successfulpublic void loadFromFile(java.io.File file) throws ADOMException
file
- File object of the file to load
ADOMException
- if load is not successfulpublic void parseXML(java.lang.String xml) throws ADOMException
xml
- The string that contains XML string to parse
ADOMException
- if parse is not successful
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |