Class ProductCmptType


public class ProductCmptType extends Type
Corresponds to a design time IProductCmptType.
  • Field Details

    • KIND_NAME

      public static final String KIND_NAME
      The name of the design time implementation class. Don't ask about the 2.
      See Also:
  • Constructor Details

  • Method Details

    • getKindName

      protected String getKindName()
      Specified by:
      getKindName in class Type
    • getDeclaredMethods

      protected List<Method> getDeclaredMethods()
      Overrides:
      getDeclaredMethods in class Type
    • isChangingOverTime

      public boolean isChangingOverTime()
      Returns whether this product component type is changing over time.
      Returns:
      true if it has generations else false
    • isConfigurationForPolicyCmptType

      public boolean isConfigurationForPolicyCmptType()
      Returns whether this product component type is a configuration for a policy component type.
      Returns:
      true if this type configures a policy component type, false if not
    • isSameOrSub

      public boolean isSameOrSub(ProductCmptType reference)
      Returns whether this ProductCmptType is the same or sub-type compared to a reference ProductCmptType.
      Parameters:
      reference - the ProductCmptType to compare to
      Returns:
      true if this type is the same or sub-type of the reference.
    • 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 a NullPointerException.
      Returns:
      The configured policy component type
      Throws:
      NullPointerException - if the product component type is not a configuration for a policy component type
      See Also:
    • getTableUsage

      public TableUsage getTableUsage(String name)
      Returns the TableUsage for 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 TableUsage with the specified name
      Throws:
      IllegalArgumentException - if there is no table usage with the specified name
    • getDeclaredTableUsages

      public List<TableUsage> getDeclaredTableUsages()
      Returns a list of TableUsages which are declared in this type. In contrast to getTableUsages() this does not return table usages of super types.
      Returns:
      A list of TableUsages declared in this type
    • getDeclaredTableUsage

      public TableUsage getDeclaredTableUsage(String name)
      Returns the TableUsage with the given name which is declared in this type. Any table usage defined in the super types will not be returned.
      Parameters:
      name - The name of the TableUsage
      Returns:
      TableUsage declared in this type with the given name
      Throws:
      IllegalArgumentException - if this type does not have a declared table usage with the given name
    • hasDeclaredTableUsage

      public boolean hasDeclaredTableUsage(String name)
      Returns whether the TableUsage for the specified name is declared in this type.
    • getTableUsages

      public List<TableUsage> getTableUsages()
      Returns a list of TableUsages which are declared in this type or in any super type.
      Returns:
      All TableUsages accessible in this product type.
    • getGenerationJavaClass

      public Class<?> getGenerationJavaClass()
    • getGenerationJavaInterface

      public Class<?> getGenerationJavaInterface()
    • getGenerationDeclarationClass

      public Class<?> getGenerationDeclarationClass()
    • getSuperType

      public ProductCmptType getSuperType()
      Description copied from class: Type
      Returns this type's super type or null if it has none.
      Specified by:
      getSuperType in class Type
      See Also:
    • findSuperType

      public Optional<ProductCmptType> findSuperType()
      Description copied from class: Type
      Returns this type's super type if present, otherwise an empty Optional.
      Overrides:
      findSuperType in class Type
    • getDeclaredAttribute

      public ProductAttribute getDeclaredAttribute(int index)
      Description copied from class: Type
      Returns the declared attribute at the given index.
      Overrides:
      getDeclaredAttribute in class Type
    • getDeclaredAttribute

      public ProductAttribute getDeclaredAttribute(String name)
      Description copied from class: Type
      Returns the attribute with the given name declared in this type. Attributes defined in the type's super types are not returned.
      Specified by:
      getDeclaredAttribute in class Type
      Parameters:
      name - the name of the attribute
      Returns:
      the attribute if it was found in this type
      See Also:
    • getDeclaredAttributes

      public List<ProductAttribute> getDeclaredAttributes()
      Description copied from class: Type
      Returns a list containing all attributes declared in this model type. Attributes defined in the type's super types are not returned.
      Specified by:
      getDeclaredAttributes in class Type
      Returns:
      the list of attributes declared in this type
    • getAttribute

      public ProductAttribute getAttribute(String name)
      Description copied from class: Type
      Returns the attribute with the given name declared in this type or one of it's super types.
      Overrides:
      getAttribute in class Type
    • getAttributes

      public List<ProductAttribute> getAttributes()
      Description copied from class: Type
      Returns a list containing the type's attributes including those defined in the type's super types.
      Specified by:
      getAttributes in class Type
      Returns:
      the list of all attributes declared in this type or in any supertype
    • isAttributeDeclared

      public boolean isAttributeDeclared(String name)
      Description copied from class: Type
      Returns whether the attribute with the given name is declared in this type. Attributes defined in the type's super types are not considered.
      Specified by:
      isAttributeDeclared in class Type
      Parameters:
      name - the name of the attribute
      Returns:
      true if the attribute is declared in this type, false if not
    • getDeclaredAssociation

      public ProductAssociation getDeclaredAssociation(int index)
      Description copied from class: Type
      Returns the association at the given index. Associations defined in the type's super types are not returned.
      Overrides:
      getDeclaredAssociation in class Type
    • getDeclaredAssociation

      public ProductAssociation getDeclaredAssociation(String name)
      Description copied from class: Type
      Returns the association with the given name declared 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:
      getDeclaredAssociation in class Type
      Parameters:
      name - the name of the association
      Returns:
      the association if it was found in this type
      See Also:
    • getDeclaredAssociations

      public List<ProductAssociation> getDeclaredAssociations()
      Description copied from class: Type
      Returns a list containing all associations declared in this type. Associations defined in the type's super types are not returned.
      Specified by:
      getDeclaredAssociations in class Type
      Returns:
      the list of associations declared in this type
    • isAssociationDeclared

      public boolean isAssociationDeclared(String name)
      Description copied from class: Type
      Returns whether the association with the given name is declared in this type. Associations defined in the type's super types are not considered.
      Specified by:
      isAssociationDeclared in class Type
      Parameters:
      name - the name of the association
      Returns:
      true if the association is declared in this type, false if not
      See Also:
    • getAssociation

      public ProductAssociation getAssociation(String name)
      Description copied from class: Type
      Returns the association with the given name declared in this type or one of it's super types. The name could either be the singular or the plural name.
      Overrides:
      getAssociation in class Type
    • getAssociations

      public List<ProductAssociation> getAssociations()
      Description copied from class: Type
      Returns the type's associations including those defined in it's super types.
      Specified by:
      getAssociations in class Type
      Returns:
      the list of all associations declared in this type or in any super type