|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.util.xml.XmlReader
org.progeeks.util.xml.ObjectXmlReader
org.progeeks.util.xml.ObjectTransformingXmlReader
public class ObjectTransformingXmlReader
ObjectXmlReader subclass that loads objects from an XML source after applying a configurable XSL transformation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.progeeks.util.xml.ObjectXmlReader |
---|
ObjectXmlReader.ObjectTagReader |
Nested classes/interfaces inherited from class org.progeeks.util.xml.XmlReader |
---|
XmlReader.XmlHandler |
Field Summary |
---|
Fields inherited from class org.progeeks.util.xml.ObjectXmlReader |
---|
COLLECTION_VALUES_DIRECTIVE, CONFIG_DIRECTIVE, DIRECTIVE_PREFIX, EXISTING_VALUE_DIRECTIVE, FIELD_TYPE_DIRECTIVE, OID_DIRECTIVE, PRELOAD_DIRECTIVE, REFERENCE_DIRECTIVE |
Constructor Summary | |
---|---|
ObjectTransformingXmlReader()
Creates an ObjectTransformingXmlReader that will read an object from an XML file based on the handler plug-ins that are later registered with it. |
|
ObjectTransformingXmlReader(java.lang.String rootTag)
Creates an ObjectTransformingXmlReader that will read a list of objects from an XML file based on the handler plug-ins that are later registered with it. |
Method Summary | |
---|---|
protected void |
checkSourceXmlForStylesheet(java.io.Reader in)
Attempts to determine a stylesheet for the supplied source document. |
static void |
main(java.lang.String[] args)
Main method used to dump a transformed XML to stdout to assist in debugging. |
protected void |
readXml(java.io.Reader in)
Reads the source XML by passing it through the transformer and having the standard SAX handler process the transformed output. |
void |
setStyleSheet(java.io.InputStream stylesheet)
Sets the stylesheet to the one loaded from the supplied input stream. |
void |
setStyleSheet(java.io.Reader stylesheet)
Sets the stylesheet to the one loaded from the supplied reader. |
protected void |
setStyleSheet(javax.xml.transform.Source source)
Sets the stylesheet by parsing the stylesheet definition from the supplied source. |
void |
setStyleSheet(java.lang.String stylesheet)
Sets the stylesheet to one loaded from the supplied path. |
void |
setStyleSheetXml(java.lang.String stylesheetXml)
Sets the stylesheet to the supplied XML string. |
Methods inherited from class org.progeeks.util.xml.ObjectXmlReader |
---|
addObjectHandler, addObjectTagAlias, addStandardObjectHandlers, configureHandlers, getHandler, getObjectHandlers, getReferenceObject, ignoreAttribute, readObject, readObject, readObject, reset, setObjectHandlers |
Methods inherited from class org.progeeks.util.xml.XmlReader |
---|
addTagText, createXmlException, createXmlException, endTag, getAttributesAsMap, getCurrentObject, getDocumentLocator, getIgnoreTagCase, getLocation, getPreviousObject, getRootObject, getStackSize, getTagReader, readXml, readXml, registerHandler, replaceCurrentObject, resolveEntity, setDefaultHandler, setIgnoreTagCase, startTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectTransformingXmlReader()
public ObjectTransformingXmlReader(java.lang.String rootTag)
Method Detail |
---|
public void setStyleSheetXml(java.lang.String stylesheetXml)
stylesheetXml
- String containing the stylesheet XML.public void setStyleSheet(java.lang.String stylesheet)
stylesheet
- Path to a stylesheet definition to load.public void setStyleSheet(java.io.InputStream stylesheet)
stylesheet
- Input stream containing a stylesheet definition.public void setStyleSheet(java.io.Reader stylesheet)
stylesheet
- Reader containing a stylesheet definition.protected void setStyleSheet(javax.xml.transform.Source source)
source
- Source of the stylesheet to parse.protected void checkSourceXmlForStylesheet(java.io.Reader in)
in
- Source document to look for stylesheet configuration in.protected void readXml(java.io.Reader in) throws java.io.IOException, XmlException
readXml
in class XmlReader
in
- Source XML to read.
java.io.IOException
XmlException
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- Source XML and optional stylsheet.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |