- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer<V>
-
- org.glassfish.jaxb.runtime.v2.runtime.MimeTypedTransducer<V>
-
- All Implemented Interfaces:
Transducer<V>
public final class MimeTypedTransducer<V> extends FilterTransducer<V>
Transducerdecorator that wraps anotherTransducerand sets the expected MIME type to the context.Combined with
Transducerimplementations (such as one forImage), this is used to control the marshalling of the BLOB types.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer
core
-
-
Constructor Summary
Constructors Constructor Description MimeTypedTransducer(Transducer<V> core, jakarta.activation.MimeType expectedMimeType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequenceprint(V o)Converts the given value to its lexical representation.voidwriteLeafElement(XMLSerializer w, Name tagName, V o, String fieldName)Sends the result of theTransducer.print(Object)operation to one of theXMLSerializer.leafElement(Name, String, String)method.voidwriteText(XMLSerializer w, V o, String fieldName)Sends the result of theTransducer.print(Object)operation to one of theXMLSerializer.text(String, String)method, but with the best representation of the value, not necessarily String.-
Methods inherited from class org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer
declareNamespace, getTypeName, parse, useNamespace
-
-
-
-
Constructor Detail
-
MimeTypedTransducer
public MimeTypedTransducer(Transducer<V> core, jakarta.activation.MimeType expectedMimeType)
-
-
Method Detail
-
print
public CharSequence print(V o) throws AccessorException
Description copied from interface:TransducerConverts the given value to its lexical representation.- Specified by:
printin interfaceTransducer<V>- Overrides:
printin classFilterTransducer<V>- Parameters:
o- never be null.- Returns:
- always non-null valid lexical representation.
- Throws:
AccessorException
-
writeText
public void writeText(XMLSerializer w, V o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException
Description copied from interface:TransducerSends the result of theTransducer.print(Object)operation to one of theXMLSerializer.text(String, String)method, but with the best representation of the value, not necessarily String.- Specified by:
writeTextin interfaceTransducer<V>- Overrides:
writeTextin classFilterTransducer<V>- Throws:
IOExceptionSAXExceptionXMLStreamExceptionAccessorException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, V o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException
Description copied from interface:TransducerSends the result of theTransducer.print(Object)operation to one of theXMLSerializer.leafElement(Name, String, String)method. but with the best representation of the value, not necessarily String.- Specified by:
writeLeafElementin interfaceTransducer<V>- Overrides:
writeLeafElementin classFilterTransducer<V>- Throws:
IOExceptionSAXExceptionXMLStreamExceptionAccessorException
-
-