Package com.sun.tools.xjc.generator.bean
Class BeanGenerator
java.lang.Object
com.sun.tools.xjc.generator.bean.BeanGenerator
- All Implemented Interfaces:
Outline
Generates fields and accessors.
-
Method Summary
Modifier and TypeMethodDescriptionaddRuntime
(Class<?> clazz) Copies the specified class into the user's package and returns a reference to it.static Outline
generate
(Model model, ErrorReceiver _errorReceiver) Generates beans into code model according to the BGM, and produces the reflection model.void
generateAdapterIfNecessary
(CPropertyInfo prop, JAnnotatable field) GeneratesXmlJavaTypeAdapter
fromPropertyInfo
if necessary.generateStaticClass
(Class<?> src, JPackage out) Iterable<? extends PackageOutline>
Gets all package-wise contexts at once.Returns all theClassOutline
s known to this object.Gets a reference tonew CodeModelClassFactory(getErrorHandler())
.getClazz
(CClassInfo bean) Obtains per-class context information.Short forgetModel().codeModel
.getContainer
(CClassInfoParent parent, Aspect aspect) If theCElementInfo
generates a class, returns such a class.getEnum
(CEnumLeafInfo eli) getEnums()
Gets all theEnumOutline
s.Any error during the back-end proccessing should be sent to this object.getField
(CPropertyInfo prop) Gets the object that wraps the generated field for a givenCPropertyInfo
.getModel()
This outline is for this model.Gets per-package context information.JPackage[]
getUsedPackages
(Aspect aspect) Returns all used JPackages.Resolves a type reference to the actual (possibly generated) type.
-
Method Details
-
generate
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.)
-
getModel
Description copied from interface:Outline
This outline is for this model. -
getCodeModel
Description copied from interface:Outline
Short forgetModel().codeModel
.- Specified by:
getCodeModel
in interfaceOutline
-
getContainer
- Specified by:
getContainer
in interfaceOutline
-
resolve
Description copied from interface:Outline
Resolves a type reference to the actual (possibly generated) type. Short forresolve(ref.getType(),aspect)
. -
getUsedPackages
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.
-
getErrorReceiver
Description copied from interface:Outline
Any error during the back-end proccessing should be sent to this object.- Specified by:
getErrorReceiver
in interfaceOutline
-
getClassFactory
Description copied from interface:Outline
Gets a reference tonew CodeModelClassFactory(getErrorHandler())
.- Specified by:
getClassFactory
in interfaceOutline
-
getPackageContext
Description copied from interface:Outline
Gets per-package context information. This method works for every visible package (those packages which are supposed to be used by client applications.)- Specified by:
getPackageContext
in interfaceOutline
- Returns:
- If this grammar doesn't produce anything in the specified package, return null.
-
getClasses
Description copied from interface:Outline
Returns all theClassOutline
s known to this object.- Specified by:
getClasses
in interfaceOutline
-
getClazz
Description copied from interface:Outline
Obtains per-class context information. -
getElement
Description copied from interface:Outline
If theCElementInfo
generates a class, returns such a class. Otherwise return null.- Specified by:
getElement
in interfaceOutline
-
getEnum
-
getEnums
Description copied from interface:Outline
Gets all theEnumOutline
s. -
getAllPackageContexts
Description copied from interface:Outline
Gets all package-wise contexts at once.- Specified by:
getAllPackageContexts
in interfaceOutline
-
getField
Description copied from interface:Outline
Gets the object that wraps the generated field for a givenCPropertyInfo
. -
generateAdapterIfNecessary
GeneratesXmlJavaTypeAdapter
fromPropertyInfo
if necessary. Also generates other per-property annotations (such asXmlID
,XmlIDREF
, andXmlMimeType
if necessary. -
addRuntime
Description copied from interface:Outline
Copies the specified class into the user's package and returns a reference to it.- Specified by:
addRuntime
in interfaceOutline
-
generateStaticClass
-