Top Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.model.impl

pack-priv final Class RuntimeEnumLeafInfoImpl<T extends Enum<T>, B>

extends EnumLeafInfoImpl<Type, Class<T>, Field, Method>
implements RuntimeEnumLeafInfo, Transducer<T extends Enum<T>>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.Transducer, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeEnumLeafInfo, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeTypeInfo, org.glassfish.jaxb.core.v2.model.core.TypeInfo, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.core.v2.model.core.NonElement, org.glassfish.jaxb.core.v2.model.core.LeafInfo, org.glassfish.jaxb.core.v2.model.core.MaybeElement, org.glassfish.jaxb.core.v2.model.core.EnumLeafInfo
Imports
org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.runtime.v2.model.annotation.FieldLocatable, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeEnumLeafInfo, .RuntimeNonElement, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, org.glassfish.jaxb.runtime.v2.runtime.Name, .Transducer, .XMLSerializer, org.xml.sax.SAXException, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, java.io.IOException, java.lang.reflect.Field, .Method, .Type, java.util.EnumMap, .HashMap, .Map

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final Transducer<B>
baseXducer

Transducer that knows how to convert a lexical value into the Java value that we can handle.

private final Map<B, T>
private final Map<T, B>
Inherited from org.glassfish.jaxb.runtime.v2.model.impl.EnumLeafInfoImpl:
baseTypeclazztokenStringType

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public RuntimeEnumConstantImpl
public void
declareNamespace(T t, XMLSerializer w)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Declares the namespace URIs used in the given value to w.

public Class<T>
public Transducer<T>
getTransducer()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getTransducer.

This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

public QName
getTypeName(T instance)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.

public QName[]
getTypeNames()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getTypeNames.

Returns all the type names recognized by this type for unmarshalling.

public T
parse(CharSequence lexical)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Converts the lexical representation to a value object.

public boolean
useNamespace()

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

If true, this doesn't declare any namespace, and therefore declareNamespace(Object, XMLSerializer) is no-op.

public void
public void
writeText(XMLSerializer w, T t, String fieldName)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Sends the result of the print(Object) operation to one of the XMLSerializer#text(String, String) method, but with the best representation of the value, not necessarily String.

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.EnumLeafInfoImpl:
asElementcalcConstantscanBeReferencedByIDREFgetBaseTypegetConstantsgetElementNamegetLocationgetScopegetSubstitutionHeadgetTypegetTypeNameisElementisSimpleTypeisTokeniteratorlink

Field Detail

baseXducerback to summary
private final Transducer<B> baseXducer

Transducer that knows how to convert a lexical value into the Java value that we can handle.

parseMapback to summary
private final Map<B, T> parseMap
printMapback to summary
private final Map<T, B> printMap

Constructor Detail

RuntimeEnumLeafInfoImplback to summary
pack-priv RuntimeEnumLeafInfoImpl(RuntimeModelBuilder builder, Locatable upstream, Class<T> enumType)

Method Detail

createEnumConstantback to summary
public RuntimeEnumConstantImpl createEnumConstant(String name, String literal, Field constant, EnumConstantImpl<Type, Class<T>, Field, Method> last)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.EnumLeafInfoImpl.createEnumConstant.

Annotations
@Override
declareNamespaceback to summary
public void declareNamespace(T t, XMLSerializer w) throws AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Declares the namespace URIs used in the given value to w.

Annotations
@Override
getClazzback to summary
public Class<T> getClazz()

Overrides org.glassfish.jaxb.runtime.v2.model.impl.EnumLeafInfoImpl.getClazz.

Implements org.glassfish.jaxb.core.v2.model.core.EnumLeafInfo.getClazz, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getClazz.

Doc from org.glassfish.jaxb.core.v2.model.core.EnumLeafInfo.getClazz.

The same as getType() but an is guaranteed to represent an enum declaration, which is a kind of a class declaration.

Annotations
@Override
getTransducerback to summary
public Transducer<T> getTransducer()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getTransducer.

Doc from org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement.getTransducer.

This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

Annotations
@Override
getTypeNameback to summary
public QName getTypeName(T instance)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.

Annotations
@Override
getTypeNamesback to summary
public QName[] getTypeNames()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getTypeNames.

Doc from org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeLeafInfo.getTypeNames.

Returns all the type names recognized by this type for unmarshalling.

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.

Annotations
@Override
parseback to summary
public T parse(CharSequence lexical) throws AccessorException, SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Converts the lexical representation to a value object.

Annotations
@Override
Exceptions
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.)
useNamespaceback to summary
public boolean useNamespace()

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

If true, this doesn't declare any namespace, and therefore declareNamespace(Object, XMLSerializer) is no-op. It also means that the parse(CharSequence) method won't use the context parameter.

Annotations
@Override
writeLeafElementback to summary
public void writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeLeafElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeLeafElement.

Sends the result of the print(Object) operation to one of the XMLSerializer#leafElement(Name, String, String) method. but with the best representation of the value, not necessarily String.

Annotations
@Override
writeTextback to summary
public void writeText(XMLSerializer w, T t, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Sends the result of the print(Object) operation to one of the XMLSerializer#text(String, String) method, but with the best representation of the value, not necessarily String.

Annotations
@Override