Class CtCatchImpl

All Implemented Interfaces:
Serializable, Cloneable, FactoryAccessor, CtBodyHolder, CtCatch, CtCodeElement, SourcePositionHolder, CtElement, CtQueryable, CtVisitable

public class CtCatchImpl extends CtCodeElementImpl implements CtCatch
See Also:
  • Constructor Details

    • CtCatchImpl

      public CtCatchImpl()
  • Method Details

    • accept

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

      public CtBlock<?> getBody()
      Description copied from interface: CtCatch
      Gets the catch's body.
      Specified by:
      getBody in interface CtBodyHolder
      Specified by:
      getBody in interface CtCatch
    • getParameter

      public CtCatchVariable<? extends Throwable> getParameter()
      Description copied from interface: CtCatch
      Gets the catch's parameter (a throwable).
      Specified by:
      getParameter in interface CtCatch
    • setBody

      public <T extends CtBodyHolder> T setBody(CtStatement statement)
      Description copied from interface: CtBodyHolder
      Sets the body of this element. If body is not a block, it is wrapped in a CtBlock which is semantically equivalent and eases transformation afterwards if required.
      Specified by:
      setBody in interface CtBodyHolder
    • setParameter

      public <T extends CtCatch> T setParameter(CtCatchVariable<? extends Throwable> parameter)
      Description copied from interface: CtCatch
      Sets the catch's parameter (a throwable).
      Specified by:
      setParameter in interface CtCatch
    • clone

      public CtCatch 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 CtCatch
      Specified by:
      clone in interface CtCodeElement
      Specified by:
      clone in interface CtElement
      Overrides:
      clone in class CtCodeElementImpl
      Returns:
      a clone of this element. All children are cloned, but the parent of the returned clone is set to null.