Module com.sun.xml.bind
Class DefaultTransducedAccessor<T>
- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.reflect.TransducedAccessor<T>
-
- org.glassfish.jaxb.runtime.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>
TransducedAccessorthat prints toString.The print method that works for
Stringdetermines 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 org.glassfish.jaxb.runtime.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 Stringprint(T o)Prints the responsible field of the given bean to the writer.voidwriteLeafElement(XMLSerializer w, Name tagName, T o, String fieldName)Convenience method to write the value as a text inside an element without any attributes.voidwriteText(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 org.glassfish.jaxb.runtime.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:TransducedAccessorPrints the responsible field of the given bean to the writer.Use
XMLSerializer.getInstance()to access to the namespace bindings- Specified by:
printin classTransducedAccessor<T>- Returns:
- if the accessor didn't yield a value, return null.
- Throws:
AccessorExceptionSAXException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException
Description copied from class:TransducedAccessorConvenience 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:
writeLeafElementin classTransducedAccessor<T>- Throws:
SAXExceptionAccessorExceptionIOExceptionXMLStreamException
-
writeText
public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException
Description copied from class:TransducedAccessorInvokes one of theXMLSerializer.text(String, String)method with the representation of data bested suited for this transduced accessor.- Specified by:
writeTextin classTransducedAccessor<T>- Throws:
AccessorExceptionSAXExceptionIOExceptionXMLStreamException
-
-