Package net.sf.xslthl.highlighters
Class NumberHighlighter
- java.lang.Object
-
- net.sf.xslthl.Highlighter
-
- net.sf.xslthl.highlighters.NumberHighlighter
-
- Direct Known Subclasses:
HexaDecimalHighlighter
public class NumberHighlighter extends Highlighter
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 Constructor Description NumberHighlighter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDefaultStyle()
The default style nameboolean
highlight(CharIter in, java.util.List<Block> out)
Perform highlighting on the current token stream.void
init(Params params)
Initializerboolean
startsWith(CharIter in)
return true if the current character is a possible match for this highlighter-
Methods inherited from class net.sf.xslthl.Highlighter
isNewLine, reset
-
-
-
-
Method Detail
-
init
public void init(Params params) throws HighlighterConfigurationException
Description copied from class:Highlighter
Initializer- Overrides:
init
in classHighlighter
- Throws:
HighlighterConfigurationException
-
getDefaultStyle
public java.lang.String getDefaultStyle()
Description copied from class:Highlighter
The default style name- Specified by:
getDefaultStyle
in classHighlighter
- Returns:
-
startsWith
public boolean startsWith(CharIter in)
Description copied from class:Highlighter
return true if the current character is a possible match for this highlighter- Overrides:
startsWith
in classHighlighter
- Returns:
-
highlight
public boolean highlight(CharIter in, java.util.List<Block> out)
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
- Returns:
-
-