Package ftl

Klasse TokenSource

java.lang.Object
ftl.TokenSource
Alle implementierten Schnittstellen:
CharSequence
Bekannte direkte Unterklassen:
FreshMarkerLexer

public abstract class TokenSource extends Object implements CharSequence
  • 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 Schnittstelle CharSequence
    • length

      public final int length()
      Angegeben von:
      length in Schnittstelle CharSequence
    • subSequence

      public final CharSequence subSequence(int start, int end)
      Angegeben von:
      subSequence in Schnittstelle CharSequence
    • toString

      public String toString()
      Angegeben von:
      toString in Schnittstelle CharSequence
      Setzt außer Kraft:
      toString in Klasse Object
    • cacheToken

      public void cacheToken(Node.TerminalNode tok)
    • uncacheTokens

      public void uncacheTokens(Node.TerminalNode lastToken)
    • nextCachedToken

      public Node.TerminalNode nextCachedToken(int offset)
    • previousCachedToken

      public Node.TerminalNode previousCachedToken(int offset)
    • 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

      public String getText(int startOffset, int endOffset)
      Gibt zurück:
      the text between startOffset (inclusive) and endOffset(exclusive)
    • getInputSource

      public String getInputSource()
    • setInputSource

      public void setInputSource(String inputSource)
    • stringFromBytes

      public static String stringFromBytes(byte[] bytes, Charset charset) throws CharacterCodingException
      Parameter:
      bytes - the raw byte array
      charset - 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

      public static String stringFromBytes(byte[] bytes) throws CharacterCodingException
      Löst aus:
      CharacterCodingException