Class CElementInfo

java.lang.Object
com.sun.tools.xjc.model.CElementInfo
All Implemented Interfaces:
CClassInfoParent, CCustomizable, CElement, CTypeInfo, NType, com.sun.xml.bind.v2.model.annotation.Locatable, com.sun.xml.bind.v2.model.core.Element<NType,NClass>, com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>, com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>

public final class CElementInfo extends Object implements com.sun.xml.bind.v2.model.core.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).

Author:
Kohsuke Kawaguchi
  • Field Details

    • 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.

  • Constructor Details

  • Method Details

    • initContentType

      public void initContentType(TypeUse contentType, @Nullable XSElementDecl source, XmlString defaultValue)
    • getDefaultValue

      public final String getDefaultValue()
    • _package

      public final JPackage _package()
    • getContentType

      public CNonElement getContentType()
      Specified by:
      getContentType in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
    • getContentInMemoryType

      public NType getContentInMemoryType()
      Specified by:
      getContentInMemoryType in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
    • getProperty

      public CElementPropertyInfo getProperty()
      Specified by:
      getProperty in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
    • getScope

      public CClassInfo getScope()
      Specified by:
      getScope in interface com.sun.xml.bind.v2.model.core.Element<NType,NClass>
    • getType

      public NType getType()
      Deprecated.
      why are you calling a method that returns this?
      Specified by:
      getType in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
      Specified by:
      getType in interface com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>
    • getElementName

      public QName getElementName()
      Specified by:
      getElementName in interface com.sun.xml.bind.v2.model.core.Element<NType,NClass>
    • toType

      public JType toType(Outline o, Aspect aspect)
      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 interface CTypeInfo
      Specified by:
      toType in interface NType
      aspect - If Aspect.IMPLEMENTATION, this method returns the implementation specific class that this type represents. If Aspect.EXPOSED, this method returns the publicly exposed type that this type represents. For ordinary classes, the aspect parameter is meaningless.
      See Also:
    • getSqueezedName

      public String getSqueezedName()
      Returns the "squeezed name" of this element.
      See Also:
    • getSubstitutionHead

      public CElementInfo getSubstitutionHead()
      Specified by:
      getSubstitutionHead in interface com.sun.xml.bind.v2.model.core.Element<NType,NClass>
      Specified by:
      getSubstitutionHead in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
    • getSubstitutionMembers

      public Collection<CElementInfo> getSubstitutionMembers()
      Specified by:
      getSubstitutionMembers in interface com.sun.xml.bind.v2.model.core.ElementInfo<NType,NClass>
    • setSubstitutionHead

      public void setSubstitutionHead(CElementInfo substitutionHead)
    • isBoxedType

      public boolean isBoxedType()
      Description copied from interface: NType
      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.
      Specified by:
      isBoxedType in interface NType
    • fullName

      public String fullName()
      Description copied from interface: NType
      Human readable name of this type.
      Specified by:
      fullName in interface CClassInfoParent
      Specified by:
      fullName in interface NType
    • accept

      public <T> T accept(CClassInfoParent.Visitor<T> visitor)
      Specified by:
      accept in interface CClassInfoParent
    • getOwnerPackage

      public JPackage getOwnerPackage()
      Description copied from interface: CClassInfoParent
      Gets the nearest JPackage.
      Specified by:
      getOwnerPackage in interface CClassInfoParent
    • shortName

      public String shortName()
    • hasClass

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

      public Locator getLocator()
      Description copied from interface: CCustomizable
      Gets the source location in the schema from which this model component is created.
      Specified by:
      getLocator in interface CCustomizable
      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 interface CElement
    • setAbstract

      public void setAbstract()
      Description copied from interface: CElement
      Marks this element as an abstract element.
      Specified by:
      setAbstract in interface CElement
    • isCollection

      public final boolean isCollection()
    • getAdapterUse

      public final CAdapter getAdapterUse()
    • idUse

      public final com.sun.xml.bind.v2.model.core.ID idUse()
    • getSchemaComponent

      public final XSComponent 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 interface CCustomizable
      Returns:
      null if the model is built from sources other than XML Schema (such as DTD.)
    • canBeReferencedByIDREF

      public final boolean canBeReferencedByIDREF()
      Deprecated.
      why are you calling an unimplemented method?
      Specified by:
      canBeReferencedByIDREF in interface com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>
    • getExpectedMimeType

      public javax.activation.MimeType getExpectedMimeType()
      No default MimeType.
    • getCustomizations

      public CCustomizations getCustomizations()
      Description copied from interface: CCustomizable
      Gets the list of customizations attached to this model component.
      Specified by:
      getCustomizations in interface CCustomizable
      Returns:
      can be an empty list but never be null. The returned list is read-only. Do not modify.
      See Also:
    • createConstant

      public JExpression createConstant(Outline outline, XmlString lexical)
    • getUpstream

      public final com.sun.xml.bind.v2.model.annotation.Locatable getUpstream()
      Specified by:
      getUpstream in interface com.sun.xml.bind.v2.model.annotation.Locatable
    • getLocation

      public final com.sun.xml.bind.v2.runtime.Location getLocation()
      Specified by:
      getLocation in interface com.sun.xml.bind.v2.model.annotation.Locatable