Annotation Interface GenAsEnumeratedType


@Retention(CLASS) @Target(TYPE) @Documented public @interface GenAsEnumeratedType
Indicates that the annotated class is to be generated as an EnumeratedType. An EnumeratedType represents a list of valid values, much like an enum, for which the values can be localized. The annotated class will automatically extend EnumeratedType and, therefore, get most of the associated boiler-plate logic, but any static final constants for referring to names must be hand-coded, as must the rbInfo file.

The following example -- stolen from the customizer's guide -- illustrates the relationship between the class, the class's static final constants, and the rbInfo file.

ComputerType.java

 package com.ptc.example;

 import com.ptc.windchill.annotations.metadata.GenAsEnumeratedType;

 @GenAsEnumeratedType
 public class ComputerType extends _ComputerType {
    public static final ComputerType DESKTOP = toComputerType("desktop");
    public static final ComputerType LAPTOP = toComputerType("laptop");
    public static final ComputerType SERVER = toComputerType("server");
 }

ComputerTypeRB.rbInfo

 ResourceInfo.class=wt.tools.resource.EnumResourceInfo

 desktop.value=Desktop
 desktop.order=10

 laptop.value=Laptop
 laptop.order=20
 laptop.defaultValue=true

 server.value=Server
 server.order=30

Supported API: true

  • Element Details

    • superClass

      Class superClass
      The parent class for this EnumeratedType. This class would normally be the class designated by the extends statement and is needed because the annotated class must extend "_"+classname" (for example public MyClass extends _MyClass).

      Note: the parent must extend or equal EnumeratedType, if left as the default ( Object.class, EnumeratedType is assumed.

      Rose conversion note: Corresponds to Class Specification -> General -> Specialize Class (where the specialized class is the single (non-interface) parent class).

      Supported API: true

      Default:
      java.lang.Object.class
    • interfaces

      Class[] interfaces
      The interfaces this class/interface extends/implements. These interfaces would normally be present in the extends clause (for an interface) or the implements clause (for a class), but must, instead, be present in this property because of the manner in which Java treats static final fields.

      Rose conversion note: Corresponds to Class Specification -> Relations -> Specialize Class (where the specialized class is the single (non-interface) parent class).

      Supported API: true

      Default:
      {}
    • supportedAPI

      SupportedAPI supportedAPI
      The supported nature of this enumerated type.

      Supported API: true

      Default:
      PRIVATE