Class CtCodeElementImpl

java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.code.CtCodeElementImpl
All Implemented Interfaces:
Serializable, Cloneable, FactoryAccessor, CtCodeElement, SourcePositionHolder, CtElement, CtQueryable, CtVisitable
Direct Known Subclasses:
CtCatchImpl, CtCatchVariableImpl, CtExpressionImpl, CtStatementImpl, CtStatementListImpl

public abstract class CtCodeElementImpl extends CtElementImpl implements CtCodeElement
See Also:
Serialized Form
  • Constructor Details

    • CtCodeElementImpl

      public CtCodeElementImpl()
  • Method Details

    • partiallyEvaluate

      public <R extends CtCodeElement> R partiallyEvaluate()
      Description copied from interface: CtCodeElement
      Partially evaluates an element and all its sub-elements.
      Specified by:
      partiallyEvaluate in interface CtCodeElement
      Type Parameters:
      R - the type of the returned element
      Returns:
      the result of the partial evaluation. The element is always cloned, even if nothing has been evaluated.
      See Also:
      VisitorPartialEvaluator
    • clone

      public CtCodeElement 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
      Overrides:
      clone in class CtElementImpl