|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.betwixt.io.AbstractBeanWriter
public abstract class AbstractBeanWriter
Abstract superclass for bean writers. This class encapsulates the processing logic. Subclasses provide implementations for the actual expression of the xml.
This class is intended to be used by subclassing: concrete subclasses perform the actual writing by providing suitable implementations for the following methods inspired by SAX:
start()
- called when processing beginsstartElement(WriteContext, String, String, String, Attributes)
- called when the start of an element
should be writtenbodyText(WriteContext, String)
- called when the start of an element
should be writtenendElement(WriteContext, String, String, String)
- called when the end of an element
should be writtenend()
- called when processing has been completedNote that this class contains many deprecated versions of the writing API. These will be removed soon so care should be taken to use the latest version.
Note that this class is designed to be used
in a single threaded environment. When used in multi-threaded
environments, use of a common XMLIntrospector
and pooled writer instances should be considered.
Nested Class Summary | |
---|---|
private class |
AbstractBeanWriter.ElementAttributes
Attributes backed by attribute descriptors. |
private class |
AbstractBeanWriter.IDElementAttributes
Attributes with generate ID/IDREF attributes //TODO: refactor the ID/REF generation so that it's fixed at introspection and the generators are placed into the Context. |
private static class |
AbstractBeanWriter.WriteContextImpl
Basic mutable implementation of WriteContext . |
Field Summary | |
---|---|
private org.apache.commons.collections.ArrayStack |
beanStack
Stack containing beans - used to detect cycles |
private BindingConfiguration |
bindingConfiguration
Dynamic binding configuration settings |
private IDGenerator |
idGenerator
Used to generate ID attribute values |
private XMLIntrospector |
introspector
Introspector used |
private org.apache.commons.logging.Log |
log
Log used for logging (Doh!) |
private java.util.Collection |
namespacesDeclared
Collection of namespaces which have already been declared |
private AbstractBeanWriter.WriteContextImpl |
writeContext
WriteContext implementation reused curing writing |
private boolean |
writeEmptyElements
Should empty elements be written out? |
Constructor Summary | |
---|---|
AbstractBeanWriter()
|
Method Summary | |
---|---|
private org.xml.sax.Attributes |
addNamespaceDeclarations(org.xml.sax.Attributes attributes,
java.lang.String elementNamespaceUri)
Adds namespace declarations (if any are needed) to the given attributes. |
protected void |
bodyText(java.lang.String text)
Deprecated. 0.5 use bodyText(WriteContext, String) |
protected void |
bodyText(WriteContext context,
java.lang.String text)
Writes body text |
private java.lang.String |
convertToString(java.lang.Object value,
Descriptor descriptor,
Context context)
Converts an object to a string. |
void |
end()
Marks the start of the bean writing. |
protected void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Deprecated. 0.5 use endElement(WriteContext, String, String, String) |
protected void |
endElement(WriteContext context,
java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Writes the end tag for an element |
protected void |
expressAttribute(java.lang.String qualifiedName,
java.lang.String value)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressAttribute(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
java.lang.String value)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressBodyText(java.lang.String text)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressElementEnd()
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressElementEnd(java.lang.String qualifiedName)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressElementEnd(java.lang.String uri,
java.lang.String localName,
java.lang.String qualifiedName)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressElementStart(java.lang.String qualifiedName)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressElementStart(java.lang.String uri,
java.lang.String localName,
java.lang.String qualifiedName)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
expressTagClose()
Deprecated. 0.5 replaced by new SAX inspired API |
private XMLBeanInfo |
findXMLBeanInfo(java.lang.Object bean,
ElementDescriptor parentDescriptor)
Finds the appropriate bean info for the given (hollow) element. |
org.apache.commons.logging.Log |
getAbstractBeanWriterLog()
Gets the current logging implementation. |
BindingConfiguration |
getBindingConfiguration()
Gets the dynamic configuration setting to be used for bean reading. |
IDGenerator |
getIdGenerator()
Get IDGenerator implementation used to
generate ID attribute values . |
protected int |
getIndentLevel()
Deprecated. 0.5 replaced by new SAX inspired API |
boolean |
getWriteEmptyElements()
Gets whether empty elements should be written into the output. |
boolean |
getWriteIDs()
Deprecated. 0.5 use BindingConfiguration.getMapIDs() |
XMLIntrospector |
getXMLIntrospector()
Gets the introspector used. |
private boolean |
ignoreElement(ElementDescriptor descriptor,
java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
Context context)
Should this element (and children) be written out? |
private boolean |
isEmptyElement(ElementDescriptor descriptor,
Context context)
Will evaluating this element against this context result in an empty element? |
private Context |
makeContext(java.lang.Object bean)
Factory method for new contexts. |
protected java.lang.Object |
popBean()
Pops the top bean off from the ancestry stack |
protected void |
pushBean(java.lang.Object bean)
Pushes the bean onto the ancestry stack. |
void |
setAbstractBeanWriterLog(org.apache.commons.logging.Log log)
Set the current logging implementation. |
void |
setBindingConfiguration(BindingConfiguration bindingConfiguration)
Sets the dynamic configuration setting to be used for bean reading. |
void |
setIdGenerator(IDGenerator idGenerator)
Set IDGenerator implementation
used to generate ID attribute values. |
void |
setWriteEmptyElements(boolean writeEmptyElements)
Sets whether empty elements should be written into the output. |
void |
setWriteIDs(boolean writeIDs)
Deprecated. 0.5 use BindingConfiguration.setMapIDs(boolean) |
void |
setXMLIntrospector(XMLIntrospector introspector)
Sets the introspector to be used. |
void |
start()
Marks the start of the bean writing. |
protected void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
Deprecated. 0.5 use startElement(WriteContext, String, String, String, Attributes) |
protected void |
startElement(WriteContext context,
java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
Writes the start tag for an element. |
void |
write(java.lang.Object bean)
Writes the given bean to the current stream using the XML introspector. |
void |
write(java.lang.Object bean,
org.xml.sax.InputSource source)
Writes the bean using the mapping specified in the InputSource . |
protected void |
write(java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
write(java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context,
java.lang.String idAttribute,
java.lang.String idValue)
Deprecated. 0.5 replaced by new SAX inspired API |
void |
write(java.lang.String qualifiedName,
java.lang.Object bean)
Writes the given bean to the current stream using the given qualifiedName . |
protected void |
writeAttribute(AttributeDescriptor attributeDescriptor,
Context context)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
writeAttributes(ElementDescriptor elementDescriptor,
Context context)
Deprecated. 0.5 replaced by new SAX inspired API |
private void |
writeBean(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
java.lang.Object bean,
Context context)
Writes the given bean to the current stream using the given qualifiedName . |
private void |
writeBean(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
java.lang.Object bean,
Context context,
XMLBeanInfo beanInfo)
Writes the given bean to the current stream using the given mapping. |
private void |
writeBean(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
java.lang.Object bean,
ElementDescriptor parentDescriptor,
Context context)
|
protected boolean |
writeContent(ElementDescriptor elementDescriptor,
Context context)
Deprecated. 0.5 replaced by new SAX inspired API |
private void |
writeElement(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context)
Writes the given element |
private void |
writeElement(java.lang.String namespaceUri,
java.lang.String localName,
java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context,
java.lang.String idAttribute,
java.lang.String idValue)
Writes the given element adding an ID attribute |
private void |
writeElementContent(ElementDescriptor elementDescriptor,
Context context)
Writes the element content. |
private void |
writeIDREFElement(ElementDescriptor elementDescriptor,
java.lang.String uri,
java.lang.String localName,
java.lang.String qualifiedName,
java.lang.String idrefAttributeName,
java.lang.String idrefAttributeValue)
Writes an element with a IDREF attribute |
protected void |
writeIDREFElement(java.lang.String qualifiedName,
java.lang.String idrefAttributeName,
java.lang.String idrefAttributeValue)
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
writeIndent()
Deprecated. 0.5 replaced by new BeanWriter API |
protected void |
writePrintln()
Deprecated. 0.5 replaced by new SAX inspired API |
protected void |
writeRestOfElement(java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context)
Deprecated. 0.5 replaced by new SAX inspired API |
private void |
writeRestOfElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qualifiedName,
ElementDescriptor elementDescriptor,
Context context)
Write attributes, child elements and element end |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private XMLIntrospector introspector
private org.apache.commons.logging.Log log
private org.apache.commons.collections.ArrayStack beanStack
private IDGenerator idGenerator
private boolean writeEmptyElements
private BindingConfiguration bindingConfiguration
private AbstractBeanWriter.WriteContextImpl writeContext
WriteContext
implementation reused curing writing
private java.util.Collection namespacesDeclared
Constructor Detail |
---|
public AbstractBeanWriter()
Method Detail |
---|
public void start() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingpublic void end() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingpublic void write(java.lang.Object bean) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
Writes the given bean to the current stream using the XML introspector.
This writes an xml fragment representing the bean to the current stream.
This method will throw a CyclicReferenceException
when a cycle
is encountered in the graph only if the getMapIDs()
setting of the BindingConfiguration is false.
bean
- write out representation of this bean
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occurspublic void write(java.lang.String qualifiedName, java.lang.Object bean) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
Writes the given bean to the current stream
using the given qualifiedName
.
This method will throw a CyclicReferenceException
when a cycle
is encountered in the graph only if the getMapIDs()
setting of the BindingConfiguration
is false.
qualifiedName
- the string naming root elementbean
- the Object
to write out as xml
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occurspublic void write(java.lang.Object bean, org.xml.sax.InputSource source) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
Writes the bean using the mapping specified in the InputSource
.
Note: that the custom mapping will not
be registered for later use. Please use XMLIntrospector.register(org.xml.sax.InputSource)
to register the custom mapping for the class and then call
write(Object)
.
bean
- Object
to be written as xml, not nullsource
- InputSource/code> containing an xml document
specifying the mapping to be used (in the usual way), not null
- Throws:
java.io.IOException
org.xml.sax.SAXException
java.beans.IntrospectionException
- Since:
- 0.7
- See Also:
since the standard notes also apply
private void writeBean(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.lang.Object bean, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
Writes the given bean to the current stream
using the given qualifiedName
.
This method will throw a CyclicReferenceException
when a cycle
is encountered in the graph only if the getMapIDs()
setting of the BindingConfiguration
is false.
namespaceUri
- the namespace urilocalName
- the local namequalifiedName
- the string naming root elementintrospectedBindType
- the Class
of the bean
as resolved at introspection time, or null if the type has not been resolvedbean
- the Object
to write out as xmlcontext
- not null
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprivate void writeBean(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.lang.Object bean, ElementDescriptor parentDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
java.io.IOException
org.xml.sax.SAXException
java.beans.IntrospectionException
private XMLBeanInfo findXMLBeanInfo(java.lang.Object bean, ElementDescriptor parentDescriptor) throws java.beans.IntrospectionException
bean
- parentDescriptor
- ElementDescriptor
, not null
XMLBeanInfo
, not null
java.beans.IntrospectionException
private void writeBean(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.lang.Object bean, Context context, XMLBeanInfo beanInfo) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
Writes the given bean to the current stream using the given mapping.
This method will throw a CyclicReferenceException
when a cycle
is encountered in the graph only if the getMapIDs()
setting of the BindingConfiguration
is false.
namespaceUri
- the namespace uri, or null to use the automatic bindinglocalName
- the local name or null to use the automatic bindingqualifiedName
- the String
naming the root element
or null to use the automatic bindingbean
- Object
to be written, not nullcontext
- Context
, not nullbeanInfo
- XMLBeanInfo
, not null
java.io.IOException
org.xml.sax.SAXException
java.beans.IntrospectionException
public IDGenerator getIdGenerator()
IDGenerator
implementation used to
generate ID
attribute values .
ID
attribute generationpublic void setIdGenerator(IDGenerator idGenerator)
IDGenerator
implementation
used to generate ID
attribute values.
This property can be used to customize the algorithm used for generation.
idGenerator
- use this implementation for ID
attribute generationpublic BindingConfiguration getBindingConfiguration()
public void setBindingConfiguration(BindingConfiguration bindingConfiguration)
bindingConfiguration
- the BindingConfiguration settings, not nullpublic boolean getWriteIDs()
BindingConfiguration.getMapIDs()
Should generated ID
attribute values be added to the elements?
If IDs are not being written then if a cycle is encountered in the bean graph,
then a CyclicReferenceException
will be thrown by the write method.
ID
and IDREF
attributes are to be writtenpublic void setWriteIDs(boolean writeIDs)
BindingConfiguration.setMapIDs(boolean)
ID
attribute values should be added to the elements
If this property is set to false, then CyclicReferenceException
will be thrown whenever a cyclic occurs in the bean graph.
writeIDs
- true if ID
's and IDREF
's should be writtenpublic boolean getWriteEmptyElements()
Gets whether empty elements should be written into the output.
An empty element is one that has no attributes, no child elements
and no body text.
For example, <element/>
is an empty element but
<element attr='value'/>
is not.
public void setWriteEmptyElements(boolean writeEmptyElements)
Sets whether empty elements should be written into the output.
An empty element is one that has no attributes, no child elements
and no body text.
For example, <element/>
is an empty element but
<element attr='value'/>
is not.
writeEmptyElements
- true if empty elements should be written into the outputpublic XMLIntrospector getXMLIntrospector()
Gets the introspector used.
The XMLBeanInfo
used to map each bean is
created by the XMLIntrospector
.
One way in which the mapping can be customized is
by altering the XMLIntrospector
.
XMLIntrospector
used for introspectionpublic void setXMLIntrospector(XMLIntrospector introspector)
Sets the introspector to be used.
The XMLBeanInfo
used to map each bean is
created by the XMLIntrospector
.
One way in which the mapping can be customized is by
altering the XMLIntrospector
.
introspector
- use this introspectorpublic final org.apache.commons.logging.Log getAbstractBeanWriterLog()
Gets the current logging implementation.
Log
implementation which this class logs topublic final void setAbstractBeanWriterLog(org.apache.commons.logging.Log log)
Set the current logging implementation.
log
- Log
implementation to useprotected void startElement(WriteContext context, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr) throws java.io.IOException, org.xml.sax.SAXException
uri
- the element's namespace urilocalName
- the element's local nameqName
- the element's qualified nameattr
- the element's attributes
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void endElement(WriteContext context, java.lang.String uri, java.lang.String localName, java.lang.String qName) throws java.io.IOException, org.xml.sax.SAXException
uri
- the element's namespace urilocalName
- the element's local nameqName
- the element's qualified name
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void bodyText(WriteContext context, java.lang.String text) throws java.io.IOException, org.xml.sax.SAXException
text
- the body text to be written
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr) throws java.io.IOException, org.xml.sax.SAXException
startElement(WriteContext, String, String, String, Attributes)
uri
- the element's namespace urilocalName
- the element's local nameqName
- the element's qualified nameattr
- the element's attributes
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws java.io.IOException, org.xml.sax.SAXException
endElement(WriteContext, String, String, String)
uri
- the element's namespace urilocalName
- the element's local nameqName
- the element's qualified name
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void bodyText(java.lang.String text) throws java.io.IOException, org.xml.sax.SAXException
bodyText(WriteContext, String)
text
- the body text to be written
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprivate void writeElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
namespaceUri
- the namespace urilocalName
- the local namequalifiedName
- qualified name to use for the elementelementDescriptor
- the ElementDescriptor
describing the elementcontext
- the Context
to use to evaluate the bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprivate org.xml.sax.Attributes addNamespaceDeclarations(org.xml.sax.Attributes attributes, java.lang.String elementNamespaceUri)
attributes
- Attributes, not nullelementNamespaceUri
- the URI for the enclosing element, possibly null
private void writeElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context, java.lang.String idAttribute, java.lang.String idValue) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
namespaceUri
- the namespace urilocalName
- the local namequalifiedName
- the qualified nameelementDescriptor
- the ElementDescriptor describing this elementcontext
- the context being evaliated againstidAttribute
- the qualified name of the ID
attributeidValue
- the value for the ID
attribute
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprivate void writeRestOfElement(java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
uri
- the element namespace urilocalName
- the local name of the elementqualifiedName
- the qualified name of the elementelementDescriptor
- the descriptor for this elementcontext
- evaluate against this context
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprivate void writeIDREFElement(ElementDescriptor elementDescriptor, java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName, java.lang.String idrefAttributeName, java.lang.String idrefAttributeValue) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
IDREF
attribute
uri
- the namespace urilocalName
- the local namequalifiedName
- of the element with IDREF
attributeidrefAttributeName
- the qualified name of the IDREF
attributeidrefAttributeValue
- the value for the IDREF
attribute
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprivate void writeElementContent(ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
elementDescriptor
- the ElementDescriptor
to write as xmlcontext
- the Context
to use to evaluate the bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected void pushBean(java.lang.Object bean)
bean
- push this bean onto the ancester stackprotected java.lang.Object popBean()
private boolean ignoreElement(ElementDescriptor descriptor, java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, Context context) throws java.beans.IntrospectionException
descriptor
- the ElementDescriptor
to evaluatecontext
- the Context
against which the element will be evaluated
java.beans.IntrospectionException
private boolean isEmptyElement(ElementDescriptor descriptor, Context context) throws java.beans.IntrospectionException
Will evaluating this element against this context result in an empty element?
An empty element is one that has no attributes, no child elements
and no body text.
For example, <element/>
is an empty element but
<element attr='value'/>
is not.
descriptor
- the ElementDescriptor
to evaluatecontext
- the Context
against which the element will be evaluated
java.beans.IntrospectionException
protected int getIndentLevel()
protected void expressElementStart(java.lang.String qualifiedName) throws java.io.IOException, org.xml.sax.SAXException
qualifiedName
- the qualified name of the element to be expressed
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressElementStart(java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName) throws java.io.IOException, org.xml.sax.SAXException
uri
- the namespace urilocalName
- the local name for this elementqualifiedName
- the qualified name of the element to be expressed
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressTagClose() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressElementEnd(java.lang.String qualifiedName) throws java.io.IOException, org.xml.sax.SAXException
qualifiedName
- the qualified name for the element to be closed
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressElementEnd(java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName) throws java.io.IOException, org.xml.sax.SAXException
uri
- the namespace uri of the element close taglocalName
- the local name of the element close tagqualifiedName
- the qualified name for the element to be closed
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressElementEnd() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressBodyText(java.lang.String text) throws java.io.IOException, org.xml.sax.SAXException
text
- the string to write out as the body of the current element
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressAttribute(java.lang.String qualifiedName, java.lang.String value) throws java.io.IOException, org.xml.sax.SAXException
qualifiedName
- the qualified name of the attributevalue
- the attribute value
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void expressAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.lang.String value) throws java.io.IOException, org.xml.sax.SAXException
namespaceUri
- the namespace urilocalName
- the local namequalifiedName
- the qualified name of the attributevalue
- the attribute value
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void write(java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
qualifiedName
- qualified name to use for the elementelementDescriptor
- the ElementDescriptor
describing the elementcontext
- the Context
to use to evaluate the bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected void write(java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context, java.lang.String idAttribute, java.lang.String idValue) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
qualifiedName
- qualified name to use for the elementelementDescriptor
- the ElementDescriptor
describing the elementcontext
- the Context
to use to evaluate the bean expressionsidAttribute
- the qualified name of the ID
attributeidValue
- the value for the ID
attribute
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected void writeRestOfElement(java.lang.String qualifiedName, ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
qualifiedName
- qualified name to use for the elementelementDescriptor
- the ElementDescriptor
describing the elementcontext
- the Context
to use to evaluate the bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected void writeIDREFElement(java.lang.String qualifiedName, java.lang.String idrefAttributeName, java.lang.String idrefAttributeValue) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
IDREF
attribute
qualifiedName
- of the element with IDREF
attributeidrefAttributeName
- the qualified name of the IDREF
attributeidrefAttributeValue
- the value for the IDREF
attribute
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected boolean writeContent(ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException, java.beans.IntrospectionException
elementDescriptor
- the ElementDescriptor
to write as xmlcontext
- the Context
to use to evaluate the bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writing
java.beans.IntrospectionException
- if a java beans introspection problem occursprotected void writeAttributes(ElementDescriptor elementDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException
elementDescriptor
- the ElementDescriptor
to be written out as xmlcontext
- the Context
to use to evaluation bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void writeAttribute(AttributeDescriptor attributeDescriptor, Context context) throws java.io.IOException, org.xml.sax.SAXException
attributeDescriptor
- the AttributeDescriptor
to be written as xmlcontext
- the Context
to use to evaluation bean expressions
java.io.IOException
- if an IO problem occurs during writing
org.xml.sax.SAXException
- if an SAX problem occurs during writingprotected void writePrintln() throws java.io.IOException
java.io.IOException
- if the line cannot be writtenprotected void writeIndent() throws java.io.IOException
java.io.IOException
- if the indent cannot be writtenprivate java.lang.String convertToString(java.lang.Object value, Descriptor descriptor, Context context)
value
- the Object to represent as a String, possibly nulldescriptor
- writing out this descriptor not nullcontext
- not null
private Context makeContext(java.lang.Object bean)
bean
- make a new Context for this bean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |