Class SubstringNode

    • Constructor Detail

      • SubstringNode

        public SubstringNode​(AttributeType attributeType,
                             String initialPattern,
                             String finalPattern)
        Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.
        Parameters:
        attributeType - the name of the attributeType to substring assert
        initialPattern - the initial fragment
        finalPattern - the final fragment
      • SubstringNode

        public SubstringNode​(String attribute,
                             String initialPattern,
                             String finalPattern)
        Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.
        Parameters:
        attribute - the name of the attribute to substring assert
        initialPattern - the initial fragment
        finalPattern - the final fragment
      • SubstringNode

        public SubstringNode​(AttributeType attribute)
        Creates a new SubstringNode object without any value
        Parameters:
        attribute - the name of the attribute to substring assert
      • SubstringNode

        public SubstringNode​(String attributeType)
        Creates a new SubstringNode object without any value
        Parameters:
        attributeType - the attributeType to substring assert
      • SubstringNode

        public SubstringNode​(List<String> anyPattern,
                             AttributeType attributeType,
                             String initialPattern,
                             String finalPattern)
        Creates a new SubstringNode object more than one wildcard and an any list.
        Parameters:
        anyPattern - list of internal fragments between wildcards
        attributeType - the attributeType to substring assert
        initialPattern - the initial fragment
        finalPattern - the final fragment
      • SubstringNode

        public SubstringNode​(List<String> anyPattern,
                             String attribute,
                             String initialPattern,
                             String finalPattern)
        Creates a new SubstringNode object more than one wildcard and an any list.
        Parameters:
        anyPattern - list of internal fragments between wildcards
        attribute - the name of the attribute to substring assert
        initialPattern - the initial fragment
        finalPattern - the final fragment
    • Method Detail

      • getRegex

        public static Pattern getRegex​(String initialPattern,
                                       String[] anyPattern,
                                       String finalPattern)
        Creates a regular expression from an LDAP substring assertion filter specification.
        Parameters:
        initialPattern - the initial fragment before wildcards
        anyPattern - fragments surrounded by wildcards if any
        finalPattern - the final fragment after last wildcard if any
        Returns:
        the regular expression for the substring match filter
        Throws:
        PatternSyntaxException - if a syntactically correct regular expression cannot be compiled
      • getInitial

        public final String getInitial()
        Gets the initial fragment.
        Returns:
        the initial prefix
      • setInitial

        public void setInitial​(String initialPattern)
        Set the initial pattern
        Parameters:
        initialPattern - The initial pattern
      • getFinal

        public final String getFinal()
        Gets the final fragment or suffix.
        Returns:
        the suffix
      • setFinal

        public void setFinal​(String finalPattern)
        Set the final pattern
        Parameters:
        finalPattern - The final pattern
      • getAny

        public final List<StringgetAny()
        Gets the list of wildcard surrounded any fragments.
        Returns:
        the any fragments
      • setAny

        public void setAny​(List<String> anyPattern)
        Set the any patterns
        Parameters:
        anyPattern - The any patterns
      • addAny

        public void addAny​(String anyPattern)
        Add an any pattern
        Parameters:
        anyPattern - The any pattern
      • getRegex

        public final Pattern getRegex​(Normalizer normalizer)
                               throws LdapException
        Gets the compiled regular expression for the substring expression.
        Parameters:
        normalizer - the normalizer to use for pattern component normalization
        Returns:
        the equivalent compiled regular expression
        Throws:
        LdapException - if there are problems while normalizing