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, MatchAllPatternExpr, 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 NaddModifier(Modifier.Keyword... newModifiers) default AccessSpecifierReturn the modifiers of this variable declaration.default booleanhasModifier(Modifier.Keyword modifier) default NremoveModifier(Modifier.Keyword... modifiersToRemove) default NsetModifier(Modifier.Keyword m, boolean set) default NsetModifiers(Modifier.Keyword... modifiers) Creates a list of modifier nodes corresponding to the keywords passed, and set it.setModifiers(NodeList<Modifier> modifiers)
-
Method Details
-
getModifiers
-
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")
-