Enum IpsModel

java.lang.Object
java.lang.Enum<IpsModel>
org.faktorips.runtime.model.IpsModel
All Implemented Interfaces:
Serializable, Comparable<IpsModel>, java.lang.constant.Constable

public enum IpsModel extends Enum<IpsModel>
Repository of Faktor-IPS model information. This class should be used to obtain model instances from runtime classes or their instances instead of using the constructors. By caching model information, this class operates more efficiently if model information is retrieved repeatedly.
  • Method Details

    • values

      public static IpsModel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static IpsModel valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getTableStructure

      public static TableStructure getTableStructure(Class<? extends ITable<?>> tableObjectClass)
      Parameters:
      tableObjectClass - a generated subclass of ITable
      Returns:
      a TableStructure describing the type and columns of the given ITable class
    • getTableStructure

      public static TableStructure getTableStructure(ITable<?> table)
      Returns:
      a TableStructure describing the type and columns of the given ITable
    • isProductCmptType

      public static boolean isProductCmptType(Class<?> productModelClass)
      Returns whether the given class is a generated product type and can be given to getProductCmptType(Class) as an argument without getting an IllegalArgumentException.
      Parameters:
      productModelClass - the class to check
      Returns:
      true if the given class is a product model class
    • getProductCmptType

      public static ProductCmptType getProductCmptType(Class<? extends IProductComponent> productModelClass)
      Parameters:
      productModelClass - The generated class for a product component type, may be either an implementation class of a published interface.
      Returns:
      the product model object for the given product model class
      Throws:
      IllegalArgumentException - if the given class is not a valid model type
      See Also:
    • getProductCmptType

      public static ProductCmptType getProductCmptType(IProductComponent productComponent)
      Returns:
      the product model object for the given product component
      Throws:
      IllegalArgumentException - if the class of the given product component is not properly annotated for a product model
    • isPolicyCmptType

      public static boolean isPolicyCmptType(Class<?> policyModelClass)
      Returns whether the given class is a generated policy type and can be given to getPolicyCmptType(Class) as an argument without getting an IllegalArgumentException.
      Parameters:
      policyModelClass - the class to check
      Returns:
      true if the given class is a policy model class
    • getPolicyCmptType

      public static PolicyCmptType getPolicyCmptType(Class<? extends IModelObject> policyModelClass)
      Parameters:
      policyModelClass - The generated class for a policy component type, may be either an implementation class of a published interface.
      Returns:
      the policy model object for the given policy model class
      Throws:
      IllegalArgumentException - if the given class is not a valid model type
      See Also:
    • getPolicyCmptType

      public static PolicyCmptType getPolicyCmptType(IModelObject modelObject)
      Returns:
      the policy model object for the given model object
      Throws:
      IllegalArgumentException - if the class of the model object is not properly annotated for a policy model
    • getType

      public static Type getType(Class<?> modelObjectClass)
      Returns:
      the model object for the given policy or product model class. This is either the implementation or the published interface of a product component type or policy component type.
      Throws:
      IllegalArgumentException - if the given class is not properly annotated for a model type
    • isEnumType

      public static boolean isEnumType(Class<?> enumObjectClass)
      Returns whether the given class is a generated enum type and can be given to getEnumType(Class) as an argument without getting an IllegalArgumentException.
      Parameters:
      enumObjectClass - the class to check
      Returns:
      true if the given class is an enum model class
    • isExtensibleEnumType

      public static boolean isExtensibleEnumType(Class<?> enumObjectClass)
      Returns whether the given class is a generated extensible enum type and can be given to getEnumType(Class) as an argument without getting an IllegalArgumentException.
      Parameters:
      enumObjectClass - the class to check
      Returns:
      true if the given class is an extensible enum model class
    • getEnumType

      public static EnumType getEnumType(Class<?> enumObjectClass)
      Parameters:
      enumObjectClass - a generated Faktor-IPS enum class
      Returns:
      an EnumType describing the attributes of the given Faktor-IPS enum
      Throws:
      IllegalArgumentException - if the given class is not a valid model type
      See Also:
    • getEnumType

      public static EnumType getEnumType(Object enumInstance)
      Returns:
      an EnumType describing the attributes of the given Faktor-IPS enum.
      Throws:
      IllegalArgumentException - if the given object's class is not properly annotated for a model type