Class PolicyCmptType


  • public class PolicyCmptType
    extends Type
    Corresponds to a design time IPolicyCmptType.
    • Constructor Detail

      • PolicyCmptType

        public PolicyCmptType​(java.lang.String name,
                              AnnotatedDeclaration annotatedDeclararation)
    • Method Detail

      • getKindName

        protected java.lang.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:
        java.lang.NullPointerException - if this policy component type is not configured
      • findSuperType

        public java.util.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​(java.lang.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:
        Type.isAttributeDeclared(String)
      • 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 java.util.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​(java.lang.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 java.util.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
      • getDeclaredAssociation

        public PolicyAssociation getDeclaredAssociation​(java.lang.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:
        Type.isAssociationDeclared(String)
      • 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 java.util.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​(java.lang.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 java.util.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​(java.lang.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:
        Type.isAssociationPresent(String)
      • isAttributeDeclared

        public boolean isAttributeDeclared​(java.lang.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​(java.lang.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:
        java.lang.IllegalArgumentException - if no ValidationRule with the given name exists
      • getDeclaredValidationRules

        public java.util.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​(java.lang.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:
        java.lang.IllegalArgumentException - if no ValidationRule with the given name exists
      • getValidationRules

        public java.util.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​(java.lang.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