|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelma.scripting.rhino.extensions.XmlObject
public class XmlObject
This class provides methods for converting HopObjects to XML and back.
Constructor Summary | |
---|---|
XmlObject(RhinoCore core)
Creates a new XmlObject object. |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String url)
Retrieves an XML document from a given URL and transforms it into a HopObject |
java.lang.Object |
get(java.lang.String url,
java.lang.String conversionRules)
Retrieves an XML document from a given URL and transforms it into a HopObject |
java.lang.Object |
getFromString(java.lang.String str)
Transforms a XML literal into a HopObject |
java.lang.Object |
getFromString(java.lang.String str,
java.lang.String conversionRules)
Transforms a XML literal into a HopObject according to the rules specified in the file defined by conversionRules |
java.lang.Object |
read(java.lang.String file)
Reads an XML document from a file and creates a HopObject out of it |
java.lang.Object |
read(java.lang.String file,
INode node)
Reads an XML document from a file and reads it into the HopObject argument |
java.lang.Object |
readFromString(java.lang.String str)
Reads an XML document from an XML literal and creates a HopObject out of it |
java.lang.Object |
readFromString(java.lang.String str,
INode node)
Reads an XML document from an XML literal and creates a HopObject out of it |
boolean |
write(INode node,
java.lang.String file)
Writes a HopObject to an XML file |
boolean |
write(INode node,
java.lang.String file,
boolean dbmode)
Writes a HopObject to an XML file, optionally using shallow/db mode |
java.lang.String |
writeToString(INode node)
Transforms a HopObject to XML and returns the result as string |
java.lang.String |
writeToString(INode node,
boolean dbmode)
Transforms a HopObject to XML and returns the result as string, optionally using shallow/db mode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlObject(RhinoCore core)
core
- ...Method Detail |
---|
public boolean write(INode node, java.lang.String file) throws java.io.IOException
node
- the HopObject to encodefile
- the file to write to
java.io.IOException
- if something went wrong along the waypublic boolean write(INode node, java.lang.String file, boolean dbmode) throws java.io.IOException
node
- the HopObject to encodefile
- the file to write todbmode
- whether to write a shallow copy
java.io.IOException
- if something went wrong along the waypublic java.lang.String writeToString(INode node) throws java.io.IOException
node
- the HopObject to encode
java.io.IOException
- if something went wrong along the waypublic java.lang.String writeToString(INode node, boolean dbmode) throws java.io.IOException
node
- the HopObject to encodedbmode
- whether to write a shallow copy
java.io.IOException
- if something went wrongpublic java.lang.Object read(java.lang.String file) throws java.lang.RuntimeException
file
- the file name
java.lang.RuntimeException
- ...public java.lang.Object read(java.lang.String file, INode node) throws java.lang.RuntimeException
file
- the file namenode
- the HopObject to use for conversion
java.lang.RuntimeException
public java.lang.Object readFromString(java.lang.String str) throws java.lang.RuntimeException
str
- the XML string
java.lang.RuntimeException
- ...public java.lang.Object readFromString(java.lang.String str, INode node) throws java.lang.RuntimeException
str
- the XML stringnode
- the HopObject to use for conversion
java.lang.RuntimeException
- ...public java.lang.Object get(java.lang.String url)
url
- the URL containing the XML to be parsed
public java.lang.Object get(java.lang.String url, java.lang.String conversionRules)
url
- the URL containing the XML to be parsedconversionRules
- a file name pointing to the conversion rules
public java.lang.Object getFromString(java.lang.String str)
str
- an XML literal
public java.lang.Object getFromString(java.lang.String str, java.lang.String conversionRules)
str
- an XML literalconversionRules
- a file name pointing to the conversion rules
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |