Package spoon.support.reflect
Class CtExtendedModifier
java.lang.Object
spoon.support.reflect.CtExtendedModifier
- All Implemented Interfaces:
Serializable
,SourcePositionHolder
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 Summary
ConstructorDescriptionCtExtendedModifier(ModifierKind kind)
Deprecated.CtExtendedModifier(ModifierKind kind, boolean implicit)
Creates a new extended modifier of the given kind with the given implicitness. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static CtExtendedModifier
explicit(ModifierKind kind)
Creates an extended modifier of the given kind that is explicit.getKind()
Returns the original source code (maybe different from toString() if a transformation has been applied).If the element comes from a Java source file (hence has not created during transformation), returns the position in the original source fileint
hashCode()
static CtExtendedModifier
implicit(ModifierKind kind)
Creates an extended modifier of the given kind that is implicit.boolean
void
setImplicit(boolean implicit)
void
setKind(ModifierKind kind)
void
setPosition(SourcePosition position)
toString()
-
Constructor Details
-
CtExtendedModifier
Deprecated.useexplicit(ModifierKind)
to create an explicit modifier.Creates a new extended modifier of the given kind.- Parameters:
kind
- the kind of this modifier.
-
CtExtendedModifier
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
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
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
-
setKind
-
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 interfaceSourcePositionHolder
-
setPosition
-
equals
-
hashCode
public int hashCode() -
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 interfaceSourcePositionHolder
-
toString
-
explicit(ModifierKind)
to create an explicit modifier.