Accessor and Transducer combined into one object.
This allows efficient conversions between primitive values and String without using boxing.
This abstraction only works for a single-value property.
An instance of TransducedAccessor implicitly holds a
field of the BeanT that the accessors access.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| public static class | TransducedAccessor.
Implementation of |
| private static class |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | declareNamespace(BeanT o, XMLSerializer w)
Obtain the value of the field and declares the namespace URIs used in the value. |
| public static <T> TransducedAccessor | get(JAXBContextImpl context, RuntimeNonElementRef ref)
Gets the appropriately configured for the given property. |
| public abstract boolean | |
| public abstract void | parse(BeanT o, CharSequence lexical)
Parses the text value into the responsible field of the given bean. |
| public abstract CharSequence | Returns: if the accessor didn't yield a value, return null.Prints the responsible field of the given bean to the writer. |
| public boolean | |
| public abstract 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. |
| public abstract void | writeText(XMLSerializer w, BeanT o, String fieldName)
Invokes one of the |
| TransducedAccessor | back to summary |
|---|---|
| protected TransducedAccessor() Default constructor. | |
| declareNamespace | back to summary |
|---|---|
| public void declareNamespace(BeanT o, XMLSerializer w) throws AccessorException, SAXException Obtain the value of the field and declares the namespace URIs used in the value. | |
| get | back to summary |
|---|---|
| public static <T> TransducedAccessor Gets the appropriately configured for the given property. This allows the implementation to use an optimized code. | |
| hasValue | back to summary |
|---|---|
| public abstract boolean hasValue(BeanT o) throws AccessorException Checks if the field has a value. | |
| parse | back to summary |
|---|---|
| public abstract void parse(BeanT o, CharSequence lexical) throws AccessorException, SAXException Parses the text value into the responsible field of the given bean.
Use
| |
| back to summary | |
|---|---|
| public abstract CharSequence print(BeanT o) throws AccessorException, SAXException Prints the responsible field of the given bean to the writer.
Use
| |
| useNamespace | back to summary |
|---|---|
public boolean useNamespace()
| |
| writeLeafElement | back to summary |
|---|---|
| public abstract void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException 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. | |
| writeText | back to summary |
|---|---|
| public abstract void writeText(XMLSerializer w, BeanT o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException Invokes one of the | |
| Access | Constructor and Description |
|---|---|
| public | CompositeContextDependentTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT, ValueT> acc)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | declareNamespace(BeanT bean, XMLSerializer w)
Overrides org. Obtain the value of the field and declares the namespace URIs used in the value. |
| public boolean | |
| public 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. |
| CompositeContextDependentTransducedAccessorImpl | back to summary |
|---|---|
| public CompositeContextDependentTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT, ValueT> acc) | |
| declareNamespace | back to summary |
|---|---|
| public void declareNamespace(BeanT bean, XMLSerializer w) throws AccessorException Overrides org. Doc from org. Obtain the value of the field and declares the namespace URIs used in the value.
| |
| useNamespace | back to summary |
|---|---|
| public boolean useNamespace() Overrides org.
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException Doc from org. 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected final Accessor | |
| protected final Transducer |
| Access | Constructor and Description |
|---|---|
| public | CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT, ValueT> acc)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | hasValue(BeanT bean)
Implements abstract org. Checks if the field has a value. |
| public void | parse(BeanT bean, CharSequence lexical)
Implements abstract org. Parses the text value into the responsible field of the given bean. |
| public CharSequence | print(BeanT bean)
Implements abstract org. Prints the responsible field of the given bean to the writer. |
| public void | writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName)
Implements abstract org. Convenience method to write the value as a text inside an element without any attributes. |
| public void | writeText(XMLSerializer w, BeanT o, String fieldName)
Implements abstract org. Invokes one of the |
| acc | back to summary |
|---|---|
| protected final Accessor<BeanT, ValueT> acc | |
| xducer | back to summary |
|---|---|
| protected final Transducer<ValueT> xducer | |
| CompositeTransducedAccessorImpl | back to summary |
|---|---|
| public CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT, ValueT> acc) | |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(BeanT bean) throws AccessorException Implements abstract org. Doc from org. Checks if the field has a value.
| |
| parse | back to summary |
|---|---|
| public void parse(BeanT bean, CharSequence lexical) throws AccessorException, SAXException Implements abstract org. Doc from org. Parses the text value into the responsible field of the given bean.
Use
| |
| back to summary | |
|---|---|
| public CharSequence print(BeanT bean) throws AccessorException Implements abstract org. Doc from org. Prints the responsible field of the given bean to the writer.
Use
| |
| writeLeafElement | back to summary |
|---|---|
| public void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException Implements abstract org. Doc from org. 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.
| |
| writeText | back to summary |
|---|---|
| public void writeText(XMLSerializer w, BeanT o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException Implements abstract org. Doc from org. Invokes one of the
| |
TransducedAccessor for IDREF.
BeanT: the type of the bean that contains this the IDREF field.
TargetT: the type of the bean pointed by IDREF.
| Modifier and Type | Field and Description |
|---|---|
| private final Accessor | |
| private final Class | targetType
The object that an IDREF resolves to should be assignable to this type. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | hasValue(BeanT bean)
Implements abstract org. Checks if the field has a value. |
| public void | parse(final BeanT bean, CharSequence lexical)
Implements abstract org. Parses the text value into the responsible field of the given bean. |
| public String | print(BeanT bean)
Implements abstract org. Prints the responsible field of the given bean to the writer. |
| acc | back to summary |
|---|---|
| private final Accessor<BeanT, TargetT> acc | |
| targetType | back to summary |
|---|---|
| private final Class<TargetT> targetType The object that an IDREF resolves to should be assignable to this type. | |
| IDREFTransducedAccessorImpl | back to summary |
|---|---|
| public IDREFTransducedAccessorImpl(Accessor<BeanT, TargetT> acc) | |
| assign | back to summary |
|---|---|
| private void assign(BeanT bean, TargetT t, UnmarshallingContext context) throws AccessorException | |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(BeanT bean) throws AccessorException Implements abstract org. Doc from org. Checks if the field has a value.
| |
| parse | back to summary |
|---|---|
| public void parse(final BeanT bean, CharSequence lexical) throws AccessorException, SAXException Implements abstract org. Doc from org. Parses the text value into the responsible field of the given bean.
Use
| |
| back to summary | |
|---|---|
| public String print(BeanT bean) throws AccessorException, SAXException Implements abstract org. Doc from org. Prints the responsible field of the given bean to the writer.
Use
| |