com.sun.tools.xjc.model

Class CElementInfo

public final class CElementInfo extends AbstractCElement implements ElementInfo<NType,NClass>, NType, CClassInfoParent

ElementInfo implementation for the compile-time model.

As an NType, it represents the Java representation of this element (either JAXBElement<T> or Foo).

Field Summary
CClassInfoParentparent
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.
StringsqueezedName
Custom squeezed name, if any.
Constructor Summary
CElementInfo(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
<T> Taccept(Visitor<T> visitor)
StringfullName()
NTypegetContentInMemoryType()
CNonElementgetContentType()
StringgetDefaultValue()
QNamegetElementName()
JPackagegetOwnerPackage()
CElementPropertyInfogetProperty()
CClassInfogetScope()
StringgetSqueezedName()
Returns the "squeezed name" of this element.
CElementInfogetSubstitutionHead()
Collection<CElementInfo>getSubstitutionMembers()
NTypegetType()
booleanhasClass()
True if this element has its own class (as opposed to be represented as an instance of JAXBElement.
voidinitContentType(TypeUse contentType, XSElementDecl source, XmlString defaultValue)
booleanisBoxedType()
voidsetSubstitutionHead(CElementInfo substitutionHead)
StringshortName()
JTypetoType(Outline o, Aspect aspect)
JPackage_package()

Field Detail

parent

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.

squeezedName

String squeezedName
Custom squeezed name, if any.

Constructor Detail

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, CElementInfo 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 CElementInfo 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 CElementInfo for a parent, so we can't take it as a constructor parameter.

Method Detail

accept

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

fullName

public String fullName()

getContentInMemoryType

public NType getContentInMemoryType()

getContentType

public CNonElement getContentType()

getDefaultValue

public final String getDefaultValue()

getElementName

public QName getElementName()

getOwnerPackage

public JPackage getOwnerPackage()

getProperty

public CElementPropertyInfo getProperty()

getScope

public CClassInfo getScope()

getSqueezedName

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

See Also: getSqueezedName

getSubstitutionHead

public CElementInfo getSubstitutionHead()

getSubstitutionMembers

public Collection<CElementInfo> getSubstitutionMembers()

getType

public NType getType()

Deprecated: why are you calling a method that returns this?

hasClass

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

initContentType

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

isBoxedType

public boolean isBoxedType()

setSubstitutionHead

public void setSubstitutionHead(CElementInfo substitutionHead)

shortName

public String shortName()

toType

public JType toType(Outline o, Aspect aspect)

_package

public final JPackage _package()