Package org.ldaptive.templates
Class SearchTemplates
java.lang.Object
org.ldaptive.templates.SearchTemplates
Contains a list of common search filter templates that can be formatted for any given query.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Adds each term as a filter parameter using the name 'termX' where X is the index of the term.static class
Adds the first letter of each term as a filter parameter using the name 'initialX' where X is the index of the term.static interface
Converts query terms into search filter parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]
Search filter templates.private String
Appended to every search filter to restrict results.private SearchTemplates.TermParser[]
Term parsers for creating filter parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
concatFilters
(String... filters) Concatenates the supplied filters into a single filter will all arguments ANDED together.Creates the filter templates using configured templates and the supplied query.Returns the filter to use for search restrictions.Returns the term parsers used for creating filter parameters.void
setSearchRestrictions
(String restrictions) Sets the filter to use for search restrictions.void
setTermParsers
(SearchTemplates.TermParser... parsers) Sets the term parsers used for creating filter parameters.toString()
-
Field Details
-
filterTemplates
Search filter templates. -
searchRestrictions
Appended to every search filter to restrict results. -
termParsers
Term parsers for creating filter parameters.
-
-
Constructor Details
-
SearchTemplates
Creates a new search templates.- Parameters:
templates
- list of search filters
-
-
Method Details
-
getSearchRestrictions
Returns the filter to use for search restrictions.- Returns:
- search restrictions
-
setSearchRestrictions
Sets the filter to use for search restrictions.- Parameters:
restrictions
- search restrictions
-
getTermParsers
Returns the term parsers used for creating filter parameters.- Returns:
- term parsers
-
setTermParsers
Sets the term parsers used for creating filter parameters.- Parameters:
parsers
- term parsers
-
format
Creates the filter templates using configured templates and the supplied query.- Parameters:
query
- to create search filter with- Returns:
- filter templates
-
concatFilters
Concatenates the supplied filters into a single filter will all arguments ANDED together. Null array values are ignored.- Parameters:
filters
- to concatenate- Returns:
- search filter
-
toString
-