Package net.sf.xslthl.highlighters
Class NumberHighlighter
java.lang.Object
net.sf.xslthl.Highlighter
net.sf.xslthl.highlighters.NumberHighlighter
- Direct Known Subclasses:
HexaDecimalHighlighter
Recognizes numbers. Accepted parameters:
- point
- character used for the decimal point. If not declared no decimal points are accepted.
- thousands
- thousand separator
- exponent
- the string used for recognizing the exponent part of a floating point
- pointStarts
- a switch, when set the value defined as point can also be used to start a number. For example ".1234" would also be accepted as a number.
- prefix
- required start of a number, can be useful in the hexnumber highlighter to define how a hexadecimal number is started
- suffix
- an optional string that can be found after a number, can be define multiple times. This is often used to set the "size" of a integer or floating point.
- ignoreCase
- all strings parameters are case insensitive
- letterNoFollow
- If set, numbers may not contain a letter at the end. For example:
123kg
will not be seen as a number. This was the default before version 2.1
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.xslthl.Highlighter
Highlighter.IgnoreCaseComparator
-
Field Summary
Fields inherited from class net.sf.xslthl.Highlighter
XMLname
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe default style nameboolean
Perform highlighting on the current token stream.void
Initializerboolean
startsWith
(CharIter in) return true if the current character is a possible match for this highlighterMethods inherited from class net.sf.xslthl.Highlighter
isNewLine, reset
-
Constructor Details
-
NumberHighlighter
public NumberHighlighter()
-
-
Method Details
-
init
Description copied from class:Highlighter
Initializer- Overrides:
init
in classHighlighter
- Parameters:
params
-- Throws:
HighlighterConfigurationException
-
getDefaultStyle
Description copied from class:Highlighter
The default style name- Specified by:
getDefaultStyle
in classHighlighter
- Returns:
-
startsWith
Description copied from class:Highlighter
return true if the current character is a possible match for this highlighter- Overrides:
startsWith
in classHighlighter
- Parameters:
in
-- Returns:
-
highlight
Description copied from class:Highlighter
Perform highlighting on the current token stream. Return true when highlighting was performed, or false in case of a false positive.- Specified by:
highlight
in classHighlighter
- Parameters:
in
-out
-- Returns:
-