Package net.sf.saxon.expr

## Class StringLiteral

- java.lang.Object
- - net.sf.saxon.expr.Expression
  - - net.sf.saxon.expr.Literal
    - - net.sf.saxon.expr.StringLiteral

- All Implemented Interfaces:
    `ExportAgent`, `Locatable`, `IdentityComparable`, `Traceable`

      public class StringLiteral
      extends Literal

  Subclass of Literal used specifically for string literals, as this is a common case

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.expr.Expression

      `EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StringLiteral​(java.lang.CharSequence value)` | Create a StringLiteral that wraps any CharSequence (including, of course, a String)
    `StringLiteral​(StringValue value)` | Create a StringLiteral that wraps a StringValue

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Expression` | `copy​(RebindingMap rebindings)` | Copy an expression.
    `java.lang.String` | `getStringValue()` | Get the string represented by this StringLiteral
    `StringValue` | `getValue()` | Get the value represented by this Literal

    - ### Methods inherited from class net.sf.saxon.expr.Literal

      `addToPathMap, computeCardinality, computeHashCode, computeSpecialProperties, effectiveBooleanValue, equals, evaluateAsString, evaluateItem, evaluatePendingUpdates, export, exportAtomicValue, exportValue, getDependencies, getExpressionName, getImplementationMethod, getIntegerBounds, getItemType, getNetCost, getStaticUType, getStreamerName, hasEffectiveBooleanValue, isAtomic, isConstantBoolean, isConstantOne, isEmptySequence, isSubtreeExpression, isVacuousExpression, iterate, iterate, makeEmptySequence, makeLiteral, makeLiteral, makeStringsLiteral, optimize, process, toPattern, toShortString, toString, typeCheck`

    - ### Methods inherited from class net.sf.saxon.expr.Expression

      `adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, explain, getCardinality, getConfiguration, getCost, getEvaluationMethod, getExtraProperty, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isUpdatingExpression, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, typeCheckChildren, typeError, unordered, verifyParentPointers`

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

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

    - ### Methods inherited from interface net.sf.saxon.trace.Traceable

      `gatherProperties`

- - ### Constructor Detail

    - #### StringLiteral

          public StringLiteral​(StringValue value)

      Create a StringLiteral that wraps a StringValue
      Parameters:
        `value` - the StringValue

    - #### StringLiteral

          public StringLiteral​(java.lang.CharSequence value)

      Create a StringLiteral that wraps any CharSequence (including, of course, a String)
      Parameters:
        `value` - the CharSequence to be wrapped

  - ### Method Detail

    - #### getValue

          public StringValue getValue()

      Get the value represented by this Literal
      Overrides:
        `getValue` in class `Literal`
      Returns:
        the constant value

    - #### getStringValue

          public java.lang.String getStringValue()

      Get the string represented by this StringLiteral
      Returns:
        the underlying string

    - #### copy

          public Expression copy​(RebindingMap rebindings)

      Description copied from class: `Literal`
      Copy an expression. This makes a deep copy.
      Overrides:
        `copy` in class `Literal`
      Parameters:
        `rebindings` - variables that need to be re-bound
      Returns:
        a copy of the original literal. Note that the underlying value is not copied; the code relies on the caller treating the underlying value as immutable.