public class QNameTranslator extends IllegalArgumentExceptionSimpleValueTranslator<QName>
QName
. If an instance of XMLReaderStreamDataProvider
is specified when calling a
parser method, the namespace related to a possible prefix will be determined. Otherwise XMLConstants.NULL_NS_URI
will be
set by default.MAX_STRING_REPRESENTATION_LENGTH
Constructor and Description |
---|
QNameTranslator() |
Modifier and Type | Method and Description |
---|---|
Class<QName> |
getObjectClass()
Returns the Java class of object instances created by this translator.
|
String |
javaToRepresentation(Object object,
WriterStreamDataProvider<?> streamDataProvider)
Converts the object by invoking its
Object.toString() method. |
protected QName |
parseValue(String representation,
ReaderStreamDataProvider<?> streamDataProvider) |
representationToJava
hasStringRepresentation, readXMLRepresentation, writeXMLRepresentation
equals, hashCode
public QNameTranslator()
public Class<QName> getObjectClass()
ObjectTranslator
Note that ObjectTranslator.javaToRepresentation(Object, WriterStreamDataProvider)
and ObjectTranslator.writeXMLRepresentation(XMLStreamWriter, Object, WriterStreamDataProvider)
may also
accept instances of other classes. This is independent from the return value here.
protected QName parseValue(String representation, ReaderStreamDataProvider<?> streamDataProvider) throws IllegalArgumentException
parseValue
in class IllegalArgumentExceptionSimpleValueTranslator<QName>
IllegalArgumentException
public String javaToRepresentation(Object object, WriterStreamDataProvider<?> streamDataProvider) throws UnsupportedOperationException, ClassCastException
SimpleValueTranslator
Object.toString()
method.javaToRepresentation
in interface ObjectTranslator<QName>
javaToRepresentation
in class SimpleValueTranslator<QName>
object
- the object to be convertedstreamDataProvider
- TODOUnsupportedOperationException
- if objects handled by this instance can only be represented as XMLClassCastException
- if the specified object is not an instance of the supported class or does not implement the supported
interfaceObjectTranslator.javaToRepresentation(java.lang.Object, WriterStreamDataProvider)