public class CtParameterImpl<T> extends CtNamedElementImpl implements CtParameter<T>
CtParameter
.ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Constructor and Description |
---|
CtParameterImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(CtVisitor v)
Accepts a visitor
|
<C extends CtModifiable> |
addModifier(ModifierKind modifier)
add a modifier
|
CtParameter<T> |
clone()
Clone the element which calls this method in a new object.
|
CtExpression<T> |
getDefaultExpression()
Gets the initialization expression assigned to the variable (also known
as the initializer), when declared.
|
java.util.Set<CtExtendedModifier> |
getExtendedModifiers() |
java.util.Set<ModifierKind> |
getModifiers()
Returns the modifiers of this element, excluding annotations.
|
CtExecutable<?> |
getParent()
Gets the parent of current reference.
|
CtParameterReference<T> |
getReference()
Returns the corresponding reference.
|
CtTypeReference<T> |
getType()
Gets this element's type.
|
ModifierKind |
getVisibility()
Gets the visibility of this modifiable element.
|
boolean |
hasModifier(ModifierKind modifier)
Tells if this element contains the given modifier.
|
boolean |
isAbstract()
Returns true if it contains an abstract modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isFinal()
Returns true if it contains a final modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isInferred()
Returns true if this parameter is a lambda parameter with type defined using the `var` keyword (since Java 11).
|
boolean |
isNative()
Returns true if it contains a native modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isPartOfJointDeclaration()
Returns true it the variable (field, localvariable) is jointly declared with a share type
Eg int a,b;
Warning: is computed on demand
|
boolean |
isPrivate()
Returns true if it contains a private modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isProtected()
Returns true if it contains a protected modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isPublic()
Returns true if it contains a public modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isShadow()
When an element isn't present in the factory (created in another factory),
this element is considered as "shadow".
|
boolean |
isStatic()
Returns true if it contains a static modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isStrictfp()
Returns true if it contains a strictfp modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isSynchronized()
Returns true if it contains a synchronized modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isTransient()
Returns true if it contains a transient modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
boolean |
isVarArgs()
Returns true if this parameter accepts a variable number of
arguments (must be the last parameter of
CtExecutable.getParameters() ). |
boolean |
isVolatile()
Returns true if it contains a volatile modifier (see
CtModifiable.hasModifier(ModifierKind) ) |
<C extends CtModifiable> |
removeModifier(ModifierKind modifier)
remove a modifier
|
<C extends CtVariable<T>> |
setDefaultExpression(CtExpression<T> defaultExpression)
Sets the initialization expression assigned to the variable, when
declared.
|
<T extends CtModifiable> |
setExtendedModifiers(java.util.Set<CtExtendedModifier> extendedModifiers) |
<U extends CtParameter<T>> |
setInferred(boolean inferred)
Set to true if this parameter is a lambda parameter with type defined using the `var` keyword.
|
<C extends CtModifiable> |
setModifiers(java.util.Set<ModifierKind> modifiers)
Sets the modifiers.
|
<E extends CtShadowable> |
setShadow(boolean isShadow)
Marks an element as shadow.
|
<C extends CtTypedElement> |
setType(CtTypeReference<T> type)
Sets this element's type.
|
<C extends CtParameter<T>> |
setVarArgs(boolean varArgs)
Sets this parameter to have varargs.
|
<C extends CtModifiable> |
setVisibility(ModifierKind visibility)
Sets the visibility of this modifiable element (replaces old visibility).
|
getSimpleName, setSimpleName
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, equals, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
finalize, getClass, notify, notifyAll, wait, wait, wait
getSimpleName, setSimpleName
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
filterChildren, map, map
public void accept(CtVisitor v)
CtVisitable
accept
in interface CtVisitable
public CtExpression<T> getDefaultExpression()
CtVariable
getDefaultExpression
in interface CtVariable<T>
public CtParameterReference<T> getReference()
CtNamedElement
getReference
in interface CtNamedElement
getReference
in interface CtParameter<T>
getReference
in interface CtVariable<T>
getReference
in class CtNamedElementImpl
public CtTypeReference<T> getType()
CtTypedElement
getType
in interface CtTypedElement<T>
public <C extends CtVariable<T>> C setDefaultExpression(CtExpression<T> defaultExpression)
CtVariable
setDefaultExpression
in interface CtParameter<T>
setDefaultExpression
in interface CtVariable<T>
public boolean isPartOfJointDeclaration()
CtVariable
isPartOfJointDeclaration
in interface CtVariable<T>
public boolean isInferred()
CtParameter
isInferred
in interface CtParameter<T>
public <U extends CtParameter<T>> U setInferred(boolean inferred)
CtParameter
setInferred
in interface CtParameter<T>
public <C extends CtTypedElement> C setType(CtTypeReference<T> type)
CtTypedElement
setType
in interface CtTypedElement<T>
public boolean isVarArgs()
CtParameter
CtExecutable.getParameters()
).isVarArgs
in interface CtParameter<T>
public <C extends CtParameter<T>> C setVarArgs(boolean varArgs)
CtParameter
setVarArgs
in interface CtParameter<T>
public java.util.Set<ModifierKind> getModifiers()
CtModifiable
public
and static
modifiers of
interface members, are included.getModifiers
in interface CtModifiable
public boolean hasModifier(ModifierKind modifier)
CtModifiable
hasModifier
in interface CtModifiable
modifier
- to searchtrue
if this element contain the modifierpublic <C extends CtModifiable> C setModifiers(java.util.Set<ModifierKind> modifiers)
CtModifiable
setModifiers
in interface CtModifiable
public <C extends CtModifiable> C addModifier(ModifierKind modifier)
CtModifiable
addModifier
in interface CtModifiable
public <C extends CtModifiable> C removeModifier(ModifierKind modifier)
CtModifiable
removeModifier
in interface CtModifiable
public <C extends CtModifiable> C setVisibility(ModifierKind visibility)
CtModifiable
setVisibility
in interface CtModifiable
public ModifierKind getVisibility()
CtModifiable
getVisibility
in interface CtModifiable
public CtExecutable<?> getParent()
CtElement
getParent
in interface CtElement
getParent
in interface CtParameter<T>
getParent
in class CtElementImpl
public java.util.Set<CtExtendedModifier> getExtendedModifiers()
getExtendedModifiers
in interface CtModifiable
public <T extends CtModifiable> T setExtendedModifiers(java.util.Set<CtExtendedModifier> extendedModifiers)
setExtendedModifiers
in interface CtModifiable
public boolean isShadow()
CtShadowable
CtTypeReference.getTypeDeclaration()
on a reference of java.lang.Class.isShadow
in interface CtShadowable
public <E extends CtShadowable> E setShadow(boolean isShadow)
CtShadowable
CtShadowable.isShadow()
.setShadow
in interface CtShadowable
public CtParameter<T> clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtElement
clone
in interface CtNamedElement
clone
in interface CtParameter<T>
clone
in class CtNamedElementImpl
public boolean isPublic()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isPublic
in interface CtModifiable
public boolean isPrivate()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isPrivate
in interface CtModifiable
public boolean isProtected()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isProtected
in interface CtModifiable
public boolean isFinal()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isFinal
in interface CtModifiable
public boolean isStatic()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isStatic
in interface CtModifiable
public boolean isAbstract()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isAbstract
in interface CtModifiable
public boolean isTransient()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isTransient
in interface CtModifiable
public boolean isVolatile()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isVolatile
in interface CtModifiable
public boolean isSynchronized()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isSynchronized
in interface CtModifiable
public boolean isNative()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isNative
in interface CtModifiable
public boolean isStrictfp()
CtModifiable
CtModifiable.hasModifier(ModifierKind)
)isStrictfp
in interface CtModifiable
Copyright © 2007–2021 Inria. All rights reserved.