Class Roles.Role

  • Enclosing class:
    Roles

    public static class Roles.Role
    extends Object
    The role element in tagging preset definition. Information on a certain role, which is expected for the relation members.
    • Constructor Detail

      • Role

        public Role()
    • Method Detail

      • setType

        public void setType​(String types)
                     throws SAXException
        Sets the presets types expected for this role.
        Parameters:
        types - comma-separated set of expected types
        Throws:
        SAXException - if an unknown type is detected
      • setRequisite

        public void setRequisite​(String str)
                          throws SAXException
        Sets whether this role is required at least once in the relation.
        Parameters:
        str - "required" or "optional"
        Throws:
        SAXException - if str is neither "required" or "optional"
      • setRegexp

        public void setRegexp​(String str)
                       throws SAXException
        Sets whether the role name is a regular expression.
        Parameters:
        str - "true" or "false"
        Throws:
        SAXException - if str is neither "true" or "false"
      • setMember_expression

        public void setMember_expression​(String memberExpression)
                                  throws SAXException
        Sets an expression (cf. search dialog) for objects of this role
        Parameters:
        memberExpression - an expression (cf. search dialog) for objects of this role
        Throws:
        SAXException - in case of parsing error
      • setCount

        public void setCount​(String count)
        Sets how often must the element appear.
        Parameters:
        count - how often must the element appear
      • getValidCount

        public long getValidCount​(long c)
        Return either argument, the highest possible value or the lowest allowed value
        Parameters:
        c - count
        Returns:
        the highest possible value or the lowest allowed value
        See Also:
        required
      • isRole

        public boolean isRole​(String role)
        Check if the given role matches this class (required to check regexp role types)
        Parameters:
        role - role to check
        Returns:
        true if role matches
        Since:
        11989
      • addToPanel

        public boolean addToPanel​(JPanel p)
        Adds this role to the given panel.
        Parameters:
        p - panel where to add this role
        Returns:
        true