com.sun.xml.bind.v2.runtime.reflect
Class DefaultTransducedAccessor<T>
java.lang.Object
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor<T>
com.sun.xml.bind.v2.runtime.reflect.DefaultTransducedAccessor<T>
- Direct Known Subclasses:
- ListTransducedAccessorImpl, TransducedAccessor_field_Byte, TransducedAccessor_field_Integer, TransducedAccessor_method_Byte, TransducedAccessor_method_Integer
public abstract class DefaultTransducedAccessor<T>
- extends TransducedAccessor<T>
TransducedAccessor
that prints to String
.
The print method that works for String
determines the dispatching
of the writeText(XMLSerializer,Object,String)
and
writeLeafElement(XMLSerializer, Name, Object, String)
methods,
so those are implemented here.
Method Summary |
abstract java.lang.String |
print(T o)
Prints the responsible field of the given bean to the writer. |
void |
writeLeafElement(XMLSerializer w,
Name tagName,
T o,
java.lang.String fieldName)
Convenience method to write the value as a text inside an element
without any attributes. |
void |
writeText(XMLSerializer w,
T o,
java.lang.String fieldName)
Invokes one of the XMLSerializer.text(String, String) method
with the representation of data bested suited for this transduced accessor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultTransducedAccessor
public DefaultTransducedAccessor()
print
public abstract java.lang.String print(T o)
throws AccessorException,
org.xml.sax.SAXException
- Description copied from class:
TransducedAccessor
- Prints the responsible field of the given bean to the writer.
Use XMLSerializer.getInstance()
to access to the namespace bindings
- Specified by:
print
in class TransducedAccessor<T>
- Returns:
- if the accessor didn't yield a value, return null.
- Throws:
AccessorException
org.xml.sax.SAXException
writeLeafElement
public void writeLeafElement(XMLSerializer w,
Name tagName,
T o,
java.lang.String fieldName)
throws org.xml.sax.SAXException,
AccessorException,
java.io.IOException,
javax.xml.stream.XMLStreamException
- Description copied from class:
TransducedAccessor
- Convenience method to write the value as a text inside an element
without any attributes.
Can be overridden for improved performance.
- Specified by:
writeLeafElement
in class TransducedAccessor<T>
- Throws:
org.xml.sax.SAXException
AccessorException
java.io.IOException
javax.xml.stream.XMLStreamException
writeText
public void writeText(XMLSerializer w,
T o,
java.lang.String fieldName)
throws AccessorException,
org.xml.sax.SAXException,
java.io.IOException,
javax.xml.stream.XMLStreamException
- Description copied from class:
TransducedAccessor
- Invokes one of the
XMLSerializer.text(String, String)
method
with the representation of data bested suited for this transduced accessor.
- Specified by:
writeText
in class TransducedAccessor<T>
- Throws:
AccessorException
org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException