org.loom.resolution
Class AutocompleteResolution

java.lang.Object
  extended by org.loom.resolution.AbstractHttpResolution
      extended by org.loom.resolution.AutocompleteResolution
All Implemented Interfaces:
CacheableResolution, HttpResolution, Resolution

public class AutocompleteResolution
extends AbstractHttpResolution

Returns an unordered list of autocompleter results highlighting the match part in every result.


Constructor Summary
AutocompleteResolution(java.util.regex.Pattern highlightPattern, java.lang.String highlightText)
           
AutocompleteResolution(java.lang.String highlightText)
           
 
Method Summary
 AutocompleteEntry add(java.lang.String value)
          Adds a new item to the results list
 void addAll(java.lang.Iterable<java.lang.String> strings)
          Adds every String inside a Collection
 java.util.regex.Pattern getHighlightPattern()
           
 java.lang.String getHighlightText()
           
protected  java.lang.String highlight(java.lang.String text)
           
 boolean isSanitizeValues()
           
 void resolve(LoomServletRequest request, LoomServletResponse response)
          Write the response contents
 void setSanitizeValues(boolean sanitizeValues)
           
 
Methods inherited from class org.loom.resolution.AbstractHttpResolution
addCookie, addCookie, addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, getCacheControl, getCharset, getContentType, setCacheControl, setCharset, setContentType, setDateHeader, setDateHeaderIfNotPresent, setHeader, setHeaderIfNotPresent, setIntHeader, setIntHeaderIfNotPresent, setJsonHeader, writeHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutocompleteResolution

public AutocompleteResolution(java.lang.String highlightText)

AutocompleteResolution

public AutocompleteResolution(java.util.regex.Pattern highlightPattern,
                              java.lang.String highlightText)
Method Detail

add

public AutocompleteEntry add(java.lang.String value)
Adds a new item to the results list


addAll

public void addAll(java.lang.Iterable<java.lang.String> strings)
Adds every String inside a Collection


resolve

public void resolve(LoomServletRequest request,
                    LoomServletResponse response)
             throws java.io.IOException,
                    javax.servlet.ServletException
Description copied from interface: Resolution
Write the response contents

Specified by:
resolve in interface Resolution
Specified by:
resolve in class AbstractHttpResolution
Parameters:
request - the current request object
response - the current response object
Throws:
java.io.IOException
javax.servlet.ServletException

highlight

protected java.lang.String highlight(java.lang.String text)

getHighlightText

public java.lang.String getHighlightText()

getHighlightPattern

public java.util.regex.Pattern getHighlightPattern()

isSanitizeValues

public boolean isSanitizeValues()

setSanitizeValues

public void setSanitizeValues(boolean sanitizeValues)