Class CtExtendedModifier

java.lang.Object
spoon.support.reflect.CtExtendedModifier
All Implemented Interfaces:
Serializable, SourcePositionHolder

public class CtExtendedModifier extends Object implements SourcePositionHolder, Serializable
Represents a modifier (eg "public"). When a modifier is "implicit", it does not appear in the source code (eg public for interface methods) ModifierKind in kept for sake of full backward-compatibility.
See Also:
Serialized Form
  • Constructor Details

    • CtExtendedModifier

      @Deprecated(since="9.2.0") public CtExtendedModifier(ModifierKind kind)
      Deprecated.
      use explicit(ModifierKind) to create an explicit modifier.
      Creates a new extended modifier of the given kind.
      Parameters:
      kind - the kind of this modifier.
    • CtExtendedModifier

      public CtExtendedModifier(ModifierKind kind, boolean implicit)
      Creates a new extended modifier of the given kind with the given implicitness.
      Parameters:
      kind - the kind of this modifier.
      implicit - whether this modifier should be implicit.
  • Method Details

    • explicit

      public static CtExtendedModifier explicit(ModifierKind kind)
      Creates an extended modifier of the given kind that is explicit.
      Parameters:
      kind - the kind of the created modifier.
      Returns:
      an explicit extended modifier.
    • implicit

      public static CtExtendedModifier implicit(ModifierKind kind)
      Creates an extended modifier of the given kind that is implicit.
      Parameters:
      kind - the kind of the created modifier.
      Returns:
      an implicit extended modifier.
    • isImplicit

      public boolean isImplicit()
    • setImplicit

      public void setImplicit(boolean implicit)
    • getKind

      public ModifierKind getKind()
    • setKind

      public void setKind(ModifierKind kind)
    • getPosition

      public SourcePosition getPosition()
      Description copied from interface: SourcePositionHolder
      If the element comes from a Java source file (hence has not created during transformation), returns the position in the original source file
      Specified by:
      getPosition in interface SourcePositionHolder
    • setPosition

      public void setPosition(SourcePosition position)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getOriginalSourceFragment

      public ElementSourceFragment getOriginalSourceFragment()
      Description copied from interface: SourcePositionHolder
      Returns the original source code (maybe different from toString() if a transformation has been applied). Warning: this is a advanced method which cannot be considered as part of the stable API
      Specified by:
      getOriginalSourceFragment in interface SourcePositionHolder
    • toString

      public String toString()
      Overrides:
      toString in class Object