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_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 toString
.The print method that works for
String
determines the dispatching of thewriteText(XMLSerializer,Object,String)
andwriteLeafElement(XMLSerializer, Name, Object, String)
methods, so those are implemented here.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor
TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
-
-
Constructor Summary
Constructors Constructor Description DefaultTransducedAccessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
print(T o)
Prints the responsible field of the given bean to the writer.void
writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName)
Convenience method to write the value as a text inside an element without any attributes.void
writeText(XMLSerializer w, T o, String fieldName)
Invokes one of theXMLSerializer.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
-
-
-
-
Method Detail
-
print
public abstract String print(T o) throws AccessorException, 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 classTransducedAccessor<T>
- Returns:
- if the accessor didn't yield a value, return null.
- Throws:
AccessorException
SAXException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName) throws SAXException, AccessorException, IOException, 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 classTransducedAccessor<T>
- Throws:
SAXException
AccessorException
IOException
XMLStreamException
-
writeText
public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException
Description copied from class:TransducedAccessor
Invokes one of theXMLSerializer.text(String, String)
method with the representation of data bested suited for this transduced accessor.- Specified by:
writeText
in classTransducedAccessor<T>
- Throws:
AccessorException
SAXException
IOException
XMLStreamException
-
-