Class TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
- java.lang.Object
-
- com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor<BeanT>
-
- com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
-
- Enclosing class:
- TransducedAccessor<BeanT>
public static class TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT> extends TransducedAccessor<BeanT>
-
-
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 CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasValue(BeanT bean)
Checks if the field has a value.void
parse(BeanT bean, java.lang.CharSequence lexical)
Parses the text value into the responsible field of the given bean.java.lang.CharSequence
print(BeanT bean)
Prints the responsible field of the given bean to the writer.void
writeLeafElement(XMLSerializer w, Name tagName, BeanT o, java.lang.String fieldName)
Convenience method to write the value as a text inside an element without any attributes.void
writeText(XMLSerializer w, BeanT o, java.lang.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, useNamespace
-
-
-
-
Field Detail
-
xducer
protected final Transducer<ValueT> xducer
-
-
Constructor Detail
-
CompositeTransducedAccessorImpl
public CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc)
-
-
Method Detail
-
print
public java.lang.CharSequence print(BeanT bean) throws AccessorException
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<BeanT>
- Returns:
- if the accessor didn't yield a value, return null.
- Throws:
AccessorException
-
parse
public void parse(BeanT bean, java.lang.CharSequence lexical) throws AccessorException, org.xml.sax.SAXException
Description copied from class:TransducedAccessor
Parses the text value into the responsible field of the given bean.Use
UnmarshallingContext.getInstance()
to access to the namespace bindings- Specified by:
parse
in classTransducedAccessor<BeanT>
- Throws:
AccessorException
- if the transducer is used to parse an user bean that usesXmlValue
, then this exception may occur when it tries to set the leaf value to the bean.org.xml.sax.SAXException
- if the parse method found an error, the error is reported, and then the processing is aborted.
-
hasValue
public boolean hasValue(BeanT bean) throws AccessorException
Description copied from class:TransducedAccessor
Checks if the field has a value.- Specified by:
hasValue
in classTransducedAccessor<BeanT>
- Throws:
AccessorException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, BeanT 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 classTransducedAccessor<BeanT>
- Throws:
org.xml.sax.SAXException
AccessorException
java.io.IOException
javax.xml.stream.XMLStreamException
-
writeText
public void writeText(XMLSerializer w, BeanT 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 theXMLSerializer.text(String, String)
method with the representation of data bested suited for this transduced accessor.- Specified by:
writeText
in classTransducedAccessor<BeanT>
- Throws:
AccessorException
org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException
-
-