Class StringConstant

  • All Implemented Interfaces:
    ExpressionNode, Atom

    public final class StringConstant
    extends Object
    implements Atom
    Defines a simple string constant (e.g. 'hello world').
    • Field Detail

      • EMPTY

        public static final StringConstant EMPTY
        The empty string constant.
    • Constructor Detail

      • StringConstant

        public StringConstant​(String text)
        Create a string constant node.
        text - the string content (without its original quotes)
    • Method Detail

      • accept

        public <T> T accept​(NodeVisitor<T> visitor)
        Description copied from interface: ExpressionNode
        Accept a visitor to process this node.
        Specified by:
        accept in interface ExpressionNode
        Type Parameters:
        T - the type of the visitor
        visitor - The visitor
        the node after it has been evaluated by the visitor
      • getText

        public String getText()
        Gets the string content
        Specified by:
        getText in interface Atom
        the string content
      • hashCode

        public int hashCode()
        hashCode in class Object