Package org.apache.sling.scripting.sightly.compiler.expression.nodes

## Class StringConstant

- java.lang.Object
- - org.apache.sling.scripting.sightly.compiler.expression.nodes.StringConstant

All Implemented Interfaces:
  `ExpressionNode`, `Atom`

    public final class StringConstant
    extends Object
    implements Atom

Defines a simple string constant (e.g. `'hello world'`).

### Field Summary

Fields
`static StringConstant` `EMPTY` The empty string constant.

### Constructor Summary

Constructors
`StringConstant​(String text)` Create a string constant node.

### Method Summary

All Methods Instance Methods Concrete Methods
`<T> T` `accept​(NodeVisitor<T> visitor)` Accept a visitor to process this node.
`boolean` `equals​(Object obj)`
`String` `getText()` Gets the string content
`int` `hashCode()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### EMPTY

    public static final StringConstant EMPTY

The empty string constant.

### Constructor Detail

#### StringConstant

    public StringConstant​(String text)

Create a string constant node.

Parameters:
  `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
Parameters:
  `visitor` - The visitor
Returns:
  the node after it has been evaluated by the visitor

#### getText

    public String getText()

Gets the string content

Specified by:
  `getText` in interface `Atom`
Returns:
  the string content

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`