com.sun.tools.xjc.model

Class CClassInfo

public final class CClassInfo extends AbstractCElement implements ClassInfo<NType,NClass>, CClassInfoParent, CClass, NClass

Mutable ClassInfo represenatation.

Schema parsers build these objects.

Field Summary
CClassbaseClass
QNameelementName
If this class also gets XmlRootElement, the class name.
StringimplClass
Optional user-specified implementation override class.
Stringjavadoc
TODO: revisit this design. we should at least do a basic encapsulation to avoid careless mistakes.
Modelmodel
The Model object to which this bean belongs.
CClassInfoParentparent
StringshortName
short name.
StringsqueezedName
Custom squeezed name, if any.
Constructor Summary
CClassInfo(Model model, JPackage pkg, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)
CClassInfo(Model model, CClassInfoParent p, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)
CClassInfo(Model model, JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)
Method Summary
<T> Taccept(Visitor<T> visitor)
voidaddConstructor(String... fieldNames)
Creates a new constructor declaration and adds it.
voidaddProperty(CPropertyInfo prop)
Adds a new property.
Element<NType,NClass>asElement()
booleandeclaresAttributeWildcard()
Returns true if a new attribute wildcard property needs to be declared on this class.
StringfullName()
Returns the FQCN of this bean.
CClassInfogetBaseClass()
This inherited version returns null if this class extends from CClassRef.
NClassgetClazz()
Collection<? extends Constructor>getConstructors()
list all constructor declarations.
QNamegetElementName()
CNonElementgetInfo()
Guaranteed to return this.
StringgetName()
JPackagegetOwnerPackage()
List<CPropertyInfo>getProperties()
Returns a mutable list.
CPropertyInfogetProperty(String name)
Gets a propery by name.
CClassRefgetRefBaseClass()
CClassInfogetScope()
StringgetSqueezedName()
Returns the "squeezed name" of this bean token.
CClassInfogetSubstitutionHead()
NClassgetType()
QNamegetTypeName()
StringgetUserSpecifiedImplClass()
booleanhasAttributeWildcard()
voidhasAttributeWildcard(boolean hasAttributeWildcard)
booleanhasProperties()
booleanhasSubClasses()
booleanhasValueProperty()
booleaninheritsAttributeWildcard()
Returns true if this class inherits a wildcard attribute property from its ancestor classes.
booleanisBoxedType()
booleanisElement()
booleanisFinal()
booleanisOrdered()
booleanisSimpleType()
Iterator<CClassInfo>listSubclasses()
Enumerates all the sub-classes of this class.
CClassInfoParentparent()
voidsetBaseClass(CClass base)
This method accepts both CClassInfo (which means the base class is also generated), or CClassRef (which means the base class is already generated and simply referenced.)
voidsetOrdered(boolean value)
voidsetUserSpecifiedImplClass(String implClass)
StringtoString()
JClasstoType(Outline o, Aspect aspect)
void_implements(JClass c)

Field Detail

baseClass

CClass baseClass

elementName

QName elementName
If this class also gets XmlRootElement, the class name.

implClass

String implClass
Optional user-specified implementation override class.

javadoc

public String javadoc
TODO: revisit this design. we should at least do a basic encapsulation to avoid careless mistakes. Maybe we should even differ the javadoc generation by queueing runners.

model

public final Model model
The Model object to which this bean belongs.

parent

final CClassInfoParent parent

shortName

public final String shortName
short name.

squeezedName

String squeezedName
Custom squeezed name, if any.

Constructor Detail

CClassInfo

public CClassInfo(Model model, JPackage pkg, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)

CClassInfo

public CClassInfo(Model model, CClassInfoParent p, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)

CClassInfo

public CClassInfo(Model model, JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations)

Method Detail

accept

public final <T> T accept(Visitor<T> visitor)

addConstructor

public void addConstructor(String... fieldNames)
Creates a new constructor declaration and adds it.

addProperty

public void addProperty(CPropertyInfo prop)
Adds a new property.

asElement

public Element<NType,NClass> asElement()

declaresAttributeWildcard

public boolean declaresAttributeWildcard()
Returns true if a new attribute wildcard property needs to be declared on this class.

fullName

public String fullName()
Returns the FQCN of this bean.

getBaseClass

public CClassInfo getBaseClass()
This inherited version returns null if this class extends from CClassRef.

See Also: getRefBaseClass

getClazz

public NClass getClazz()

getConstructors

public Collection<? extends Constructor> getConstructors()
list all constructor declarations.

getElementName

public QName getElementName()

getInfo

CNonElement getInfo()
Guaranteed to return this.

getName

String getName()

getOwnerPackage

public JPackage getOwnerPackage()

getProperties

public List<CPropertyInfo> getProperties()
Returns a mutable list.

getProperty

public CPropertyInfo getProperty(String name)
Gets a propery by name.

getRefBaseClass

public CClassRef getRefBaseClass()

getScope

public CClassInfo getScope()

getSqueezedName

String getSqueezedName()
Returns the "squeezed name" of this bean token.

The squeezed name of a bean is the concatenation of the names of its outer classes and itself.

Thus if the bean is "org.acme.foo.Bean", then the squeezed name is "Bean", if the bean is "org.acme.foo.Outer1.Outer2.Bean", then "Outer1Outer2Bean".

This is used by the code generator

getSubstitutionHead

public CClassInfo getSubstitutionHead()

getType

public final NClass getType()

getTypeName

public QName getTypeName()

getUserSpecifiedImplClass

public String getUserSpecifiedImplClass()

hasAttributeWildcard

public boolean hasAttributeWildcard()

hasAttributeWildcard

public void hasAttributeWildcard(boolean hasAttributeWildcard)

hasProperties

public boolean hasProperties()

hasSubClasses

public boolean hasSubClasses()

hasValueProperty

public boolean hasValueProperty()

inheritsAttributeWildcard

public boolean inheritsAttributeWildcard()
Returns true if this class inherits a wildcard attribute property from its ancestor classes.

isBoxedType

public boolean isBoxedType()

isElement

public boolean isElement()

isFinal

public boolean isFinal()

Deprecated: if you are calling this method directly, you must be doing something wrong.

isOrdered

public boolean isOrdered()

isSimpleType

public boolean isSimpleType()

listSubclasses

public Iterator<CClassInfo> listSubclasses()
Enumerates all the sub-classes of this class.

parent

public CClassInfoParent parent()

setBaseClass

public void setBaseClass(CClass base)
This method accepts both CClassInfo (which means the base class is also generated), or CClassRef (which means the base class is already generated and simply referenced.) The latter is treated somewhat special --- from the rest of the model this external base class is invisible. This modeling might need more thoughts to get right.

setOrdered

public void setOrdered(boolean value)

setUserSpecifiedImplClass

public void setUserSpecifiedImplClass(String implClass)

toString

public String toString()

toType

public final JClass toType(Outline o, Aspect aspect)

_implements

public void _implements(JClass c)