Package ftl
Klasse TokenSource
java.lang.Object
ftl.TokenSource
- Alle implementierten Schnittstellen:
CharSequence
- Bekannte direkte Unterklassen:
FreshMarkerLexer
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
TokenSource
(String inputSource, CharSequence input, int startingLine, int startingColumn, int tabSize, boolean preserveTabs, boolean preserveLineEndings, boolean javaUnicodeEscape, String terminatingString) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
final char
charAt
(int pos) protected static boolean
checkIntervals
(int[] ranges, int ch) int
getCodePointColumnFromOffset
(int pos) int
getLineEndOffset
(int lineNumber) The offset of the end of the given line.int
getLineFromOffset
(int pos) int
getLineStartOffset
(int lineNumber) The offset of the start of the given line.protected int
getText
(int startOffset, int endOffset) final int
length()
protected static String
mungeContent
(CharSequence content, boolean preserveTabs, int tabSize, boolean preserveLines, boolean javaUnicodeEscape, String terminatingString) nextCachedToken
(int offset) previousCachedToken
(int offset) void
setInputSource
(String inputSource) void
setStartingPos
(int startingLine, int startingColumn) Set the starting line/column for location reporting.void
setTabSize
(int tabSize) protected final void
skipTokens
(int begin, int end) static String
stringFromBytes
(byte[] bytes) static String
stringFromBytes
(byte[] bytes, Charset charset) final CharSequence
subSequence
(int start, int end) toString()
void
uncacheTokens
(Node.TerminalNode lastToken) Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden java.lang.CharSequence
chars, codePoints, isEmpty
-
Konstruktordetails
-
TokenSource
protected TokenSource(String inputSource, CharSequence input, int startingLine, int startingColumn, int tabSize, boolean preserveTabs, boolean preserveLineEndings, boolean javaUnicodeEscape, String terminatingString)
-
-
Methodendetails
-
setTabSize
public void setTabSize(int tabSize) -
getTabSize
protected int getTabSize() -
setStartingPos
public void setStartingPos(int startingLine, int startingColumn) Set the starting line/column for location reporting. By default, this is 1,1. -
mungeContent
protected static String mungeContent(CharSequence content, boolean preserveTabs, int tabSize, boolean preserveLines, boolean javaUnicodeEscape, String terminatingString) -
skipTokens
protected final void skipTokens(int begin, int end) -
charAt
public final char charAt(int pos) - Angegeben von:
charAt
in SchnittstelleCharSequence
-
length
public final int length()- Angegeben von:
length
in SchnittstelleCharSequence
-
subSequence
- Angegeben von:
subSequence
in SchnittstelleCharSequence
-
toString
- Angegeben von:
toString
in SchnittstelleCharSequence
- Setzt außer Kraft:
toString
in KlasseObject
-
cacheToken
-
uncacheTokens
-
nextCachedToken
-
previousCachedToken
-
checkIntervals
protected static boolean checkIntervals(int[] ranges, int ch) -
getLineStartOffset
public int getLineStartOffset(int lineNumber) The offset of the start of the given line. This is in code units -
getLineEndOffset
public int getLineEndOffset(int lineNumber) The offset of the end of the given line. This is in code units. -
getLineFromOffset
public int getLineFromOffset(int pos) -
getCodePointColumnFromOffset
public int getCodePointColumnFromOffset(int pos) - Gibt zurück:
- the column (1-based and in code points) from the absolute offset passed in as a parameter
-
getText
- Gibt zurück:
- the text between startOffset (inclusive) and endOffset(exclusive)
-
getInputSource
-
setInputSource
-
stringFromBytes
- Parameter:
bytes
- the raw byte arraycharset
- The encoding to use to decode the bytes. If this is null, we check for the initial byte order mark (used by Microsoft a lot seemingly) See: https://docs.microsoft.com/es-es/globalization/encoding/byte-order-markc- Gibt zurück:
- A String taking into account the encoding passed in or in the byte order mark (if it was present). And if no encoding was passed in and no byte-order mark was present, we assume the raw input is in UTF-8.
- Löst aus:
CharacterCodingException
-
stringFromBytes
- Löst aus:
CharacterCodingException
-