Class CEnumLeafInfo

    • Field Detail

      • model

        public final Model model
        The Model object to which this bean belongs.
      • parent

        public final CClassInfoParent parent
        The parent into which the enum class should be generated.
      • shortName

        public final String shortName
        Short name of the generated type-safe enum.
      • base

        public final CNonElement base
        Represents the underlying type of this enumeration and its conversion.

        To parse XML into a constant, we use the base type to do lexical -> value, then use a map to pick up the right one.

        Hence this also represents the type of the Java value. For example, if this is an enumeration of xs:int, then this field will be Java int.

      • javadoc

        public String javadoc
    • Method Detail

      • getLocator

        public Locator getLocator()
        Source line information that points to the place where this type-safe enum is defined. Used to report error messages.
        Specified by:
        getLocator in interface CCustomizable
        Returns:
        never null.
      • getSchemaComponent

        public 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.)
      • toType

        public JClass 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 NClass
        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:
        NType.toType(Outline, com.sun.tools.xjc.outline.Aspect)
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface NClass
      • 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 NType
      • isPrimitive

        public boolean isPrimitive()
      • needsValueField

        public boolean needsValueField()
        The spec says the value field in the enum class will be generated only under certain circumstances.
        Returns:
        true if the generated enum class should have the value field.
      • createConstant

        public JExpression createConstant​(Outline outline,
                                          XmlString literal)
        Description copied from interface: TypeUse
        Creates a constant for the given lexical value.

        For example, to create a constant 1 for xs:int, you'd do:

         CBuiltinLeafInfo.INT.createConstant( codeModel, "1", null );
         

        This method is invoked at the backend as a part of the code generation process.

        Specified by:
        createConstant in interface TypeUse
        Returns:
        null if the constant cannot be created for this (such as when it's a collection)
      • idUse

        public ID idUse()
        Description copied from interface: TypeUse
        Whether the referenced type (individual item type in case of collection) is ID/IDREF.

        ID is a property of a relationship. When a bean Foo has an ID property called 'bar' whose type is String, Foo isn't an ID, String isn't an ID, but this relationship is an ID (in the sense that Foo uses this String as an ID.)

        The same thing can be said with IDREF. When Foo refers to Bar by means of IDREF, neither Foo nor Bar is IDREF.

        That's why we have this method in .

        Specified by:
        idUse in interface TypeUse
      • getExpectedMimeType

        public jakarta.activation.MimeType getExpectedMimeType()
        Description copied from interface: TypeUse
        A can have an associated MIME type.
        Specified by:
        getExpectedMimeType in interface TypeUse