Package org.faktorips.runtime.model.type
Class ProductCmptType
- java.lang.Object
-
- org.faktorips.runtime.model.type.ModelElement
-
- org.faktorips.runtime.model.type.Type
-
- org.faktorips.runtime.model.type.ProductCmptType
-
public class ProductCmptType extends Type
Corresponds to a design timeIProductCmptType.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.faktorips.runtime.model.type.Type
Type.AnnotatedElementMatcher<T extends java.lang.annotation.Annotation>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKIND_NAMEThe name of the design time implementation class.
-
Constructor Summary
Constructors Constructor Description ProductCmptType(java.lang.String name, AnnotatedDeclaration annotatedDeclaration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ProductCmptType>findSuperType()Returns this type's super type ifpresent, otherwise anempty Optional.ProductAssociationgetAssociation(java.lang.String name)Returns the association with the givennamedeclared in this type or one of it's super types.java.util.List<ProductAssociation>getAssociations()Returns the type's associations including those defined in it's super types.ProductAttributegetAttribute(java.lang.String name)Returns the attribute with the givennamedeclared in this type or one of it's super types.java.util.List<ProductAttribute>getAttributes()Returns a list containing the type's attributes including those defined in the type's super types.ProductAssociationgetDeclaredAssociation(int index)Returns the association at the givenindex.ProductAssociationgetDeclaredAssociation(java.lang.String name)Returns the association with the givennamedeclared in this type.java.util.List<ProductAssociation>getDeclaredAssociations()Returns a list containing all associations declared in this type.ProductAttributegetDeclaredAttribute(int index)Returns the declared attribute at the givenindex.ProductAttributegetDeclaredAttribute(java.lang.String name)Returns the attribute with the givennamedeclared in this type.java.util.List<ProductAttribute>getDeclaredAttributes()Returns a list containing all attributes declared in this model type.protected java.util.List<java.lang.reflect.Method>getDeclaredMethods()TableUsagegetDeclaredTableUsage(java.lang.String name)Returns theTableUsagewith the givennamewhich is declared in this type.java.util.List<TableUsage>getDeclaredTableUsages()Returns a list ofTableUsageswhich are declared in this type.java.lang.Class<?>getGenerationDeclarationClass()java.lang.Class<?>getGenerationJavaClass()java.lang.Class<?>getGenerationJavaInterface()protected java.lang.StringgetKindName()PolicyCmptTypegetPolicyCmptType()Returns the policy component type which is configured by this product component type.ProductCmptTypegetSuperType()Returns this type's super type ornullif it has none.TableUsagegetTableUsage(java.lang.String name)Returns theTableUsagefor the specified name.java.util.List<TableUsage>getTableUsages()Returns a list ofTableUsageswhich are declared in this type or in any super type.booleanhasDeclaredTableUsage(java.lang.String name)Returns whether theTableUsagefor the specifiednameis declared in this type.booleanisAssociationDeclared(java.lang.String name)Returns whether the association with the givennameis declared in this type.booleanisAttributeDeclared(java.lang.String name)Returns whether the attribute with the givennameis declared in this type.booleanisChangingOverTime()Returns whether this product component type is changing over time.booleanisConfigurationForPolicyCmptType()Returns whether this product component type is a configuration for a policy component type.-
Methods inherited from class org.faktorips.runtime.model.type.Type
findDeclaredField, findDeclaredMethod, findJavaInterface, getAnnotatedDeclaration, getDeclarationClass, getDeclaredFields, getJavaClass, getJavaInterface, getMessageHelper, getMessageKey, isAssociationPresent, isAttributePresent, isSuperTypePresent, searchDeclaredMethod, toString
-
Methods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, invokeField, invokeMethod, isDeprecated
-
-
-
-
Field Detail
-
KIND_NAME
public static final java.lang.String KIND_NAME
The name of the design time implementation class. Don't ask about the 2.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProductCmptType
public ProductCmptType(java.lang.String name, AnnotatedDeclaration annotatedDeclaration)
-
-
Method Detail
-
getKindName
protected java.lang.String getKindName()
- Specified by:
getKindNamein classType
-
getDeclaredMethods
protected java.util.List<java.lang.reflect.Method> getDeclaredMethods()
- Overrides:
getDeclaredMethodsin classType
-
isChangingOverTime
public boolean isChangingOverTime()
Returns whether this product component type is changing over time.- Returns:
trueif it has generations elsefalse
-
isConfigurationForPolicyCmptType
public boolean isConfigurationForPolicyCmptType()
Returns whether this product component type is a configuration for a policy component type.- Returns:
trueif this type configures a policy component type,falseif not
-
getPolicyCmptType
public PolicyCmptType getPolicyCmptType()
Returns the policy component type which is configured by this product component type. If this product component class has no configuration it throws aNullPointerException.- Returns:
- The configured policy component type
- Throws:
java.lang.NullPointerException- if the product component type is not a configuration for a policy component type- See Also:
isConfigurationForPolicyCmptType()
-
getTableUsage
public TableUsage getTableUsage(java.lang.String name)
Returns theTableUsagefor the specified name. May look in super types if there is no table usage in this type.- Parameters:
name- The name of the table usage- Returns:
- The
TableUsagewith the specified name - Throws:
java.lang.IllegalArgumentException- if there is no table usage with the specified name
-
getDeclaredTableUsages
public java.util.List<TableUsage> getDeclaredTableUsages()
Returns a list ofTableUsageswhich are declared in this type. In contrast togetTableUsages()this does not return table usages of super types.- Returns:
- A list of
TableUsagesdeclared in this type
-
getDeclaredTableUsage
public TableUsage getDeclaredTableUsage(java.lang.String name)
Returns theTableUsagewith the givennamewhich is declared in this type. Any table usage defined in the super types will not be returned.- Parameters:
name- The name of theTableUsage- Returns:
TableUsagedeclared in this type with the given name- Throws:
java.lang.IllegalArgumentException- if this type does not have a declared table usage with the given name
-
hasDeclaredTableUsage
public boolean hasDeclaredTableUsage(java.lang.String name)
Returns whether theTableUsagefor the specifiednameis declared in this type.
-
getTableUsages
public java.util.List<TableUsage> getTableUsages()
Returns a list ofTableUsageswhich are declared in this type or in any super type.- Returns:
- All
TableUsagesaccessible in this product type.
-
getGenerationJavaClass
public java.lang.Class<?> getGenerationJavaClass()
-
getGenerationJavaInterface
public java.lang.Class<?> getGenerationJavaInterface()
-
getGenerationDeclarationClass
public java.lang.Class<?> getGenerationDeclarationClass()
-
getSuperType
public ProductCmptType getSuperType()
Description copied from class:TypeReturns this type's super type ornullif it has none.- Specified by:
getSuperTypein classType- See Also:
findSuperType for null-safe processing
-
findSuperType
public java.util.Optional<ProductCmptType> findSuperType()
Description copied from class:TypeReturns this type's super type ifpresent, otherwise anempty Optional.- Overrides:
findSuperTypein classType
-
getDeclaredAttribute
public ProductAttribute getDeclaredAttribute(int index)
Description copied from class:TypeReturns the declared attribute at the givenindex.- Overrides:
getDeclaredAttributein classType
-
getDeclaredAttribute
public ProductAttribute getDeclaredAttribute(java.lang.String name)
Description copied from class:TypeReturns the attribute with the givennamedeclared in this type. Attributes defined in the type's super types are not returned.- Specified by:
getDeclaredAttributein classType- Parameters:
name- the name of the attribute- Returns:
- the attribute if it was found in this type
- See Also:
Type.isAttributeDeclared(String)
-
getDeclaredAttributes
public java.util.List<ProductAttribute> getDeclaredAttributes()
Description copied from class:TypeReturns a list containing all attributes declared in this model type. Attributes defined in the type's super types are not returned.- Specified by:
getDeclaredAttributesin classType- Returns:
- the list of attributes declared in this type
-
getAttribute
public ProductAttribute getAttribute(java.lang.String name)
Description copied from class:TypeReturns the attribute with the givennamedeclared in this type or one of it's super types.- Overrides:
getAttributein classType
-
getAttributes
public java.util.List<ProductAttribute> getAttributes()
Description copied from class:TypeReturns a list containing the type's attributes including those defined in the type's super types.- Specified by:
getAttributesin classType- Returns:
- the list of all attributes declared in this type or in any supertype
-
isAttributeDeclared
public boolean isAttributeDeclared(java.lang.String name)
Description copied from class:TypeReturns whether the attribute with the givennameis declared in this type. Attributes defined in the type's super types are not considered.- Specified by:
isAttributeDeclaredin classType- Parameters:
name- the name of the attribute- Returns:
trueif the attribute is declared in this type,falseif not
-
getDeclaredAssociation
public ProductAssociation getDeclaredAssociation(int index)
Description copied from class:TypeReturns the association at the givenindex. Associations defined in the type's super types are not returned.- Overrides:
getDeclaredAssociationin classType
-
getDeclaredAssociation
public ProductAssociation getDeclaredAssociation(java.lang.String name)
Description copied from class:TypeReturns the association with the givennamedeclared in this type. Associations defined in the type's super types are not considered. The name could either be the singular or the plural name.- Specified by:
getDeclaredAssociationin classType- Parameters:
name- the name of the association- Returns:
- the association if it was found in this type
- See Also:
Type.isAssociationDeclared(String)
-
getDeclaredAssociations
public java.util.List<ProductAssociation> getDeclaredAssociations()
Description copied from class:TypeReturns a list containing all associations declared in this type. Associations defined in the type's super types are not returned.- Specified by:
getDeclaredAssociationsin classType- Returns:
- the list of associations declared in this type
-
isAssociationDeclared
public boolean isAssociationDeclared(java.lang.String name)
Description copied from class:TypeReturns whether the association with the givennameis declared in this type. Associations defined in the type's super types are not considered.- Specified by:
isAssociationDeclaredin classType- Parameters:
name- the name of the association- Returns:
trueif the association is declared in this type,falseif not- See Also:
Type.isAssociationPresent(String)
-
getAssociation
public ProductAssociation getAssociation(java.lang.String name)
Description copied from class:TypeReturns the association with the givennamedeclared in this type or one of it's super types. The name could either be the singular or the plural name.- Overrides:
getAssociationin classType
-
getAssociations
public java.util.List<ProductAssociation> getAssociations()
Description copied from class:TypeReturns the type's associations including those defined in it's super types.- Specified by:
getAssociationsin classType- Returns:
- the list of all associations declared in this type or in any super type
-
-