Class CtLiteralImpl<T>

All Implemented Interfaces:
Serializable, Cloneable, FactoryAccessor, CtCodeElement, CtExpression<T>, CtLiteral<T>, SourcePositionHolder, CtElement, CtTypedElement<T>, CtQueryable, CtVisitable, TemplateParameter<T>
Direct Known Subclasses:
CtTextBlockImpl

public class CtLiteralImpl<T> extends CtExpressionImpl<T> implements CtLiteral<T>
See Also:
  • Constructor Details

    • CtLiteralImpl

      public CtLiteralImpl()
  • Method Details

    • accept

      public void accept(CtVisitor visitor)
      Description copied from interface: CtVisitable
      Accepts a visitor
      Specified by:
      accept in interface CtVisitable
    • getValue

      public T getValue()
      Description copied from interface: CtLiteral
      Gets the actual value of the literal (statically known).
      Specified by:
      getValue in interface CtLiteral<T>
    • setValue

      public <C extends CtLiteral<T>> C setValue(T value)
      Description copied from interface: CtLiteral
      Sets the actual value of the literal.
      Specified by:
      setValue in interface CtLiteral<T>
    • getBase

      public LiteralBase getBase()
      Description copied from interface: CtLiteral
      Gets the base of the numeric literal (2, 8, 10 or 16).
      Specified by:
      getBase in interface CtLiteral<T>
    • setBase

      public <C extends CtLiteral<T>> C setBase(LiteralBase base)
      Description copied from interface: CtLiteral
      Sets the base of the numeric literal.
      Specified by:
      setBase in interface CtLiteral<T>
    • clone

      public CtLiteral<T> clone()
      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtCodeElement
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtExpression<T>
      Specified by:
      clone in interface CtLiteral<T>
      Overrides:
      clone in class CtExpressionImpl<T>
      Returns:
      a clone of this element. All children are cloned, but the parent of the returned clone is set to null.