Package com.sun.tools.xjc.model
Class CClassInfo
java.lang.Object
com.sun.tools.xjc.model.CClassInfo
- All Implemented Interfaces:
CClass,CClassInfoParent,CCustomizable,CElement,CNonElement,CTypeInfo,NClass,NType,TypeUse,org.glassfish.jaxb.core.v2.model.annotation.Locatable,org.glassfish.jaxb.core.v2.model.core.ClassInfo<NType,,NClass> org.glassfish.jaxb.core.v2.model.core.Element<NType,,NClass> org.glassfish.jaxb.core.v2.model.core.MaybeElement<NType,,NClass> org.glassfish.jaxb.core.v2.model.core.NonElement<NType,,NClass> org.glassfish.jaxb.core.v2.model.core.TypeInfo<NType,NClass>
public final class CClassInfo
extends Object
implements org.glassfish.jaxb.core.v2.model.core.ClassInfo<NType,NClass>, CClassInfoParent, CClass, NClass
Mutable
ClassInfo representation.
Schema parsers build these objects.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sun.tools.xjc.model.CClassInfoParent
CClassInfoParent.Package, CClassInfoParent.Visitor<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionTODO: revisit this design.final ModelTheModelobject to which this bean belongs.final Stringshort name.Fields inherited from interface org.glassfish.jaxb.core.v2.model.core.NonElement
ANYTYPE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionCClassInfo(Model model, JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) 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) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal <T> Taccept(CClassInfoParent.Visitor<T> visitor) voidaddConstructor(String... fieldNames) Creates a new constructor declaration and adds it.voidaddProperty(CPropertyInfo prop) Adds a new property.final booleanDeprecated.why are you calling an unimplemented method?createConstant(Outline outline, XmlString lexical) booleanReturns true if a new attribute wildcard property needs to be declared on this class.fullName()Returns the FQCN of this bean.final CAdapterThis inherited version returns null if this class extends fromCClassRef.getClazz()Collection<? extends Constructor>list all constructor declarations.Gets the list of customizations attached to this model component.jakarta.activation.MimeTypeNo defaultMimeType.getInfo()Deprecated.final org.glassfish.jaxb.core.v2.runtime.LocationGets the source location in the schema from which this model component is created.getName()Gets the nearestJPackage.Returns a mutable list.getProperty(String name) Gets a propery by name.final XSComponentIf this model object is built from XML Schema, this property returns a schema component from which the model is built.getScope()Returns the "squeezed name" of this bean token.final NClassgetType()final org.glassfish.jaxb.core.v2.model.annotation.LocatablebooleanvoidhasAttributeWildcard(boolean hasAttributeWildcard) booleanbooleanbooleanfinal org.glassfish.jaxb.core.v2.model.core.IDidUse()booleanReturns true if this class inherits a wildcard attribute property from its ancestor classes.booleanReturns true iff this element is an abstract element.booleanReturns true iff this type represents a class that has a unboxed form.final booleanbooleanbooleanisFinal()Deprecated.if you are calling this method directly, you must be doing something wrong.booleanbooleanEnumerates all the sub-classes of this class.parent()voidMarks this element as an abstract element.voidsetBaseClass(CClass base) This method accepts bothCClassInfo(which means the base class is also generated), orCClassRef(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.voidsetOrdered(boolean value) voidsetUserSpecifiedImplClass(String implClass) toString()final JClassMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sun.tools.xjc.model.CCustomizable
getCustomizations, getLocator, getSchemaComponentMethods inherited from interface com.sun.tools.xjc.model.CElement
isAbstract, setAbstractMethods inherited from interface org.glassfish.jaxb.core.v2.model.core.ClassInfo
isAbstractMethods inherited from interface com.sun.tools.xjc.model.CNonElement
getAdapterUse, isCollectionMethods inherited from interface org.glassfish.jaxb.core.v2.model.annotation.Locatable
getLocation, getUpstreamMethods inherited from interface com.sun.tools.xjc.model.nav.NClass
isAbstractMethods inherited from interface org.glassfish.jaxb.core.v2.model.core.TypeInfo
canBeReferencedByIDREFMethods inherited from interface com.sun.tools.xjc.model.TypeUse
createConstant, getExpectedMimeType, idUse
-
Field Details
-
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. -
shortName
short name. -
model
TheModelobject to which this bean belongs.
-
-
Constructor Details
-
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 Details
-
hasAttributeWildcard
public boolean hasAttributeWildcard() -
hasAttributeWildcard
public void hasAttributeWildcard(boolean hasAttributeWildcard) -
hasSubClasses
public boolean hasSubClasses() -
declaresAttributeWildcard
public boolean declaresAttributeWildcard()Returns true if a new attribute wildcard property needs to be declared on this class. -
inheritsAttributeWildcard
public boolean inheritsAttributeWildcard()Returns true if this class inherits a wildcard attribute property from its ancestor classes. -
getClazz
-
getScope
-
getName
-
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
-
getProperties
Returns a mutable list. -
hasValueProperty
public boolean hasValueProperty() -
getProperty
Gets a propery by name. -
hasProperties
public boolean hasProperties() -
isElement
public boolean isElement() -
getInfo
Deprecated.Guaranteed to return this.- Specified by:
getInfoin interfaceCNonElement- Specified by:
getInfoin interfaceTypeUse
-
asElement
-
isOrdered
public boolean isOrdered() -
isFinal
Deprecated.if you are calling this method directly, you must be doing something wrong. -
setOrdered
public void setOrdered(boolean value) -
getElementName
-
getTypeName
-
isSimpleType
public boolean isSimpleType() -
fullName
Returns the FQCN of this bean.- Specified by:
fullNamein interfaceCClassInfoParent- Specified by:
fullNamein interfaceNType
-
parent
-
setUserSpecifiedImplClass
-
getUserSpecifiedImplClass
-
addProperty
Adds a new property. -
setBaseClass
This method accepts bothCClassInfo(which means the base class is also generated), orCClassRef(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. -
getBaseClass
This inherited version returns null if this class extends fromCClassRef. -
getRefBaseClass
-
listSubclasses
Enumerates all the sub-classes of this class. -
getSubstitutionHead
-
_implements
-
addConstructor
Creates a new constructor declaration and adds it. -
getConstructors
list all constructor declarations. -
accept
- Specified by:
acceptin interfaceCClassInfoParent
-
getOwnerPackage
Description copied from interface:CClassInfoParentGets the nearestJPackage.- Specified by:
getOwnerPackagein interfaceCClassInfoParent
-
getType
-
toType
Description copied from interface:CTypeInfo- Specified by:
toTypein interfaceCTypeInfo- Specified by:
toTypein interfaceNClass- Specified by:
toTypein interfaceNTypeaspect- IfAspect.IMPLEMENTATION, this method returns the implementation specific class that this type represents. IfAspect.EXPOSED, this method returns the publicly exposed type that this type represents. For ordinary classes, the aspect parameter is meaningless.- See Also:
-
isBoxedType
public boolean isBoxedType()Description copied from interface:NTypeReturns true iff this type represents a class that has a unboxed form. For example, forStringthis is false, but forIntegerthis is true.- Specified by:
isBoxedTypein interfaceNType
-
toString
-
getLocator
Description copied from interface:CCustomizableGets the source location in the schema from which this model component is created.- Specified by:
getLocatorin interfaceCCustomizable- Returns:
- never null.
-
isAbstract
public boolean isAbstract()Description copied from interface:CElementReturns true iff this element is an abstract element.- Specified by:
isAbstractin interfaceCElement
-
setAbstract
public void setAbstract()Description copied from interface:CElementMarks this element as an abstract element.- Specified by:
setAbstractin interfaceCElement
-
isCollection
public final boolean isCollection() -
getAdapterUse
-
idUse
public final org.glassfish.jaxb.core.v2.model.core.ID idUse() -
getSchemaComponent
Description copied from interface:CCustomizableIf this model object is built from XML Schema, this property returns a schema component from which the model is built.- Specified by:
getSchemaComponentin interfaceCCustomizable- Returns:
- null if the model is built from sources other than XML Schema (such as DTD.)
-
canBeReferencedByIDREF
Deprecated.why are you calling an unimplemented method? -
getExpectedMimeType
public jakarta.activation.MimeType getExpectedMimeType()No defaultMimeType. -
getCustomizations
Description copied from interface:CCustomizableGets the list of customizations attached to this model component.- Specified by:
getCustomizationsin interfaceCCustomizable- Returns:
- can be an empty list but never be null. The returned list is read-only. Do not modify.
- See Also:
-
createConstant
-
getUpstream
public final org.glassfish.jaxb.core.v2.model.annotation.Locatable getUpstream()- Specified by:
getUpstreamin interfaceorg.glassfish.jaxb.core.v2.model.annotation.Locatable
-
getLocation
public final org.glassfish.jaxb.core.v2.runtime.Location getLocation()- Specified by:
getLocationin interfaceorg.glassfish.jaxb.core.v2.model.annotation.Locatable
-