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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default NaddModifier(Modifier.Keyword... newModifiers)default AccessSpecifiergetAccessSpecifier()NodeList<Modifier>getModifiers()Return 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.NsetModifiers(NodeList<Modifier> modifiers)
-
-
-
Method Detail
-
getModifiers
NodeList<Modifier> 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:
Modifier
-
addModifier
default N addModifier(Modifier.Keyword... newModifiers)
-
removeModifier
default N removeModifier(Modifier.Keyword... modifiersToRemove)
-
setModifier
default N setModifier(Modifier.Keyword m, boolean set)
-
hasModifier
default boolean hasModifier(Modifier.Keyword modifier)
- Parameters:
modifier- the modifer being searched for- Returns:
- true if the modifier has been explicitly added to this node, else false
-
setModifiers
default N setModifiers(Modifier.Keyword... modifiers)
Creates a list of modifier nodes corresponding to the keywords passed, and set it.
-
getAccessSpecifier
default AccessSpecifier 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")
-
-