HighlightOptions

Inheritance: java.lang.Object, com.groupdocs.search.options.TextOptions

All Implemented Interfaces: com.groupdocs.search.options.IHighlightOptions

public class HighlightOptions extends TextOptions implements IHighlightOptions

Provides options for highlighting found terms.

Learn more

Constructors

Constructor Description
HighlightOptions() Initializes a new instance of the HighlightOptions class.
HighlightOptions(Object data) Initializes a new instance of the TextOptions class.

Methods

Method Description
getTermsBefore() Gets the maximum number of words in a text snippet before highlighted word.
setTermsBefore(int value) Sets the maximum number of words in a text snippet before highlighted word.
getTermsAfter() Gets the maximum number of words in a text snippet after highlighted word.
setTermsAfter(int value) Sets the maximum number of words in a text snippet after highlighted word.
getTermsTotal() Gets the maximum number of words in a text snippet.
setTermsTotal(int value) Sets the maximum number of words in a text snippet.
getUseInlineStyles() Gets a value indicating whether inline styles are used to highlight occurrences.
setUseInlineStyles(boolean value) Sets a value indicating whether inline styles are used to highlight occurrences.
getHighlightColor() Gets a color that is used to highlight occurrences.
setHighlightColor(Color value) Sets a color that is used to highlight occurrences.
getTermHighlightStartTag() Gets the start tag of the highlighting of the found word.
setTermHighlightStartTag(String value) Sets the start tag of the highlighting of the found word.
getTermHighlightEndTag() Gets the end tag of the highlighting of the found word.
setTermHighlightEndTag(String value) Sets the end tag of the highlighting of the found word.

HighlightOptions()

public HighlightOptions()

Initializes a new instance of the HighlightOptions class.

HighlightOptions(Object data)

public HighlightOptions(Object data)

Initializes a new instance of the TextOptions class.

Parameters:

Parameter Type Description
data java.lang.Object The serialized data.

getTermsBefore()

public int getTermsBefore()

Gets the maximum number of words in a text snippet before highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .

Returns: int - The maximum number of words in a text snippet before highlighted word.

setTermsBefore(int value)

public void setTermsBefore(int value)

Sets the maximum number of words in a text snippet before highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .

Parameters:

Parameter Type Description
value int The maximum number of words in a text snippet before highlighted word.

getTermsAfter()

public int getTermsAfter()

Gets the maximum number of words in a text snippet after highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .

Returns: int - The maximum number of words in a text snippet after highlighted word.

setTermsAfter(int value)

public void setTermsAfter(int value)

Sets the maximum number of words in a text snippet after highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .

Parameters:

Parameter Type Description
value int The maximum number of words in a text snippet after highlighted word.

getTermsTotal()

public int getTermsTotal()

Gets the maximum number of words in a text snippet. The value must be in the range from 0 to 10000. The default value is 21 .

Returns: int - The maximum number of words in a text snippet.

setTermsTotal(int value)

public void setTermsTotal(int value)

Sets the maximum number of words in a text snippet. The value must be in the range from 0 to 10000. The default value is 21 .

Parameters:

Parameter Type Description
value int The maximum number of words in a text snippet.

getUseInlineStyles()

public boolean getUseInlineStyles()

Gets a value indicating whether inline styles are used to highlight occurrences. The default value is true .

Returns: boolean - A value indicating whether inline styles are used to highlight occurrences.

setUseInlineStyles(boolean value)

public void setUseInlineStyles(boolean value)

Sets a value indicating whether inline styles are used to highlight occurrences. The default value is true .

Parameters:

Parameter Type Description
value boolean A value indicating whether inline styles are used to highlight occurrences.

getHighlightColor()

public Color getHighlightColor()

Gets a color that is used to highlight occurrences. The default value is #FFD800.

Returns: Color - A color that is used to highlight occurrences.

setHighlightColor(Color value)

public void setHighlightColor(Color value)

Sets a color that is used to highlight occurrences. The default value is #FFD800.

Parameters:

Parameter Type Description
value Color A color that is used to highlight occurrences.

getTermHighlightStartTag()

public String getTermHighlightStartTag()

Gets the start tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.

Returns: java.lang.String - The start tag of the highlighting of the found word.

setTermHighlightStartTag(String value)

public void setTermHighlightStartTag(String value)

Sets the start tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.

Parameters:

Parameter Type Description
value java.lang.String The start tag of the highlighting of the found word.

getTermHighlightEndTag()

public String getTermHighlightEndTag()

Gets the end tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.

Returns: java.lang.String - The end tag of the highlighting of the found word.

setTermHighlightEndTag(String value)

public void setTermHighlightEndTag(String value)

Sets the end tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.

Parameters:

Parameter Type Description
value java.lang.String The end tag of the highlighting of the found word.