Package org.ldaptive.templates
Class SearchTemplates
- java.lang.Object
-
- org.ldaptive.templates.SearchTemplates
-
public class SearchTemplates extends java.lang.Object
Contains a list of common search filter templates that can be formatted for any given query.- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchTemplates.DefaultTermParser
Adds each term as a filter parameter using the name 'termX' where X is the index of the term.static class
SearchTemplates.InitialTermParser
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
SearchTemplates.TermParser
Converts query terms into search filter parameters.
-
Constructor Summary
Constructors Constructor Description SearchTemplates(java.lang.String... templates)
Creates a new search templates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterTemplate[]
format(Query query)
Creates the filter templates using configured templates and the supplied query.java.lang.String
getSearchRestrictions()
Returns the filter to use for search restrictions.SearchTemplates.TermParser[]
getTermParsers()
Returns the term parsers used for creating filter parameters.void
setSearchRestrictions(java.lang.String restrictions)
Sets the filter to use for search restrictions.void
setTermParsers(SearchTemplates.TermParser... parsers)
Sets the term parsers used for creating filter parameters.java.lang.String
toString()
-
-
-
Method Detail
-
getSearchRestrictions
public java.lang.String getSearchRestrictions()
Returns the filter to use for search restrictions.- Returns:
- search restrictions
-
setSearchRestrictions
public void setSearchRestrictions(java.lang.String restrictions)
Sets the filter to use for search restrictions.- Parameters:
restrictions
- search restrictions
-
getTermParsers
public SearchTemplates.TermParser[] getTermParsers()
Returns the term parsers used for creating filter parameters.- Returns:
- term parsers
-
setTermParsers
public void setTermParsers(SearchTemplates.TermParser... parsers)
Sets the term parsers used for creating filter parameters.- Parameters:
parsers
- term parsers
-
format
public FilterTemplate[] format(Query query)
Creates the filter templates using configured templates and the supplied query.- Parameters:
query
- to create search filter with- Returns:
- filter templates
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-