Class StructuredTextDelimsEsc
java.lang.Object
org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler
org.eclipse.equinox.bidi.internal.StructuredTextDelims
org.eclipse.equinox.bidi.internal.StructuredTextDelimsEsc
A base handler for structured text composed of text segments separated by
separators where the text segments may include delimited parts within which
separators are treated like regular characters and the delimiters may be
escaped.
This is similar to StructuredTextDelims
except that delimiters can be
escaped using the backslash character.
- Two consecutive backslashes in a delimited part are treated like one regular character.
- An ending delimiter preceded by an odd number of backslashes is treated like a regular character within the delimited part.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
processSpecial
(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) Handles the text between start and end delimiters as a token.Methods inherited from class org.eclipse.equinox.bidi.internal.StructuredTextDelims
getDelimiters, indexOfSpecial
Methods inherited from class org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler
getDirection, getDirection, getSeparators, getSpecialsCount, insertMark, processSeparator, skipProcessing, toString
-
Constructor Details
-
StructuredTextDelimsEsc
public StructuredTextDelimsEsc() -
StructuredTextDelimsEsc
-
-
Method Details
-
processSpecial
public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) Handles the text between start and end delimiters as a token. This method inserts a directional mark if needed at positionseparLocation
which corresponds to a start delimiter, and skips until after the matching end delimiter, ignoring possibly escaped end delimiters.- Overrides:
processSpecial
in classStructuredTextDelims
- Parameters:
expert
- IStructuredTextExpert instance through which this handler is invoked. The handler can use IStructuredTextExpert methods to query items stored in the expert instance, like the currentenvironment
.text
- the structured text string before addition of any directional formatting characters.charTypes
- an object whose methods can be useful to the handler.offsets
- an object whose methods can be useful to the handler.caseNumber
- number of the special case to handle.separLocation
- the position returned byStructuredTextTypeHandler.indexOfSpecial(org.eclipse.equinox.bidi.advanced.IStructuredTextExpert, java.lang.String, org.eclipse.equinox.bidi.custom.StructuredTextCharTypes, org.eclipse.equinox.bidi.custom.StructuredTextOffsets, int, int)
. After calls toIStructuredTextExpert.leanToFullText(java.lang.String)
and other methods ofIStructuredTextExpert
which set a non-null final state,processSpecial
is called when initializing the processing with value ofseparLocation
equal to-1
.- Returns:
- the position after the matching end delimiter, or the length of
text
if no end delimiter is found.
-