com.sun.xml.bind.v2.runtime.reflect
Class TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>

java.lang.Object
  extended by com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor<BeanT>
      extended by 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>

Implementation of TransducedAccessor that simply combines a Transducer and Accessor.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor
TransducedAccessor.CompositeTransducedAccessorImpl<BeanT,ValueT>
 
Field Summary
protected  Accessor<BeanT,ValueT> acc
           
protected  Transducer<ValueT> xducer
           
 
Constructor Summary
TransducedAccessor.CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc)
           
 
Method Summary
 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 the XMLSerializer.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xducer

protected final Transducer<ValueT> xducer

acc

protected final Accessor<BeanT,ValueT> acc
Constructor Detail

TransducedAccessor.CompositeTransducedAccessorImpl

public TransducedAccessor.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 class TransducedAccessor<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 class TransducedAccessor<BeanT>
Throws:
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.
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 class TransducedAccessor<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 class TransducedAccessor<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 the XMLSerializer.text(String, String) method with the representation of data bested suited for this transduced accessor.

Specified by:
writeText in class TransducedAccessor<BeanT>
Throws:
AccessorException
org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException