Class CElementInfo
- All Implemented Interfaces:
CClassInfoParent
,CCustomizable
,CElement
,CTypeInfo
,NType
,Locatable
,Element<NType,
,NClass> ElementInfo<NType,
,NClass> TypeInfo<NType,
NClass>
ElementInfo
implementation for the compile-time model.
As an NType, it represents the Java representation of this element
(either JAXBElement<T>
or Foo).
- 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
Modifier and TypeFieldDescriptionfinal CClassInfoParent
If this element is global, the element info is considered to be package-level, and this points to the package in which this element lives in. -
Constructor Summary
ConstructorDescriptionCElementInfo
(Model model, QName tagName, CClassInfoParent parent, TypeUse contentType, XmlString defaultValue, XSElementDecl source, CCustomizations customizations, Locator location) Creates an element in the given parent.CElementInfo
(Model model, QName tagName, CClassInfoParent parent, String className, CCustomizations customizations, Locator location) Creates an element with a class in the given parent. -
Method Summary
Modifier and TypeMethodDescription_package()
<T> T
accept
(CClassInfoParent.Visitor<T> visitor) final boolean
Deprecated.why are you calling an unimplemented method?createConstant
(Outline outline, XmlString lexical) fullName()
Human readable name of this type.final CAdapter
Gets the list of customizations attached to this model component.No defaultMimeType
.final Location
Gets the source location in the schema from which this model component is created.Gets the nearestJPackage
.final XSComponent
If 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 element.getType()
Deprecated.why are you calling a method that returns this?final Locatable
boolean
hasClass()
True if this element has its own class (as opposed to be represented as an instance ofJAXBElement
.final ID
idUse()
void
initContentType
(TypeUse contentType, XSElementDecl source, XmlString defaultValue) boolean
Returns true iff this element is an abstract element.boolean
Returns true iff this type represents a class that has a unboxed form.final boolean
void
Marks this element as an abstract element.void
setSubstitutionHead
(CElementInfo substitutionHead) Returns the representation of this type in code model.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sun.tools.xjc.model.CCustomizable
getCustomizations, getSchemaComponent
Methods inherited from interface org.glassfish.jaxb.core.v2.model.annotation.Locatable
getLocation, getUpstream
Methods inherited from interface org.glassfish.jaxb.core.v2.model.core.TypeInfo
canBeReferencedByIDREF
-
Field Details
-
parent
If this element is global, the element info is considered to be package-level, and this points to the package in which this element lives in.For local elements, this points to the parent
CClassInfo
.
-
-
Constructor Details
-
CElementInfo
public CElementInfo(Model model, QName tagName, CClassInfoParent parent, TypeUse contentType, XmlString defaultValue, XSElementDecl source, CCustomizations customizations, Locator location) Creates an element in the given parent.When using this construction,
initContentType(TypeUse, XSElementDecl, XmlString)
must not be invoked. -
CElementInfo
public CElementInfo(Model model, QName tagName, CClassInfoParent parent, String className, CCustomizations customizations, Locator location) Creates an element with a class in the given parent.When using this construction, the caller must use
initContentType(TypeUse, XSElementDecl, XmlString)
to fill in the content type later. This is to avoid a circular model construction dependency between buidling a type inside an element and element itself. To build a content type, you need to have for a parent, so we can't take it as a constructor parameter.
-
-
Method Details
-
initContentType
public void initContentType(TypeUse contentType, @Nullable XSElementDecl source, XmlString defaultValue) -
getDefaultValue
-
_package
-
getContentType
- Specified by:
getContentType
in interfaceElementInfo<NType,
NClass>
-
getContentInMemoryType
- Specified by:
getContentInMemoryType
in interfaceElementInfo<NType,
NClass>
-
getProperty
- Specified by:
getProperty
in interfaceElementInfo<NType,
NClass>
-
getScope
-
getType
Deprecated.why are you calling a method that returns this? -
getElementName
- Specified by:
getElementName
in interfaceElement<NType,
NClass>
-
toType
Description copied from interface:NType
Returns the representation of this type in code model.This operation requires the whole model to be built, and hence it takes
Outline
.Under some code generation strategy, some bean classes are considered implementation specific (such as impl.FooImpl class) These classes always have accompanying "exposed" type (such as the Foo interface).
For such Jekyll and Hyde type, the aspect parameter determines which personality is returned.
- Specified by:
toType
in interfaceCTypeInfo
- Specified by:
toType
in interfaceNType
aspect
- 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:
-
getSqueezedName
Returns the "squeezed name" of this element.- See Also:
-
getSubstitutionHead
- Specified by:
getSubstitutionHead
in interfaceElement<NType,
NClass> - Specified by:
getSubstitutionHead
in interfaceElementInfo<NType,
NClass>
-
getSubstitutionMembers
- Specified by:
getSubstitutionMembers
in interfaceElementInfo<NType,
NClass>
-
setSubstitutionHead
-
isBoxedType
public boolean isBoxedType()Description copied from interface:NType
Returns true iff this type represents a class that has a unboxed form. For example, forString
this is false, but forInteger
this is true.- Specified by:
isBoxedType
in interfaceNType
-
fullName
Description copied from interface:NType
Human readable name of this type.- Specified by:
fullName
in interfaceCClassInfoParent
- Specified by:
fullName
in interfaceNType
-
accept
- Specified by:
accept
in interfaceCClassInfoParent
-
getOwnerPackage
Description copied from interface:CClassInfoParent
Gets the nearestJPackage
.- Specified by:
getOwnerPackage
in interfaceCClassInfoParent
-
shortName
-
hasClass
public boolean hasClass()True if this element has its own class (as opposed to be represented as an instance ofJAXBElement
. -
getLocator
Description copied from interface:CCustomizable
Gets the source location in the schema from which this model component is created.- Specified by:
getLocator
in interfaceCCustomizable
- Returns:
- never null.
-
isAbstract
public boolean isAbstract()Description copied from interface:CElement
Returns true iff this element is an abstract element.- Specified by:
isAbstract
in interfaceCElement
-
setAbstract
public void setAbstract()Description copied from interface:CElement
Marks this element as an abstract element.- Specified by:
setAbstract
in interfaceCElement
-
isCollection
public final boolean isCollection() -
getAdapterUse
-
idUse
-
getSchemaComponent
Description copied from interface:CCustomizable
If this model object is built from XML Schema, this property returns a schema component from which the model is built.- Specified by:
getSchemaComponent
in 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?- Specified by:
canBeReferencedByIDREF
in interfaceTypeInfo<NType,
NClass>
-
getExpectedMimeType
No defaultMimeType
. -
getCustomizations
Description copied from interface:CCustomizable
Gets the list of customizations attached to this model component.- Specified by:
getCustomizations
in interfaceCCustomizable
- Returns:
- can be an empty list but never be null. The returned list is read-only. Do not modify.
- See Also:
-
createConstant
-
getUpstream
- Specified by:
getUpstream
in interfaceLocatable
-
getLocation
- Specified by:
getLocation
in interfaceLocatable
-