|
||||||||||
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<Type,Class,Field,Method>
com.sun.xml.bind.v2.model.impl.RuntimeEnumLeafInfoImpl<T,B>
final class RuntimeEnumLeafInfoImpl<T extends 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,
Class<T> enumType)
|
Method Summary | |
---|---|
RuntimeEnumConstantImpl |
createEnumConstant(String name,
String literal,
Field constant,
EnumConstantImpl<Type,Class,Field,Method> last)
|
void |
declareNamespace(T t,
XMLSerializer w)
Declares the namespace URIs used in the given value to w . |
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.) |
QName |
getTypeName(T instance)
Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar ,
an instance may choose different XML types. |
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(CharSequence lexical)
Converts the lexical representation to a value object. |
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,
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,
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, Class<T> enumType)
Method Detail |
---|
public Transducer<T> getTransducer()
RuntimeLeafInfo
RuntimeNonElementRef
into account (such as ID-ness.)
getTransducer
in interface RuntimeLeafInfo
getTransducer
in interface RuntimeNonElement
RuntimeNonElementRef.getTransducer()
public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type,Class,Field,Method> last)
createEnumConstant
in class EnumLeafInfoImpl<Type,Class,Field,Method>
public 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 RuntimeLeafInfo
public boolean isDefault()
Transducer
Transducer
is the default transducer for the ValueT
,
this method returns true.
Used exclusively by OptimizedTransducedAccessorFactory.get(RuntimePropertyInfo)
isDefault
in interface Transducer<T extends Enum<T>>
public Class getClazz()
EnumLeafInfo
TypeInfo.getType()
but an EnumLeafInfo
is guaranteed to represent an enum declaration, which is a
kind of a class declaration.
getClazz
in interface EnumLeafInfo<Type,Class>
getClazz
in interface RuntimeLeafInfo
getClazz
in class EnumLeafInfoImpl<Type,Class,Field,Method>
public boolean useNamespace()
Transducer
Transducer
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 Enum<T>>
public void declareNamespace(T t, XMLSerializer w) throws AccessorException
Transducer
w
.
declareNamespace
in interface Transducer<T extends Enum<T>>
t
- never be null.w
- may be null if !{@link #useNamespace()}
.
AccessorException
public CharSequence print(T t) throws AccessorException
Transducer
print
in interface Transducer<T extends Enum<T>>
t
- never be null.
AccessorException
public T parse(CharSequence lexical) throws AccessorException, SAXException
Transducer
parse
in interface Transducer<T extends 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.
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, String fieldName) throws IOException, SAXException, javax.xml.stream.XMLStreamException, AccessorException
Transducer
Transducer.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 Enum<T>>
IOException
SAXException
javax.xml.stream.XMLStreamException
AccessorException
public void writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName) throws IOException, SAXException, javax.xml.stream.XMLStreamException, AccessorException
Transducer
Transducer.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 Enum<T>>
IOException
SAXException
javax.xml.stream.XMLStreamException
AccessorException
public QName getTypeName(T instance)
Transducer
XMLGregorianCalendar
,
an instance may choose different XML types.
getTypeName
in interface Transducer<T extends Enum<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |