Class FilterParser

java.lang.Object
org.apache.directory.api.ldap.model.filter.FilterParser

public final class FilterParser extends Object
This class parse a Ldap filter. The grammar is given in RFC 4515
Author:
Apache Directory Project
  • Method Summary

    Modifier and Type
    Method
    Description
    static ExprNode
    parse(String filter)
    Parses a search filter from it's string representation to an expression node object.
    static ExprNode
    parse(String filter, boolean relaxed)
    Parses a search filter from it's string representation to an expression node object.
    static ExprNode
    parse(SchemaManager schemaManager, String filter)
    Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager
    static ExprNode
    parse(SchemaManager schemaManager, String filter, boolean relaxed)
    Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager
    static ExprNode
    parse(SchemaManager schemaManager, String filter, org.apache.directory.api.util.Position pos)
    Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parse

      public static ExprNode parse(String filter) throws ParseException
      Parses a search filter from it's string representation to an expression node object.
      Parameters:
      filter - the search filter in it's string representation
      Returns:
      the expression node object
      Throws:
      ParseException - If the filter is invalid
    • parse

      public static ExprNode parse(String filter, boolean relaxed) throws ParseException
      Parses a search filter from it's string representation to an expression node object. In relaxed mode the filter may violate RFC 4515, e.g. the underscore in attribute names is allowed.
      Parameters:
      filter - the search filter in it's string representation
      relaxed - true to parse the filter in relaxed mode
      Returns:
      the expression node object
      Throws:
      ParseException - If the filter is invalid
    • parse

      public static ExprNode parse(SchemaManager schemaManager, String filter) throws ParseException
      Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager
      Parameters:
      schemaManager - The SchemaManager to use
      filter - the search filter in it's string representation
      Returns:
      the expression node object
      Throws:
      ParseException - If the filter is invalid
    • parse

      public static ExprNode parse(SchemaManager schemaManager, String filter, org.apache.directory.api.util.Position pos) throws ParseException
      Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager
      Parameters:
      schemaManager - The SchemaManager to use
      filter - the search filter in it's string representation
      Returns:
      the expression node object
      Throws:
      ParseException - If the filter is invalid
    • parse

      public static ExprNode parse(SchemaManager schemaManager, String filter, boolean relaxed) throws ParseException
      Parses a search filter from it's string representation to an expression node object, using the provided SchemaManager
      Parameters:
      schemaManager - The SchemaManager to use
      filter - the search filter in it's string representation
      relaxed - true to parse the filter in relaxed mode
      Returns:
      the expression node object
      Throws:
      ParseException - If the filter is invalid