com.sun.xml.bind.v2.runtime.reflect
Class DefaultTransducedAccessor<T>

java.lang.Object
  extended by com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor<T>
      extended by com.sun.xml.bind.v2.runtime.reflect.DefaultTransducedAccessor<T>
Direct Known Subclasses:
ListTransducedAccessorImpl, TransducedAccessor_field_Boolean, TransducedAccessor_field_Byte, TransducedAccessor_field_Double, TransducedAccessor_field_Float, TransducedAccessor_field_Integer, TransducedAccessor_field_Long, TransducedAccessor_field_Short, TransducedAccessor_method_Boolean, TransducedAccessor_method_Byte, TransducedAccessor_method_Double, TransducedAccessor_method_Float, TransducedAccessor_method_Integer, TransducedAccessor_method_Long, TransducedAccessor_method_Short

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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor
TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
 
Constructor Summary
DefaultTransducedAccessor()
           
 
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 com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor
declareNamespace, get, hasValue, parse, useNamespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTransducedAccessor

public DefaultTransducedAccessor()
Method Detail

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.

The callee assumes that there's an associated value in the field. No @xsi:type handling is expected.

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