Class StringFragment


public class StringFragment extends Expression
String fragment node is similar to StringLiteral and TextBlock, but does not include the delimiters.
Since:
3.37
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • ESCAPED_VALUE_PROPERTY

      public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY
      The "escapedValue" structural property of this node type (type: String).
      Since:
      3.37
  • Method Details

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameters:
      apiLevel - the API level; one of the AST.JLS* constants
      Returns:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
    • getEscapedValue

      public String getEscapedValue()
      Returns the string value of this literal node to the given string fragment token. The token is the sequence of characters that would appear in the source program, excluding enclosing double quotes.
      Returns:
      the string fragment token, excluding enclosing double quotes
    • setEscapedValue

      public void setEscapedValue(String token)
      Sets the string value of this fragment node to the given string fragment token. The token is the sequence of characters that would appear in the source program, excluding enclosing double quotes but including embedded escapes. For example, the following String template STR."Hello \{last}, \{first}!" considered to have the following literl values
      • "Hello ")
      • ", "
      • "!"
      Parameters:
      token - the string fragment token, excluding enclosing double quotes
      Throws:
      IllegalArgumentException - if the argument is incorrect