Top Description Fields Constructors Methods
com.sun.tools.xjc.generator.bean

pack-priv abstract Class ObjectFactoryGeneratorImpl

extends ObjectFactoryGenerator
Class Inheritance
Known Direct Subclasses
com.sun.tools.xjc.generator.bean.PrivateObjectFactoryGenerator, com.sun.tools.xjc.generator.bean.PublicObjectFactoryGenerator
Imports
java.util.Collection, .HashMap, .Map, jakarta.xml.bind.JAXBException, jakarta.xml.bind.annotation.XmlInlineBinaryData, javax.xml.namespace.QName, com.sun.codemodel.JClass, .JCodeModel, .JDefinedClass, .JExpr, .JExpression, .JFieldVar, .JInvocation, .JMethod, .JMod, .JPackage, .JType, .JVar, com.sun.tools.xjc.generator.annotation.spec.XmlElementDeclWriter, .XmlRegistryWriter, com.sun.tools.xjc.model.CElementInfo, .CPropertyInfo, .Constructor, .Model, com.sun.tools.xjc.outline.Aspect, .FieldAccessor, .FieldOutline, org.glassfish.jaxb.core.v2.TODO

Generates ObjectFactory then wraps it and provides access to it.

The ObjectFactory contains factory methods for each schema derived content class

Author
Ryan Shoemaker

Field Summary

Modifier and TypeField and Description
private final JClass
classRef

Ref to Class.

private final JCodeModel
private final Map<String, CElementInfo>
elementFactoryNames

Names of the element factory methods that are created.

private final Model
private final JDefinedClass
objectFactory

Reference to the generated ObjectFactory class.

private final BeanGenerator
private final HashMap<QName, JFieldVar>
qnameMap

map of qname to the QName constant field.

private final Map<String, ClassOutlineImpl>
valueFactoryNames

Names of the value factory methods that are created.

Constructor Summary

AccessConstructor and Description
public
ObjectFactoryGeneratorImpl(BeanGenerator outline, Model model, JPackage targetPackage)

Method Summary

Modifier and TypeMethod and Description
private static String
camelize(String s)

Change the first character to the lower case.

private JInvocation
createQName(QName name)

Generates an expression that evaluates to "new QName(...)"

public JDefinedClass
getObjectFactory()

Implements abstract com.sun.tools.xjc.generator.bean.ObjectFactoryGenerator.getObjectFactory.

Returns a reference to the generated (public) ObjectFactory

private JExpression
getQNameInvocation(CElementInfo ei)

return a JFieldVar that represents the QName field for the given information.

protected final void
populate(CElementInfo ei, Aspect impl, Aspect exposed)

Adds code for the given CElementInfo to ObjectFactory.

protected final void
Inherited from com.sun.tools.xjc.generator.bean.ObjectFactoryGenerator:
populatepopulate

Field Detail

classRefback to summary
private final JClass classRef

Ref to Class.

codeModelback to summary
private final JCodeModel codeModel
elementFactoryNamesback to summary
private final Map<String, CElementInfo> elementFactoryNames

Names of the element factory methods that are created. Used to detect collisions. The value is used for reporting error locations.

modelback to summary
private final Model model
objectFactoryback to summary
private final JDefinedClass objectFactory

Reference to the generated ObjectFactory class.

outlineback to summary
private final BeanGenerator outline
qnameMapback to summary
private final HashMap<QName, JFieldVar> qnameMap

map of qname to the QName constant field.

valueFactoryNamesback to summary
private final Map<String, ClassOutlineImpl> valueFactoryNames

Names of the value factory methods that are created. Used to detect collisions. The value is used for reporting error locations.

Constructor Detail

ObjectFactoryGeneratorImplback to summary
public ObjectFactoryGeneratorImpl(BeanGenerator outline, Model model, JPackage targetPackage)

Method Detail

camelizeback to summary
private static String camelize(String s)

Change the first character to the lower case.

createQNameback to summary
private JInvocation createQName(QName name)

Generates an expression that evaluates to "new QName(...)"

getObjectFactoryback to summary
public JDefinedClass getObjectFactory()

Implements abstract com.sun.tools.xjc.generator.bean.ObjectFactoryGenerator.getObjectFactory.

Returns a reference to the generated (public) ObjectFactory

Annotations
@Override
getQNameInvocationback to summary
private JExpression getQNameInvocation(CElementInfo ei)

return a JFieldVar that represents the QName field for the given information. if it doesn't exist, create a static field in the class and store a new JFieldVar.

populateback to summary
protected final void populate(CElementInfo ei, Aspect impl, Aspect exposed)

Adds code for the given CElementInfo to ObjectFactory.

populateback to summary
protected final void populate(ClassOutlineImpl cc, JClass sigType)