Package helma.scripting.rhino.extensions
Class XmlObject
java.lang.Object
helma.scripting.rhino.extensions.XmlObject
This class provides methods for converting HopObjects to XML and back.
- See Also:
-
- invalid input: '<http://helma.org/development/rfc/xmlconversion/>'
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an XML document from a given URL and transforms it into a HopObjectRetrieves an XML document from a given URL and transforms it into a HopObjectgetFromString
(String str) Transforms a XML literal into a HopObjectgetFromString
(String str, String conversionRules) Transforms a XML literal into a HopObject according to the rules specified in the file defined by conversionRulesReads an XML document from a file and creates a HopObject out of itReads an XML document from a file and reads it into the HopObject argumentreadFromString
(String str) Reads an XML document from an XML literal and creates a HopObject out of itreadFromString
(String str, INode node) Reads an XML document from an XML literal and creates a HopObject out of itboolean
Writes a HopObject to an XML fileboolean
Writes a HopObject to an XML file, optionally using shallow/db modewriteToString
(INode node) Transforms a HopObject to XML and returns the result as stringwriteToString
(INode node, boolean dbmode) Transforms a HopObject to XML and returns the result as string, optionally using shallow/db mode
-
Constructor Details
-
XmlObject
Creates a new XmlObject object.- Parameters:
core
- ...
-
-
Method Details
-
write
Writes a HopObject to an XML file- Parameters:
node
- the HopObject to encodefile
- the file to write to- Returns:
- true
- Throws:
IOException
- if something went wrong along the way
-
write
Writes a HopObject to an XML file, optionally using shallow/db mode- Parameters:
node
- the HopObject to encodefile
- the file to write todbmode
- whether to write a shallow copy- Returns:
- true
- Throws:
IOException
- if something went wrong along the way
-
writeToString
Transforms a HopObject to XML and returns the result as string- Parameters:
node
- the HopObject to encode- Returns:
- the XML representing the HopObject
- Throws:
IOException
- if something went wrong along the way
-
writeToString
Transforms a HopObject to XML and returns the result as string, optionally using shallow/db mode- Parameters:
node
- the HopObject to encodedbmode
- whether to write a shallow copy- Returns:
- the XML representing the HopObject
- Throws:
IOException
- if something went wrong
-
read
Reads an XML document from a file and creates a HopObject out of it- Parameters:
file
- the file name- Returns:
- the HopObject
- Throws:
RuntimeException
- ...
-
read
Reads an XML document from a file and reads it into the HopObject argument- Parameters:
file
- the file namenode
- the HopObject to use for conversion- Returns:
- the HopObject
- Throws:
RuntimeException
-
readFromString
Reads an XML document from an XML literal and creates a HopObject out of it- Parameters:
str
- the XML string- Returns:
- the HopObject
- Throws:
RuntimeException
- ...
-
readFromString
Reads an XML document from an XML literal and creates a HopObject out of it- Parameters:
str
- the XML stringnode
- the HopObject to use for conversion- Returns:
- ...
- Throws:
RuntimeException
- ...
-
get
Retrieves an XML document from a given URL and transforms it into a HopObject- Parameters:
url
- the URL containing the XML to be parsed- Returns:
- a HopObject obtained from parsing the XML
-
get
Retrieves an XML document from a given URL and transforms it into a HopObject- Parameters:
url
- the URL containing the XML to be parsedconversionRules
- a file name pointing to the conversion rules- Returns:
- a HopObject obtained from parsing the XML
- See Also:
-
- invalid input: '<http://helma.org/development/rfc/xmlconversion/>'
-
getFromString
Transforms a XML literal into a HopObject- Parameters:
str
- an XML literal- Returns:
- a HopObject obtained from parsing the XML
-
getFromString
Transforms a XML literal into a HopObject according to the rules specified in the file defined by conversionRules- Parameters:
str
- an XML literalconversionRules
- a file name pointing to the conversion rules- Returns:
- a HopObject obtained from parsing the XML
- See Also:
-
- invalid input: '<http://helma.org/development/rfc/xmlconversion/>'
-