public static class TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT> extends TransducedAccessor<BeanT>
TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>| Modifier and Type | Field and Description |
|---|---|
protected Accessor<BeanT,ValueT> |
acc |
protected Transducer<ValueT> |
xducer |
| Constructor and Description |
|---|
CompositeTransducedAccessorImpl(JAXBContextImpl context,
Transducer<ValueT> xducer,
Accessor<BeanT,ValueT> acc) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasValue(BeanT bean)
Checks if the field has a value.
|
void |
parse(BeanT bean,
CharSequence lexical)
Parses the text value into the responsible field of the given bean.
|
CharSequence |
print(BeanT bean)
Prints the responsible field of the given bean to the writer.
|
void |
writeLeafElement(XMLSerializer w,
Name tagName,
BeanT o,
String fieldName)
Convenience method to write the value as a text inside an element
without any attributes.
|
void |
writeText(XMLSerializer w,
BeanT o,
String fieldName)
Invokes one of the
XMLSerializer.text(String, String) method
with the representation of data bested suited for this transduced accessor. |
declareNamespace, get, useNamespaceprotected final Transducer<ValueT> xducer
public CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc)
public CharSequence print(BeanT bean) throws AccessorException
TransducedAccessor
Use XMLSerializer.getInstance() to access to the namespace bindings
print in class TransducedAccessor<BeanT>AccessorExceptionpublic void parse(BeanT bean, CharSequence lexical) throws AccessorException, SAXException
TransducedAccessor
Use UnmarshallingContext.getInstance() to access to the namespace bindings
parse in class TransducedAccessor<BeanT>AccessorException - if the transducer is used to parse an user bean that uses XmlValue,
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.public boolean hasValue(BeanT bean) throws AccessorException
TransducedAccessorhasValue in class TransducedAccessor<BeanT>AccessorExceptionpublic void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException
TransducedAccessorThe callee assumes that there's an associated value in the field. No @xsi:type handling is expected.
writeLeafElement in class TransducedAccessor<BeanT>SAXExceptionAccessorExceptionIOExceptionXMLStreamExceptionpublic void writeText(XMLSerializer w, BeanT o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException
TransducedAccessorXMLSerializer.text(String, String) method
with the representation of data bested suited for this transduced accessor.writeText in class TransducedAccessor<BeanT>AccessorExceptionSAXExceptionIOExceptionXMLStreamExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.