Class ASTLiteral

    • Method Detail

      • isIntLiteral

        public boolean isIntLiteral()
      • isLongLiteral

        public boolean isLongLiteral()
        Checks whether this literal is a long integer.
        Returns:
        true if this literal is a long
      • isFloatLiteral

        public boolean isFloatLiteral()
      • isDoubleLiteral

        public boolean isDoubleLiteral()
        Checks whether this literal describes a double.
        Returns:
        true if this literal is a double.
      • getValueAsInt

        public int getValueAsInt()
      • getValueAsLong

        public long getValueAsLong()
      • getValueAsFloat

        public float getValueAsFloat()
      • getValueAsDouble

        public double getValueAsDouble()
      • isCharLiteral

        public boolean isCharLiteral()
      • isStringLiteral

        public boolean isStringLiteral()
      • getEscapedStringLiteral

        public String getEscapedStringLiteral()
        Tries to reconstruct the original string literal. If the original length is greater than the parsed String literal, then probably some unicode escape sequences have been used.
        Returns:
      • isSingleCharacterStringLiteral

        public boolean isSingleCharacterStringLiteral()
        Returns true if this is a String literal with only one character. Handles octal and escape characters.
        Returns:
        true is this is a String literal with only one character
      • isTextBlock

        public boolean isTextBlock()
      • getTextBlockContent

        @Experimental
        public String getTextBlockContent()
        Returns the content of the text block after normalizing line endings to LF, removing incidental white space surrounding the text block and interpreting escape sequences.

        Note: This is a Java 14 Preview Feature.