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 EnumType
getEnumType
(Class<?> enumObjectClass) static EnumType
getEnumType
(Object enumInstance) static PolicyCmptType
getPolicyCmptType
(Class<? extends IModelObject> policyModelClass) static PolicyCmptType
getPolicyCmptType
(IModelObject modelObject) static ProductCmptType
getProductCmptType
(Class<? extends IProductComponent> productModelClass) static ProductCmptType
getProductCmptType
(IProductComponent productComponent) static TableStructure
getTableStructure
(Class<? extends ITable<?>> tableObjectClass) static TableStructure
getTableStructure
(ITable<?> table) static Type
static boolean
isEnumType
(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 boolean
isExtensibleEnumType
(Class<?> enumObjectClass) Returns whether the given class is a generated extensible enum type and can be given togetEnumType(Class)
as an argument without getting anIllegalArgumentException
.static boolean
isPolicyCmptType
(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 boolean
isProductCmptType
(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 IpsModel
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 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
TableStructure
describing the type and columns of the givenITable
class
-
getTableStructure
- Returns:
- a
TableStructure
describing 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:
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
- 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:
true
if 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:
true
if the given class is an enum model class
-
isExtensibleEnumType
Returns whether the given class is a generated extensible enum type and can be given togetEnumType(Class)
as an argument without getting anIllegalArgumentException
.- Parameters:
enumObjectClass
- the class to check- Returns:
true
if the given class is an extensible enum model class
-
getEnumType
- 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
- 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
-