Package org.faktorips.runtime.model
Enum IpsModel
- All Implemented Interfaces:
Serializable,Comparable<IpsModel>,java.lang.constant.Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumTypegetEnumType(Class<?> enumObjectClass) static EnumTypegetEnumType(Object enumInstance) static PolicyCmptTypegetPolicyCmptType(Class<? extends IModelObject> policyModelClass) static PolicyCmptTypegetPolicyCmptType(IModelObject modelObject) static ProductCmptTypegetProductCmptType(Class<? extends IProductComponent> productModelClass) static ProductCmptTypegetProductCmptType(IProductComponent productComponent) static TableStructuregetTableStructure(Class<? extends ITable<?>> tableObjectClass) static TableStructuregetTableStructure(ITable<?> table) static Typestatic booleanisEnumType(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(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(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 IpsModelReturns 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 Details
-
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
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 nameNullPointerException- if the argument is null
-
getTableStructure
- Parameters:
tableObjectClass- a generated subclass ofITable- Returns:
- a
TableStructuredescribing the type and columns of the givenITableclass
-
getTableStructure
- Returns:
- a
TableStructuredescribing the type and columns of the givenITable
-
isProductCmptType
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(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
- 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
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
- 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
- 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
- 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
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
- Parameters:
enumObjectClass- a generated Faktor-IPS enum class- Returns:
- an
EnumTypedescribing the attributes of the given Faktor-IPS enum - Throws:
IllegalArgumentException- if the given class is not a valid model type- See Also:
-
getEnumType
- Returns:
- an
EnumTypedescribing the attributes of the given Faktor-IPS enum. - Throws:
IllegalArgumentException- if the given object's class is not properly annotated for a model type
-