Package org.faktorips.runtime.model
Enum IpsModel
- java.lang.Object
-
- java.lang.Enum<IpsModel>
-
- org.faktorips.runtime.model.IpsModel
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<IpsModel>
public enum IpsModel extends java.lang.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EnumTypegetEnumType(java.lang.Class<?> enumObjectClass)static EnumTypegetEnumType(java.lang.Object enumInstance)static PolicyCmptTypegetPolicyCmptType(java.lang.Class<? extends IModelObject> policyModelClass)static PolicyCmptTypegetPolicyCmptType(IModelObject modelObject)static ProductCmptTypegetProductCmptType(java.lang.Class<? extends IProductComponent> productModelClass)static ProductCmptTypegetProductCmptType(IProductComponent productComponent)static TableStructuregetTableStructure(java.lang.Class<? extends ITable<?>> tableObjectClass)static TableStructuregetTableStructure(ITable<?> table)static TypegetType(java.lang.Class<?> modelObjectClass)static booleanisEnumType(java.lang.Class<?> enumObjectClass)Returns whether the given class is a generated enum type and can be given togetEnumType(Class)as an argument without getting anIllegalArgumentException.static booleanisPolicyCmptType(java.lang.Class<?> policyModelClass)Returns whether the given class is a generated policy type and can be given togetPolicyCmptType(Class)as an argument without getting anIllegalArgumentException.static booleanisProductCmptType(java.lang.Class<?> productModelClass)Returns whether the given class is a generated product type and can be given togetProductCmptType(Class)as an argument without getting anIllegalArgumentException.static IpsModelvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static IpsModel[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static IpsModel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IpsModel c : IpsModel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IpsModel valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getTableStructure
public static TableStructure getTableStructure(java.lang.Class<? extends ITable<?>> tableObjectClass)
- Parameters:
tableObjectClass- a generated subclass ofITable- Returns:
- a
TableStructuredescribing the type and columns of the givenITableclass
-
getTableStructure
public static TableStructure getTableStructure(ITable<?> table)
- Returns:
- a
TableStructuredescribing the type and columns of the givenITable
-
isProductCmptType
public static boolean isProductCmptType(java.lang.Class<?> productModelClass)
Returns whether the given class is a generated product type and can be given togetProductCmptType(Class)as an argument without getting anIllegalArgumentException.- Parameters:
productModelClass- the class to check- Returns:
trueif the given class is a product model class
-
getProductCmptType
public static ProductCmptType getProductCmptType(java.lang.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:
java.lang.IllegalArgumentException- if the given class is not a valid model type- See Also:
isProductCmptType(Class)
-
getProductCmptType
public static ProductCmptType getProductCmptType(IProductComponent productComponent)
- Returns:
- the product model object for the given product component
- Throws:
java.lang.IllegalArgumentException- if the class of the given product component is not properly annotated for a product model
-
isPolicyCmptType
public static boolean isPolicyCmptType(java.lang.Class<?> policyModelClass)
Returns whether the given class is a generated policy type and can be given togetPolicyCmptType(Class)as an argument without getting anIllegalArgumentException.- Parameters:
policyModelClass- the class to check- Returns:
trueif the given class is a policy model class
-
getPolicyCmptType
public static PolicyCmptType getPolicyCmptType(java.lang.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:
java.lang.IllegalArgumentException- if the given class is not a valid model type- See Also:
isPolicyCmptType(Class)
-
getPolicyCmptType
public static PolicyCmptType getPolicyCmptType(IModelObject modelObject)
- Returns:
- the policy model object for the given model object
- Throws:
java.lang.IllegalArgumentException- if the class of the model object is not properly annotated for a policy model
-
getType
public static Type getType(java.lang.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:
java.lang.IllegalArgumentException- if the given class is not properly annotated for a model type
-
isEnumType
public static boolean isEnumType(java.lang.Class<?> enumObjectClass)
Returns whether the given class is a generated enum type and can be given togetEnumType(Class)as an argument without getting anIllegalArgumentException.- Parameters:
enumObjectClass- the class to check- Returns:
trueif the given class is an enum model class
-
getEnumType
public static EnumType getEnumType(java.lang.Class<?> enumObjectClass)
- Parameters:
enumObjectClass- a generated Faktor-IPS enum class- Returns:
- an
EnumTypedescribing the attributes of the given Faktor-IPS enum - Throws:
java.lang.IllegalArgumentException- if the given class is not a valid model type- See Also:
isEnumType(Class)
-
-