Package org.ldaptive.templates
Class SearchTemplates
- java.lang.Object
-
- org.ldaptive.templates.SearchTemplates
-
public class SearchTemplates extends java.lang.ObjectContains 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 classSearchTemplates.DefaultTermParserAdds each term as a filter parameter using the name 'termX' where X is the index of the term.static classSearchTemplates.InitialTermParserAdds the first letter of each term as a filter parameter using the name 'initialX' where X is the index of the term.static interfaceSearchTemplates.TermParserConverts 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.StringgetSearchRestrictions()Returns the filter to use for search restrictions.SearchTemplates.TermParser[]getTermParsers()Returns the term parsers used for creating filter parameters.voidsetSearchRestrictions(java.lang.String restrictions)Sets the filter to use for search restrictions.voidsetTermParsers(SearchTemplates.TermParser... parsers)Sets the term parsers used for creating filter parameters.java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-