Top Description Fields Constructors Methods
com.sun.tools.xjc.api.impl.s2j

pack-priv final Class JAXBModelImpl

extends Object
implements S2JJAXBModel
Class Inheritance
All Implemented Interfaces
com.sun.tools.xjc.api.S2JJAXBModel, com.sun.tools.xjc.api.JAXBModel
Imports
java.util.ArrayList, .Collection, .HashMap, .List, .Map, javax.xml.namespace.QName, com.sun.codemodel.JCodeModel, .JClass, com.sun.tools.xjc.Plugin, com.sun.tools.xjc.api.ErrorListener, .JAXBModel, .Mapping, .S2JJAXBModel, .TypeAndAnnotation, com.sun.tools.xjc.model.CClassInfo, .CElementInfo, .Model, .TypeUse, com.sun.tools.xjc.outline.Outline, .PackageOutline

JAXBModel implementation.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final Map<QName, Mapping>
private final Model
model

All the known classes.

pack-priv final Outline

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public JCodeModel
generateCode(Plugin[] extensions, ErrorListener errorListener)

Implements com.sun.tools.xjc.api.S2JJAXBModel.generateCode.

Generates artifacts.

public Mapping
get(QName elementName)

Implements com.sun.tools.xjc.api.S2JJAXBModel.get.

Gets a Mapping object for the given global element.

public List<JClass>
getAllObjectFactories()

Implements com.sun.tools.xjc.api.S2JJAXBModel.getAllObjectFactories.

Gets all the ObjectFactory classes generated by the compilation.

public List<String>
getClassList()

Implements com.sun.tools.xjc.api.JAXBModel.getClassList.

Returns a list of fully-qualified class names, which should be used at the runtime to create a new JAXBContext.

public TypeAndAnnotation
getJavaType(QName xmlTypeName)

Implements com.sun.tools.xjc.api.S2JJAXBModel.getJavaType.

Returns the fully-qualified name of the Java type that is bound to the specified XML type.

public Collection<? extends Mapping>
getMappings()

Implements com.sun.tools.xjc.api.S2JJAXBModel.getMappings.

Gets a read-only view of all the Mappings.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byXmlNameback to summary
private final Map<QName, Mapping> byXmlName
modelback to summary
private final Model model

All the known classes.

outlineback to summary
pack-priv final Outline outline

Constructor Detail

JAXBModelImplback to summary
pack-priv JAXBModelImpl(Outline outline)

Method Detail

generateCodeback to summary
public JCodeModel generateCode(Plugin[] extensions, ErrorListener errorListener)

Implements com.sun.tools.xjc.api.S2JJAXBModel.generateCode.

Doc from com.sun.tools.xjc.api.S2JJAXBModel.generateCode.

Generates artifacts.

Todo

if JAXB supports various modes of code generations (such as public interface only or implementation only or etc), we should define bit flags to control those.

This operation is only supported for a model built from a schema.

Annotations
@Override
getback to summary
public Mapping get(QName elementName)

Implements com.sun.tools.xjc.api.S2JJAXBModel.get.

Doc from com.sun.tools.xjc.api.S2JJAXBModel.get.

Gets a Mapping object for the given global element.

Annotations
@Override
getAllObjectFactoriesback to summary
public List<JClass> getAllObjectFactories()

Implements com.sun.tools.xjc.api.S2JJAXBModel.getAllObjectFactories.

Doc from com.sun.tools.xjc.api.S2JJAXBModel.getAllObjectFactories.

Gets all the ObjectFactory classes generated by the compilation.

This should be used for generating XmlSeeAlso on the SEI.

Annotations
@Override
getClassListback to summary
public List<String> getClassList()

Implements com.sun.tools.xjc.api.JAXBModel.getClassList.

Doc from com.sun.tools.xjc.api.JAXBModel.getClassList.

Returns a list of fully-qualified class names, which should be used at the runtime to create a new JAXBContext.

Until the JAXB team fixes the bootstrapping issue, we have two bootstrapping methods. This one is to use a list of class names to call JAXBContext#newInstance(Class[]) method. If this method returns non-null, the caller is expected to use that method. This is meant to be a temporary workaround.

Annotations
@Override
@SuppressWarnings:deprecation
getJavaTypeback to summary
public TypeAndAnnotation getJavaType(QName xmlTypeName)

Implements com.sun.tools.xjc.api.S2JJAXBModel.getJavaType.

Doc from com.sun.tools.xjc.api.S2JJAXBModel.getJavaType.

Returns the fully-qualified name of the Java type that is bound to the specified XML type.

Annotations
@Override
getMappingsback to summary
public Collection<? extends Mapping> getMappings()

Implements com.sun.tools.xjc.api.S2JJAXBModel.getMappings.

Doc from com.sun.tools.xjc.api.S2JJAXBModel.getMappings.

Gets a read-only view of all the Mappings.

Annotations
@Override