com.sun.tools.xjc.generator.bean

Class BeanGenerator

public final class BeanGenerator extends Object implements Outline

Generates fields and accessors.
Field Summary
Map<CElementInfo,ElementOutlineImpl>elements
elements that generate classes to the generated classes.
Method Summary
JClassaddRuntime(Class clazz)
static Outlinegenerate(Model model, ErrorReceiver _errorReceiver)
Generates beans into code model according to the BGM, and produces the reflection model.
voidgenerateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field)
Generates XmlJavaTypeAdapter from PropertyInfo if necessary.
voidgenerateClassList()
Generates a class that knows how to create an instance of JAXBContext

This is used in the debug mode so that a new properly configured JAXBContext object can be used.

JClassgenerateStaticClass(Class src, JPackage out)
Iterable<? extends PackageOutline>getAllPackageContexts()
Collection<ClassOutlineImpl>getClasses()
CodeModelClassFactorygetClassFactory()
ClassOutlineImplgetClazz(CClassInfo bean)
JCodeModelgetCodeModel()
JClassContainergetContainer(CClassInfoParent parent, Aspect aspect)
ElementOutlineImplgetElement(CElementInfo ei)
EnumOutlinegetEnum(CEnumLeafInfo eli)
Collection<EnumOutline>getEnums()
ErrorReceivergetErrorReceiver()
FieldOutlinegetField(CPropertyInfo prop)
ModelgetModel()
PackageOutlineImplgetPackageContext(JPackage p)
JPackage[]getUsedPackages(Aspect aspect)
Returns all used JPackages.
JTyperesolve(CTypeRef ref, Aspect a)

Field Detail

elements

final Map<CElementInfo,ElementOutlineImpl> elements
elements that generate classes to the generated classes.

Method Detail

addRuntime

public final JClass addRuntime(Class clazz)

generate

public static Outline generate(Model model, ErrorReceiver _errorReceiver)
Generates beans into code model according to the BGM, and produces the reflection model.

Parameters: _errorReceiver This object will receive all the errors discovered during the back-end stage.

Returns: returns a Outline which will in turn be used to further generate marshaller/unmarshaller, or null if the processing fails (errors should have been reported to the error recevier.)

generateAdapterIfNecessary

public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field)
Generates XmlJavaTypeAdapter from PropertyInfo if necessary. Also generates other per-property annotations (such as XmlID, XmlIDREF, and XmlMimeType if necessary.

generateClassList

void generateClassList()
Generates a class that knows how to create an instance of JAXBContext

This is used in the debug mode so that a new properly configured JAXBContext object can be used.

generateStaticClass

public JClass generateStaticClass(Class src, JPackage out)

getAllPackageContexts

public Iterable<? extends PackageOutline> getAllPackageContexts()

getClasses

public Collection<ClassOutlineImpl> getClasses()

getClassFactory

public CodeModelClassFactory getClassFactory()

getClazz

public ClassOutlineImpl getClazz(CClassInfo bean)

getCodeModel

public JCodeModel getCodeModel()

getContainer

public JClassContainer getContainer(CClassInfoParent parent, Aspect aspect)

getElement

public ElementOutlineImpl getElement(CElementInfo ei)

getEnum

public EnumOutline getEnum(CEnumLeafInfo eli)

getEnums

public Collection<EnumOutline> getEnums()

getErrorReceiver

public ErrorReceiver getErrorReceiver()

getField

public FieldOutline getField(CPropertyInfo prop)

getModel

public Model getModel()

getPackageContext

public PackageOutlineImpl getPackageContext(JPackage p)

getUsedPackages

public final JPackage[] getUsedPackages(Aspect aspect)
Returns all used JPackages. A JPackage is considered as "used" if a ClassItem or a InterfaceItem resides in that package. This value is dynamically calculated every time because one can freely remove ClassItem/InterfaceItem.

Returns: Given the same input, the order of packages in the array is always the same regardless of the environment.

resolve

public final JType resolve(CTypeRef ref, Aspect a)