|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.9.0) E52932-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jbo.server.xml.XmlRowSetRenderer
public class XmlRowSetRenderer
The XmlRowSetRenderer class renders a canonical XML representation for the rows of an oracle.jbo.RowSet. Since oracle.jbo.ViewObject implements RowSet, XmlRowSetRenderer can be used on any RowSet or View Object.
XmlRowSetRenderer renders a canonical XML representation by iterating through the attribute defs for the initial "root" RowSet you specify when you instantiate it (or set via setRowSet()). It produces equivalent XML tags for each scalar attribute. When XmlRowSetRenderer detects that an attribute is a "nested RowSet", it recurses to print the nested XML for the nested RowSet. The result is an XML "tree" of elements, reflecting the deep data print of all the rows in the root RowSet, along with any nested (View Linked) detail information.
Optionally, the setStyleSheet method lets you transform the results of XmlRowSetRenderer according to an XSLT stylesheet.
You instantiate XmlRowSetRenderer by declaring:
XmlRowSetRenderer xrr = new XmlRowSetRenderer(rowset);
To retrieve the resulting XML Document (optionally transformed by the stylesheet you've set) as an in-memory XML Document, call getXMLDocument()
To print the resulting XML Document (optionally transformed by the stylesheet you've set) to a PrintWriter, call print()
By using custom properties, you can customize your XML output without having to edit your Java classes.
XML_ELEMENT
. Set XML_ELEMENT equal to the element name you want to use. To hide the attribute in the XML document, set that attribute's XML_ELEMENT equal to the value #hide.If you have a View Object attribute value that contains characters requiring quotes, such as less-than (<) or ampersand (&), XmlRowSetRenderer lets you treat it as an XML CDATA section. Within a CDATA section, you can omit quotes from characters that would otherwise require it. To treat an attribute value as a CDATA section, add a custom property to your View Object Attribute named CDATA with a value equal to "Y".
Constructor Summary | |
---|---|
XmlRowSetRenderer() |
|
XmlRowSetRenderer(RowSet root) |
Method Summary | |
---|---|
Document |
getXMLDocument() Retrieve in-memory XML Document for data in root rowset plus its detail rowsets. |
void |
print(java.io.PrintWriter out) Print the XML results to a PrintWriter |
void |
setMaxRows(int val) Set the maximum number of master Rows to render |
void |
setRowSet(RowSet root) Set the RowSet to be used for XML rendering. |
void |
setRowSetTag(java.lang.String tag) Override the default XML Element name to be used for the entire RowSet. |
void |
setRowTag(java.lang.String tag) Override the default XML Element name to be used for each Row in each rowset. |
void |
setStylesheet(XSLStylesheet transform) Set the XSLStylesheet to use for (optional) transformation |
void |
setStylesheet(XSLStylesheet transform, java.net.URL baseURL) Set the XSLStylesheet to use for (optional) transformation |
void |
setStylesheetParam(java.lang.String name, java.lang.String value) Set the XSL Stylesheet parameter to value to literal string. |
void |
setStylesheetParamXPath(java.lang.String name, java.lang.String value) Set the XSL Stylesheet parameter to value of an XPath expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRowSetRenderer()
public XmlRowSetRenderer(RowSet root)
Method Detail |
---|
public void setRowSetTag(java.lang.String tag)
tag
- XML Element name for rowsetpublic void setRowTag(java.lang.String tag)
tag
- XML Element name for each Row.public void setRowSet(RowSet root)
root
- Root RowSetpublic Document getXMLDocument()
public void setStylesheetParam(java.lang.String name, java.lang.String value)
name
- Parameter name.value
- Parameter value.public void setStylesheetParamXPath(java.lang.String name, java.lang.String value)
name
- Parameter name.value
- XPath Expression to evaluate as parameter value.public void setStylesheet(XSLStylesheet transform)
public void setStylesheet(XSLStylesheet transform, java.net.URL baseURL)
public void setMaxRows(int val)
public void print(java.io.PrintWriter out) throws java.lang.Exception
java.lang.Exception
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.9.0) E52932-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |