Top Description Fields Constructors Methods
com.sun.tools.xjc.model

public final Class CElementInfo

extends AbstractCElement
implements ElementInfo<NType, NClass>, NType, CClassInfoParent
Class Inheritance
All Implemented Interfaces
com.sun.tools.xjc.model.CClassInfoParent, com.sun.tools.xjc.model.nav.NType, org.glassfish.jaxb.core.v2.model.core.ElementInfo, org.glassfish.jaxb.core.v2.model.core.Element, org.glassfish.jaxb.core.v2.model.core.TypeInfo, org.glassfish.jaxb.core.v2.model.annotation.Locatable
Imports
java.util.Collection, .Collections, .LinkedHashSet, .List, .Set, jakarta.xml.bind.JAXBElement, jakarta.xml.bind.annotation.XmlElement, javax.xml.namespace.QName, com.sun.codemodel.JPackage, .JType, com.sun.istack.Nullable, com.sun.tools.xjc.model.nav.NClass, .NType, .NavigatorImpl, com.sun.tools.xjc.outline.Aspect, .Outline, com.sun.tools.xjc.reader.xmlschema.bindinfo.BIInlineBinaryData, .BIFactoryMethod, com.sun.tools.xjc.reader.xmlschema.BGMBuilder, com.sun.tools.xjc.reader.Ring, org.glassfish.jaxb.core.v2.model.core.ElementInfo, com.sun.xml.xsom.XSElementDecl, .XmlString, org.xml.sax.Locator

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

Field Summary

Modifier and TypeField and Description
private String
className

If this element produces its own class, the short name of that class.

private final Model
model

Model that owns this object.

public final CClassInfoParent
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.

private CElementPropertyInfo
private String
squeezedName

Custom squeezed name, if any.

private CElementInfo
private Set<CElementInfo>
substitutionMembers

Lazily computed.

private final QName
private NType
type

Represents JAXBElement<ContentType>.

Constructor Summary

AccessConstructor and Description
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.

public
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 TypeMethod and Description
public JPackage
public <T> T
public String
public NType
public CNonElement
getContentType()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getContentType.

Short for getProperty().ref().get(0).

public String
public QName
getElementName()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getElementName.

Gets the element name of the class.

public JPackage
public CElementPropertyInfo
getProperty()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getProperty.

Gets the object that represents the value property.

public CClassInfo
getScope()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getScope.

If non-null, this element is only active inside the given scope.

public String
getSqueezedName()

Returns the "squeezed name" of this element.

public CElementInfo
public Collection<CElementInfo>
public NType
getType()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getType, org.glassfish.jaxb.core.v2.model.core.TypeInfo.getType.

Deprecated why are you calling a method that returns this?

Returns the representation for JAXBElement<contentInMemoryType>.

public boolean
hasClass()

True if this element has its own class (as opposed to be represented as an instance of JAXBElement.

public void
initContentType(TypeUse contentType, XSElementDecl source, XmlString defaultValue)

public boolean
isBoxedType()

Implements com.sun.tools.xjc.model.nav.NType.isBoxedType.

Returns true iff this type represents a class that has a unboxed form.

public void
public String
public JType
toType(Outline o, Aspect aspect)

Implements com.sun.tools.xjc.model.nav.NType.toType, com.sun.tools.xjc.model.CTypeInfo.toType.

Returns the representation of this type in code model.

Inherited from com.sun.tools.xjc.model.AbstractCElement:
getLocatorisAbstractsetAbstract

Field Detail

classNameback to summary
private String className

If this element produces its own class, the short name of that class. Otherwise null.

modelback to summary
private final Model model

Model that owns this object.

parentback to summary
public final CClassInfoParent 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.

propertyback to summary
private CElementPropertyInfo property
squeezedNameback to summary
private String squeezedName

Custom squeezed name, if any.

Annotations
@Nullable
substitutionHeadback to summary
private CElementInfo substitutionHead
substitutionMembersback to summary
private Set<CElementInfo> substitutionMembers

Lazily computed.

tagNameback to summary
private final QName tagName
typeback to summary
private NType type

Represents JAXBElement<ContentType>.

Constructor Detail

CElementInfoback to summary
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.

CElementInfoback to summary
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 Detail

_packageback to summary
public JPackage _package()
acceptback to summary
public <T> T accept(CClassInfoParent.Visitor<T> visitor)

Implements com.sun.tools.xjc.model.CClassInfoParent.accept.

Annotations
@Override
fullNameback to summary
public String fullName()

Implements com.sun.tools.xjc.model.nav.NType.fullName, com.sun.tools.xjc.model.CClassInfoParent.fullName.

Doc from com.sun.tools.xjc.model.nav.NType.fullName.

Human readable name of this type.

Annotations
@Override
getContentInMemoryTypeback to summary
public NType getContentInMemoryType()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getContentInMemoryType.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getContentInMemoryType.

T of JAXBElement<T>.

This is tied to the in-memory representation.

Annotations
@Override
getContentTypeback to summary
public CNonElement getContentType()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getContentType.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getContentType.

Short for getProperty().ref().get(0). The type of the value this element holds. Normally, this is the T of JAXBElement<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.

Annotations
@Override
getDefaultValueback to summary
public String getDefaultValue()
getElementNameback to summary
public QName getElementName()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getElementName.

Doc from org.glassfish.jaxb.core.v2.model.core.Element.getElementName.

Gets the element name of the class.

Annotations
@Override
getOwnerPackageback to summary
public JPackage getOwnerPackage()

Implements com.sun.tools.xjc.model.CClassInfoParent.getOwnerPackage.

Doc from com.sun.tools.xjc.model.CClassInfoParent.getOwnerPackage.

Gets the nearest JPackage.

Annotations
@Override
getPropertyback to summary
public CElementPropertyInfo getProperty()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getProperty.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getProperty.

Gets the object that represents the value property.

Annotations
@Override
getScopeback to summary
public CClassInfo getScope()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getScope.

Doc from org.glassfish.jaxb.core.v2.model.core.Element.getScope.

If non-null, this element is only active inside the given scope.

Annotations
@Override
getSqueezedNameback to summary
public String getSqueezedName()

Returns the "squeezed name" of this element.

Annotations
@XmlElement
See Also
CClassInfo#getSqueezedName()
getSubstitutionHeadback to summary
public CElementInfo getSubstitutionHead()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getSubstitutionHead, org.glassfish.jaxb.core.v2.model.core.Element.getSubstitutionHead.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getSubstitutionHead.

If this element can substitute another element, return that element.

Substitutability of elements are transitive. can only substitute .

Annotations
@Override
getSubstitutionMembersback to summary
public Collection<CElementInfo> getSubstitutionMembers()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getSubstitutionMembers.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getSubstitutionMembers.

All the s whose getSubstitutionHead() points to this object.

Annotations
@Override
getTypeback to summary
public NType getType()

Implements org.glassfish.jaxb.core.v2.model.core.ElementInfo.getType, org.glassfish.jaxb.core.v2.model.core.TypeInfo.getType.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementInfo.getType.

Deprecated

why are you calling a method that returns this?

Returns the representation for JAXBElement<contentInMemoryType>.

This returns the signature in Java and thus isn't affected by the adapter.

Annotations
@Deprecated
@Override
hasClassback to summary
public boolean hasClass()

True if this element has its own class (as opposed to be represented as an instance of JAXBElement.

initContentTypeback to summary
public void initContentType(TypeUse contentType, XSElementDecl source, XmlString defaultValue)
isBoxedTypeback to summary
public boolean isBoxedType()

Implements com.sun.tools.xjc.model.nav.NType.isBoxedType.

Doc from com.sun.tools.xjc.model.nav.NType.isBoxedType.

Returns true iff this type represents a class that has a unboxed form. For example, for String this is false, but for Integer this is true.

Annotations
@Override
setSubstitutionHeadback to summary
public void setSubstitutionHead(CElementInfo substitutionHead)
shortNameback to summary
public String shortName()
toTypeback to summary
public JType toType(Outline o, Aspect aspect)

Implements com.sun.tools.xjc.model.nav.NType.toType, com.sun.tools.xjc.model.CTypeInfo.toType.

Doc from com.sun.tools.xjc.model.nav.NType.toType.

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.

Annotations
@Override