Package org.eclipse.jface.text.rules
Class SingleLineRule
java.lang.Object
org.eclipse.jface.text.rules.PatternRule
org.eclipse.jface.text.rules.SingleLineRule
- All Implemented Interfaces:
IPredicateRule
,IRule
- Direct Known Subclasses:
EndOfLineRule
,WordPatternRule
A specific configuration of pattern rule whereby
the pattern begins with a specific sequence and may
end with a specific sequence, but will not span more
than a single line.
Originally since unknown version, but moved to org.eclipse.text in 3.14
- Since:
- 3.14
-
Field Summary
Fields inherited from class org.eclipse.jface.text.rules.PatternRule
fBreaksOnEOF, fBreaksOnEOL, fColumn, fEndSequence, fEscapeCharacter, fEscapeContinuesLine, fStartSequence, fToken, UNDEFINED
-
Constructor Summary
ConstructorDescriptionSingleLineRule
(String startSequence, String endSequence, IToken token) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token.SingleLineRule
(String startSequence, String endSequence, IToken token, char escapeCharacter) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token.SingleLineRule
(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token.SingleLineRule
(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF, boolean escapeContinuesLine) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token. -
Method Summary
Methods inherited from class org.eclipse.jface.text.rules.PatternRule
doEvaluate, doEvaluate, endSequenceDetected, evaluate, evaluate, getSuccessToken, sequenceDetected, setColumnConstraint
-
Constructor Details
-
SingleLineRule
Creates a rule for the given starting and ending sequence which, if detected, will return the specified token.- Parameters:
startSequence
- the pattern's start sequenceendSequence
- the pattern's end sequencetoken
- the token to be returned on success
-
SingleLineRule
Creates a rule for the given starting and ending sequence which, if detected, will return the specified token. Any character which follows the given escape character will be ignored.- Parameters:
startSequence
- the pattern's start sequenceendSequence
- the pattern's end sequencetoken
- the token to be returned on successescapeCharacter
- the escape character
-
SingleLineRule
public SingleLineRule(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token. Alternatively, the line can also be ended with the end of the file. Any character which follows the given escape character will be ignored.- Parameters:
startSequence
- the pattern's start sequenceendSequence
- the pattern's end sequencetoken
- the token to be returned on successescapeCharacter
- the escape characterbreaksOnEOF
- indicates whether the end of the file successfully terminates this rule- Since:
- 2.1
-
SingleLineRule
public SingleLineRule(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF, boolean escapeContinuesLine) Creates a rule for the given starting and ending sequence which, if detected, will return the specified token. Alternatively, the line can also be ended with the end of the file. Any character which follows the given escape character will be ignored. In addition, an escape character immediately before an end of line can be set to continue the line.- Parameters:
startSequence
- the pattern's start sequenceendSequence
- the pattern's end sequencetoken
- the token to be returned on successescapeCharacter
- the escape characterbreaksOnEOF
- indicates whether the end of the file successfully terminates this ruleescapeContinuesLine
- indicates whether the specified escape character is used for line continuation, so that an end of line immediately after the escape character does not terminate the line, even ifbreakOnEOL
is true- Since:
- 3.0
-