Top Description Methods
com.sun.tools.xjc.api

public Interface S2JJAXBModel

extends JAXBModel
Known Direct Implementers
com.sun.tools.xjc.api.impl.s2j.JAXBModelImpl
Imports
java.util.Collection, .List, javax.xml.namespace.QName, jakarta.xml.bind.annotation.XmlSeeAlso, com.sun.codemodel.CodeWriter, .JCodeModel, .JClass, com.sun.tools.xjc.Options, .Plugin

JAXBModel that exposes additional information available only for the schema -> java direction.
Author
Kohsuke Kawaguchi

Method Summary

Modifier and TypeMethod and Description
public JCodeModel

Returns:

object filled with the generated code. Use JCodeModel#build(CodeWriter) to write them to a disk.
generateCode
(Plugin[]
The JAXB RI extensions to run. This can be null or empty array if the caller wishes not to run any extension.
Those specified extensions will participate in the code generation. Specifying an extension in this list has the same effect of turning that extension on via command line.
It is the caller's responsibility to configure each augmenter properly by using Plugin#parseArgument(Options, String[], int).
extensions
,
ErrorListener errorListener)

Generates artifacts.

public Mapping

Returns:

null if the element name is not a defined global element in the schema.
get
(QName elementName)

Gets a Mapping object for the given global element.

public List<JClass>
getAllObjectFactories()

Gets all the ObjectFactory classes generated by the compilation.

public TypeAndAnnotation

Returns:

null if the XML type is not bound to any Java type.
getJavaType
(QName
must not be null.
xmlTypeName
)

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

public Collection<? extends Mapping>
getMappings()

Gets a read-only view of all the Mappings.

Inherited from com.sun.tools.xjc.api.JAXBModel:
getClassList

Method Detail

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

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.

Parameters
extensions:Plugin[]

The JAXB RI extensions to run. This can be null or empty array if the caller wishes not to run any extension.
Those specified extensions will participate in the code generation. Specifying an extension in this list has the same effect of turning that extension on via command line.
It is the caller's responsibility to configure each augmenter properly by using Plugin#parseArgument(Options, String[], int).

Returns:JCodeModel

object filled with the generated code. Use JCodeModel#build(CodeWriter) to write them to a disk.

getback to summary
public Mapping get(QName elementName)

Gets a Mapping object for the given global element.

Returns:Mapping

null if the element name is not a defined global element in the schema.

getAllObjectFactoriesback to summary
public List<JClass> getAllObjectFactories()

Gets all the ObjectFactory classes generated by the compilation.

This should be used for generating XmlSeeAlso on the SEI.

getJavaTypeback to summary
public TypeAndAnnotation getJavaType(QName xmlTypeName)

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

Parameters
xmlTypeName:QName

must not be null.

Returns:TypeAndAnnotation

null if the XML type is not bound to any Java type.

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

Gets a read-only view of all the Mappings.