Module com.sun.xml.bind
Class TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.reflect.TransducedAccessor<BeanT>
-
- org.glassfish.jaxb.runtime.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 org.glassfish.jaxb.runtime.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 booleanhasValue(BeanT bean)Checks if the field has a value.voidparse(BeanT bean, CharSequence lexical)Parses the text value into the responsible field of the given bean.CharSequenceprint(BeanT bean)Prints the responsible field of the given bean to the writer.voidwriteLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName)Convenience method to write the value as a text inside an element without any attributes.voidwriteText(XMLSerializer w, BeanT 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, 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 CharSequence print(BeanT bean) throws AccessorException
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<BeanT>- Returns:
- if the accessor didn't yield a value, return null.
- Throws:
AccessorException
-
parse
public void parse(BeanT bean, CharSequence lexical) throws AccessorException, SAXException
Description copied from class:TransducedAccessorParses the text value into the responsible field of the given bean.Use
UnmarshallingContext.getInstance()to access to the namespace bindings- Specified by:
parsein 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.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:TransducedAccessorChecks if the field has a value.- Specified by:
hasValuein classTransducedAccessor<BeanT>- Throws:
AccessorException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, BeanT 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<BeanT>- Throws:
SAXExceptionAccessorExceptionIOExceptionXMLStreamException
-
writeText
public void writeText(XMLSerializer w, BeanT 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<BeanT>- Throws:
AccessorExceptionSAXExceptionIOExceptionXMLStreamException
-
-