Class PolicyCmptType


public class PolicyCmptType extends Type
Corresponds to a design time IPolicyCmptType.
  • Field Details

  • Constructor Details

  • Method Details

    • getKindName

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

      public boolean isConfiguredByProductCmptType()
      Returns whether this policy component type is configured by a product component type. If this method returns true you could use getProductCmptType() to get the type of the configuring product.
      Returns:
      true if this policy component type is configured else false
    • getProductCmptType

      public ProductCmptType getProductCmptType()
      Returns the ProductCmptType that configures this policy component type. Throws an IllegalArgumentException if this policy component type is not configured. Use isConfiguredByProductCmptType() to check whether it is configured or not.
      Returns:
      the ProductCmptType that configures this policy component type
      Throws:
      NullPointerException - if this policy component type is not configured
    • getSuperType

      public PolicyCmptType 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<PolicyCmptType> 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 PolicyAttribute 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:
    • getDeclaredAttribute

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

      public List<PolicyAttribute> 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 PolicyAttribute 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<PolicyAttribute> 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
    • getModelObjectAttributes

      public List<ModelObjectAttribute> getModelObjectAttributes(IModelObject modelObject)
      Returns a list with ModelObjectAttributes with all getAttributes() of this PolicyCmptType
      Parameters:
      modelObject - the IModelObject linked to the attributes
      Returns:
      a list with ModelObjectAttributes
      Since:
      21.6
    • getDeclaredAssociation

      public PolicyAssociation 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:
    • getDeclaredAssociation

      public PolicyAssociation 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
    • getDeclaredAssociations

      public List<PolicyAssociation> 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
    • getAssociation

      public PolicyAssociation 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<PolicyAssociation> 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
    • 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:
    • 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
    • getDeclaredValidationRule

      public ValidationRule getDeclaredValidationRule(String name)
      Returns the ValidationRule with the given name declared in this type. ValidationRules defined in the type's super types is not returned.
      Parameters:
      name - the name of the ValidationRule
      Returns:
      ValidationRule with the given name if it was found in this type
      Throws:
      IllegalArgumentException - if no ValidationRule with the given name exists
    • getDeclaredValidationRule

      public ValidationRule getDeclaredValidationRule(int index)
      Returns the declared ValidationRule at the given index.
      Parameters:
      index - the position at which the ValidationRule is expected in the list of declared ValidationRules
      Returns:
      the declared ValidationRule at the given index
      Throws:
      IndexOutOfBoundsException - if no ValidationRule exists for the given index
    • getDeclaredValidationRules

      public List<ValidationRule> getDeclaredValidationRules()
      Returns a list containing all ValidationRules declared in this model type. ValidationRules defined in the type's super types are not returned.
      Returns:
      the list of ValidationRules declared in this type
    • getValidationRule

      public ValidationRule getValidationRule(String name)
      Returns the ValidationRule with the given name declared in this type or one of its super types.
      Parameters:
      name - the name of the ValidationRule
      Returns:
      ValidationRule with the given name declared in this type or one of its super types
      Throws:
      IllegalArgumentException - if no ValidationRule with the given name exists
    • getValidationRules

      public List<ValidationRule> getValidationRules()
      Returns a list containing all the ValidationRules including those defined in the super types.
      Returns:
      the list of all ValidationRules declared in this type and in its super types
    • isValidationRuleDeclared

      public boolean isValidationRuleDeclared(String name)
      Returns whether the ValidationRule with the given name is declared in this type. ValidationRules defined in the type's super types are not considered.
      Parameters:
      name - the name of the ValidationRule
      Returns:
      true if the ValidationRule is declared in this type, false if not
    • isValidationRulePresent

      public boolean isValidationRulePresent(String name)
      Returns whether the ValidationRule with the given name is declared in this type or in any supertype.
      Parameters:
      name - the name of the ValidationRule
      Returns:
      true if the ValidationRule is declared in this type or in any supertype, false if not