|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.bind.v2.model.impl.TypeInfoImpl<T,C,F,M>
com.sun.xml.bind.v2.model.impl.EnumLeafInfoImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
com.sun.xml.bind.v2.model.impl.RuntimeEnumLeafInfoImpl<T,B>
final class RuntimeEnumLeafInfoImpl<T extends java.lang.Enum<T>,B>
| Field Summary |
|---|
| Fields inherited from class com.sun.xml.bind.v2.model.impl.EnumLeafInfoImpl |
|---|
baseType, clazz |
| Fields inherited from class com.sun.xml.bind.v2.model.impl.TypeInfoImpl |
|---|
builder, owner |
| Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement |
|---|
ANYTYPE_NAME |
| Constructor Summary | |
|---|---|
RuntimeEnumLeafInfoImpl(RuntimeModelBuilder builder,
Locatable upstream,
java.lang.Class<T> enumType)
|
|
| Method Summary | |
|---|---|
RuntimeEnumConstantImpl |
createEnumConstant(java.lang.String name,
java.lang.String literal,
java.lang.reflect.Field constant,
EnumConstantImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method> last)
|
void |
declareNamespace(T t,
XMLSerializer w)
Declares the namespace URIs used in the given value to w. |
java.lang.Class |
getClazz()
The same as TypeInfo.getType() but an EnumLeafInfo
is guaranteed to represent an enum declaration, which is a
kind of a class declaration. |
Transducer<T> |
getTransducer()
This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.) |
javax.xml.namespace.QName |
getTypeName(T instance)
Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar,
an instance may choose different XML types. |
javax.xml.namespace.QName[] |
getTypeNames()
Returns all the type names recognized by this type for unmarshalling. |
boolean |
isDefault()
If this Transducer is the default transducer for the ValueT,
this method returns true. |
T |
parse(java.lang.CharSequence lexical)
Converts the lexical representation to a value object. |
java.lang.CharSequence |
print(T t)
Converts the given value to its lexical representation. |
boolean |
useNamespace()
If true, this Transducer doesn't declare any namespace,
and therefore Transducer.declareNamespace(Object, XMLSerializer) is no-op. |
void |
writeLeafElement(XMLSerializer w,
Name tagName,
T o,
java.lang.String fieldName)
Sends the result of the Transducer.print(Object) operation
to one of the XMLSerializer.leafElement(Name, String, String) method. |
void |
writeText(XMLSerializer w,
T t,
java.lang.String fieldName)
Sends the result of the Transducer.print(Object) operation
to one of the XMLSerializer.text(String, String) method,
but with the best representation of the value, not necessarily String. |
| Methods inherited from class com.sun.xml.bind.v2.model.impl.EnumLeafInfoImpl |
|---|
asElement, calcConstants, canBeReferencedByIDREF, getBaseType, getConstants, getElementName, getLocation, getScope, getSubstitutionHead, getType, getTypeName, isElement, isSimpleType, iterator, link |
| Methods inherited from class com.sun.xml.bind.v2.model.impl.TypeInfoImpl |
|---|
getUpstream, nav, parseElementName, parseTypeName, parseTypeName, reader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.xml.bind.v2.model.core.EnumLeafInfo |
|---|
getBaseType, getConstants |
| Methods inherited from interface com.sun.xml.bind.v2.model.core.MaybeElement |
|---|
asElement, getElementName, isElement |
| Methods inherited from interface com.sun.xml.bind.v2.model.core.NonElement |
|---|
getTypeName, isSimpleType |
| Methods inherited from interface com.sun.xml.bind.v2.model.core.TypeInfo |
|---|
canBeReferencedByIDREF, getType |
| Methods inherited from interface com.sun.xml.bind.v2.model.annotation.Locatable |
|---|
getLocation, getUpstream |
| Constructor Detail |
|---|
RuntimeEnumLeafInfoImpl(RuntimeModelBuilder builder,
Locatable upstream,
java.lang.Class<T> enumType)
| Method Detail |
|---|
public Transducer<T> getTransducer()
RuntimeLeafInfoRuntimeNonElementRef into account (such as ID-ness.)
getTransducer in interface RuntimeLeafInfogetTransducer in interface RuntimeNonElementRuntimeNonElementRef.getTransducer()
public RuntimeEnumConstantImpl createEnumConstant(java.lang.String name,
java.lang.String literal,
java.lang.reflect.Field constant,
EnumConstantImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method> last)
createEnumConstant in class EnumLeafInfoImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>public javax.xml.namespace.QName[] getTypeNames()
RuntimeLeafInfo
While conceptually this method belongs to RuntimeNonElement,
if we do that we have to put a lot of dummy implementations everywhere,
so it's placed here, where it's actually needed.
getTypeNames in interface RuntimeLeafInfopublic boolean isDefault()
TransducerTransducer is the default transducer for the ValueT,
this method returns true.
Used exclusively by OptimizedTransducedAccessorFactory.get(RuntimePropertyInfo)
isDefault in interface Transducer<T extends java.lang.Enum<T>>public java.lang.Class getClazz()
EnumLeafInfoTypeInfo.getType() but an EnumLeafInfo
is guaranteed to represent an enum declaration, which is a
kind of a class declaration.
getClazz in interface EnumLeafInfo<java.lang.reflect.Type,java.lang.Class>getClazz in interface RuntimeLeafInfogetClazz in class EnumLeafInfoImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>public boolean useNamespace()
TransducerTransducer doesn't declare any namespace,
and therefore Transducer.declareNamespace(Object, XMLSerializer) is no-op.
It also means that the Transducer.parse(CharSequence) method
won't use the context parameter.
useNamespace in interface Transducer<T extends java.lang.Enum<T>>
public void declareNamespace(T t,
XMLSerializer w)
throws AccessorException
Transducerw.
declareNamespace in interface Transducer<T extends java.lang.Enum<T>>t - never be null.w - may be null if !{@link #useNamespace()}.
AccessorException
public java.lang.CharSequence print(T t)
throws AccessorException
Transducer
print in interface Transducer<T extends java.lang.Enum<T>>t - never be null.
AccessorException
public T parse(java.lang.CharSequence lexical)
throws AccessorException,
org.xml.sax.SAXException
Transducer
parse in interface Transducer<T extends java.lang.Enum<T>>lexical - never be null.
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 lexical form is incorrect, the error should be reported
and SAXException may thrown (or it can return null to recover.)
public void writeText(XMLSerializer w,
T t,
java.lang.String fieldName)
throws java.io.IOException,
org.xml.sax.SAXException,
javax.xml.stream.XMLStreamException,
AccessorException
TransducerTransducer.print(Object) operation
to one of the XMLSerializer.text(String, String) method,
but with the best representation of the value, not necessarily String.
writeText in interface Transducer<T extends java.lang.Enum<T>>java.io.IOException
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
AccessorException
public void writeLeafElement(XMLSerializer w,
Name tagName,
T o,
java.lang.String fieldName)
throws java.io.IOException,
org.xml.sax.SAXException,
javax.xml.stream.XMLStreamException,
AccessorException
TransducerTransducer.print(Object) operation
to one of the XMLSerializer.leafElement(Name, String, String) method.
but with the best representation of the value, not necessarily String.
writeLeafElement in interface Transducer<T extends java.lang.Enum<T>>java.io.IOException
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
AccessorExceptionpublic javax.xml.namespace.QName getTypeName(T instance)
TransducerXMLGregorianCalendar,
an instance may choose different XML types.
getTypeName in interface Transducer<T extends java.lang.Enum<T>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||