Package com.sun.xml.bind.v2.runtime
Class MimeTypedTransducer<V>
- java.lang.Object
-
- com.sun.xml.bind.v2.runtime.FilterTransducer<V>
-
- com.sun.xml.bind.v2.runtime.MimeTypedTransducer<V>
-
- All Implemented Interfaces:
Transducer<V>
public final class MimeTypedTransducer<V> extends FilterTransducer<V>
Transducer
decorator that wraps anotherTransducer
and sets the expected MIME type to the context.Combined with
Transducer
implementations (such as one forImage
), this is used to control the marshalling of the BLOB types.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class com.sun.xml.bind.v2.runtime.FilterTransducer
core
-
-
Constructor Summary
Constructors Constructor Description MimeTypedTransducer(Transducer<V> core, javax.activation.MimeType expectedMimeType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.CharSequence
print(V o)
Converts the given value to its lexical representation.void
writeLeafElement(XMLSerializer w, Name tagName, V o, java.lang.String fieldName)
Sends the result of theTransducer.print(Object)
operation to one of theXMLSerializer.leafElement(Name, String, String)
method.void
writeText(XMLSerializer w, V o, java.lang.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 com.sun.xml.bind.v2.runtime.FilterTransducer
declareNamespace, getTypeName, parse, useNamespace
-
-
-
-
Constructor Detail
-
MimeTypedTransducer
public MimeTypedTransducer(Transducer<V> core, javax.activation.MimeType expectedMimeType)
-
-
Method Detail
-
print
public java.lang.CharSequence print(V o) throws AccessorException
Description copied from interface:Transducer
Converts the given value to its lexical representation.- Specified by:
print
in interfaceTransducer<V>
- Overrides:
print
in classFilterTransducer<V>
- Parameters:
o
- never be null.- Returns:
- always non-null valid lexical representation.
- Throws:
AccessorException
-
writeText
public void writeText(XMLSerializer w, V o, java.lang.String fieldName) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.stream.XMLStreamException, AccessorException
Description copied from interface:Transducer
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.- Specified by:
writeText
in interfaceTransducer<V>
- Overrides:
writeText
in classFilterTransducer<V>
- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
AccessorException
-
writeLeafElement
public void writeLeafElement(XMLSerializer w, Name tagName, V o, java.lang.String fieldName) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.stream.XMLStreamException, AccessorException
Description copied from interface:Transducer
Sends 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:
writeLeafElement
in interfaceTransducer<V>
- Overrides:
writeLeafElement
in classFilterTransducer<V>
- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
AccessorException
-
-