Class ContextFormatter
java.lang.Object
org.apache.lucene.search.uhighlight.PassageFormatter
org.opengrok.indexer.search.context.ContextFormatter
public class ContextFormatter
extends org.apache.lucene.search.uhighlight.PassageFormatter
Represents a subclass of 
PassageFormatter that uses
 PassageConverter.- 
Constructor Summary
ConstructorsConstructorDescriptionContextFormatter(ContextArgs args) Initializes a formatter for the specified arguments. - 
Method Summary
Modifier and TypeMethodDescriptionSplitsoriginalTextusingSourceSplitter, converts passages usingPassageConverter, and formats for presentation in OpenGrok UI using the instance's properties (e.g.,getUrl()andgetDefs()).getArgs()Gets the initialized value.getDefs()Gets the optional definitions.intGets the optional line limit to specify (if positive) a maximum number of lines to format and -- ifgetMoreUrl()is defined -- a "more" link to display.Gets the optional URL to use ifgetMoreLimit()is reached.Gets the optional scopes to use.getUrl()Gets the required URL to use for linking lines.voidsetDefs(Definitions value) Sets the optional definitions.voidsetMoreLimit(int value) Sets the optional line limit to specify (if positive) a maximum number of lines to format and -- ifgetMoreUrl()is defined -- a "more" link to display.voidsetMoreUrl(String value) Sets the optional URL to use ifgetMoreLimit()is reached.voidSets the optional scopes to use.voidSets the required URL to use for linking lines. 
- 
Constructor Details
- 
ContextFormatter
Initializes a formatter for the specified arguments.- Parameters:
 args- required instance
 
 - 
 - 
Method Details
- 
getArgs
Gets the initialized value.- Returns:
 - a defined instance
 
 - 
getUrl
Gets the required URL to use for linking lines.- Returns:
 - the URL or 
null 
 - 
setUrl
Sets the required URL to use for linking lines.- Parameters:
 value- the URL to use
 - 
getMoreUrl
Gets the optional URL to use ifgetMoreLimit()is reached.- Returns:
 - the URL or 
null 
 - 
setMoreUrl
Sets the optional URL to use ifgetMoreLimit()is reached.- Parameters:
 value- the URL to use
 - 
getMoreLimit
public int getMoreLimit()Gets the optional line limit to specify (if positive) a maximum number of lines to format and -- ifgetMoreUrl()is defined -- a "more" link to display. Default is zero (i.e. inactive).- Returns:
 - the line limit value
 
 - 
setMoreLimit
public void setMoreLimit(int value) Sets the optional line limit to specify (if positive) a maximum number of lines to format and -- ifgetMoreUrl()is defined -- a "more" link to display.- Parameters:
 value- the line limit
 - 
getDefs
Gets the optional definitions.- Returns:
 - the defs
 
 - 
setDefs
Sets the optional definitions.- Parameters:
 value- definitions
 - 
getScopes
Gets the optional scopes to use.- Returns:
 - the scopes
 
 - 
setScopes
Sets the optional scopes to use.- Parameters:
 value- scopes
 - 
format
SplitsoriginalTextusingSourceSplitter, converts passages usingPassageConverter, and formats for presentation in OpenGrok UI using the instance's properties (e.g.,getUrl()andgetDefs()).- Specified by:
 formatin classorg.apache.lucene.search.uhighlight.PassageFormatter- Parameters:
 passages- a required instanceoriginalText- a required instance- Returns:
 - a defined 
FormattedLinesinstance, which might be empty - Throws:
 IllegalStateException- ifgetUrl()is null
 
 -