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
FieldsModifier and TypeFieldDescriptionfinal CClassInfoParentIf 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
ConstructorsConstructorDescriptionCElementInfo(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> Taccept(CClassInfoParent.Visitor<T> visitor) final booleanDeprecated.why are you calling an unimplemented method?createConstant(Outline outline, XmlString lexical) fullName()Human readable name of this type.final CAdapterT ofJAXBElement<T>.Short forgetProperty().ref().get(0).Gets the list of customizations attached to this model component.Gets the element name of the class.No defaultMimeType.final LocationGets the location object that this object points to.Gets the source location in the schema from which this model component is created.Gets the nearestJPackage.Gets the object that represents the value property.final XSComponentIf this model object is built from XML Schema, this property returns a schema component from which the model is built.getScope()If non-null, this element is only active inside the given scope.Returns the "squeezed name" of this element.If this element can substitute another element, return that element.All the s whoseElementInfo.getSubstitutionHead()points to this object.getType()Deprecated.why are you calling a method that returns this?final LocatableGets the upstreamLocationinformation.booleanhasClass()True if this element has its own class (as opposed to be represented as an instance ofJAXBElement.final IDidUse()voidinitContentType(TypeUse contentType, XSElementDecl source, XmlString defaultValue) booleanReturns true iff this element is an abstract element.booleanReturns true iff this type represents a class that has a unboxed form.final booleanvoidMarks this element as an abstract element.voidsetSubstitutionHead(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, waitMethods inherited from interface com.sun.tools.xjc.model.CCustomizable
getCustomizations, getSchemaComponentMethods inherited from interface org.glassfish.jaxb.core.v2.model.annotation.Locatable
getLocation, getUpstreamMethods 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
Description copied from interface:ElementInfoShort forgetProperty().ref().get(0). The type of the value this element holds. Normally, this is the T ofJAXBElement<T>. But if the property is adapted, this is the on-the-wire type. Or if the element has a list of values, then this field represents the type of the individual item.- Specified by:
getContentTypein interfaceElementInfo<NType,NClass> - See Also:
-
getContentInMemoryType
Description copied from interface:ElementInfoT ofJAXBElement<T>.This is tied to the in-memory representation.
- Specified by:
getContentInMemoryTypein interfaceElementInfo<NType,NClass> - See Also:
-
getProperty
Description copied from interface:ElementInfoGets the object that represents the value property.- Specified by:
getPropertyin interfaceElementInfo<NType,NClass> - Returns:
- non-null.
-
getScope
Description copied from interface:ElementIf non-null, this element is only active inside the given scope. -
getType
Deprecated.why are you calling a method that returns this?Description copied from interface:ElementInfoReturns the representation forJAXBElement<contentInMemoryType>.This returns the signature in Java and thus isn't affected by the adapter.
-
getElementName
Description copied from interface:ElementGets the element name of the class.- Specified by:
getElementNamein interfaceElement<NType,NClass> - Returns:
- Always non-null.
-
toType
Description copied from interface:NTypeReturns 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:
toTypein interfaceCTypeInfo- 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:
-
getSqueezedName
Returns the "squeezed name" of this element.- See Also:
-
getSubstitutionHead
Description copied from interface:ElementInfoIf this element can substitute another element, return that element.Substitutability of elements are transitive. can only substitute .
- Specified by:
getSubstitutionHeadin interfaceElement<NType,NClass> - Specified by:
getSubstitutionHeadin interfaceElementInfo<NType,NClass> - Returns:
- null if no such element exists.
-
getSubstitutionMembers
Description copied from interface:ElementInfoAll the s whoseElementInfo.getSubstitutionHead()points to this object.- Specified by:
getSubstitutionMembersin interfaceElementInfo<NType,NClass> - Returns:
- can be empty but never null.
-
setSubstitutionHead
-
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
-
fullName
Description copied from interface:NTypeHuman readable name of this type.- Specified by:
fullNamein interfaceCClassInfoParent- Specified by:
fullNamein interfaceNType
-
accept
- Specified by:
acceptin interfaceCClassInfoParent
-
getOwnerPackage
Description copied from interface:CClassInfoParentGets the nearestJPackage.- Specified by:
getOwnerPackagein 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: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
-
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?Description copied from interface:TypeInfoTrue if this type is a valid target from a property annotated withXmlIDREF.- Specified by:
canBeReferencedByIDREFin interfaceTypeInfo<NType,NClass>
-
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
Description copied from interface:LocatableGets the upstreamLocationinformation.- Specified by:
getUpstreamin interfaceLocatable- Returns:
- can be null.
-
getLocation
Description copied from interface:LocatableGets the location object that this object points to. This operation could be inefficient and costly.- Specified by:
getLocationin interfaceLocatable
-