All Implemented Interfaces:
TypeConstants, TypeIds
Direct Known Subclasses:
CompletionOnStringLiteral, ExtendedStringLiteral, StringLiteralConcatenation, TextBlock

public class StringLiteral extends Literal
  • Field Details

    • optionalHead

      protected StringLiteral optionalHead
      may be null, prefixes tail
    • tail

      protected Object tail
      StringLiteral or char[] tail
  • Constructor Details

    • StringLiteral

      public StringLiteral(char[] token, int start, int end, int lineNumber1based)
    • StringLiteral

      protected StringLiteral(StringLiteral optionalHead, Object tail, int start, int end, int lineNumber)
    • StringLiteral

      public StringLiteral(int s, int e)
  • Method Details

    • computeConstant

      public void computeConstant()
      Specified by:
      computeConstant in class Literal
    • extendWith

      public ExtendedStringLiteral extendWith(CharLiteral lit)
      creates a copy of dedicated Type for optimizeStringLiterals with the given CharLiteral appended
    • extendWith

      public ExtendedStringLiteral extendWith(StringLiteral lit)
      creates a copy of dedicated Type for optimizeStringLiterals with the given StringLiteral appended
    • extendsWith

      public StringLiteralConcatenation extendsWith(StringLiteral lit)
      creates a copy of dedicated Type for unoptimizeStringLiterals with the given StringLiteral appended
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
      Code generation for string literal
      Overrides:
      generateCode in class Expression
      Parameters:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
      valueRequired - boolean
    • literalType

      public TypeBinding literalType(BlockScope scope)
      Specified by:
      literalType in class Literal
    • printExpression

      public StringBuilder printExpression(int indent, StringBuilder output)
      Overrides:
      printExpression in class Literal
    • source

      public char[] source()
      Specified by:
      source in class Literal
    • flatten

      protected void flatten(char[] result)
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope scope)
      Description copied from class: Expression
      Traverse an expression in the context of a blockScope
      Overrides:
      traverse in class Expression
    • setSource

      public void setSource(char[] source)
    • getLineNumber

      public int getLineNumber()