Interface NodeWithModifiers<N extends Node>
- All Known Subinterfaces:
NodeWithAbstractModifier<N>
,NodeWithAccessModifiers<N>
,NodeWithFinalModifier<N>
,NodeWithPrivateModifier<N>
,NodeWithProtectedModifier<N>
,NodeWithPublicModifier<N>
,NodeWithStaticModifier<N>
,NodeWithStrictfpModifier<N>
- All Known Implementing Classes:
AnnotationDeclaration
,AnnotationMemberDeclaration
,CallableDeclaration
,ClassOrInterfaceDeclaration
,CompactConstructorDeclaration
,ConstructorDeclaration
,EnumDeclaration
,FieldDeclaration
,MethodDeclaration
,ModuleRequiresDirective
,Parameter
,RecordDeclaration
,RecordPatternExpr
,TypeDeclaration
,TypePatternExpr
,VariableDeclarationExpr
public interface NodeWithModifiers<N extends Node>
A Node with Modifiers.
Note that not all modifiers may be valid for this node.
-
Method Summary
Modifier and TypeMethodDescriptiondefault N
addModifier
(Modifier.Keyword... newModifiers) default AccessSpecifier
Return the modifiers of this variable declaration.default boolean
hasModifier
(Modifier.Keyword modifier) default N
removeModifier
(Modifier.Keyword... modifiersToRemove) default N
setModifier
(Modifier.Keyword m, boolean set) default N
setModifiers
(Modifier.Keyword... modifiers) Creates a list of modifier nodes corresponding to the keywords passed, and set it.setModifiers
(NodeList<Modifier> modifiers)
-
Method Details
-
getModifiers
Return the modifiers of this variable declaration. Warning: modifying the returned set will not trigger observers, you have to use setModifiers for that.- Returns:
- modifiers
- See Also:
-
setModifiers
-
addModifier
-
removeModifier
-
setModifier
-
hasModifier
- Parameters:
modifier
- the modifer being searched for- Returns:
- true if the modifier has been explicitly added to this node, else false
-
setModifiers
Creates a list of modifier nodes corresponding to the keywords passed, and set it. -
getAccessSpecifier
- Returns:
- the access specifier as far as it can be derived from the modifiers. Does not take anything else into account (like "interface methods are implicitly public")
-