org.eclipse.wst.jsdt.core.dom

## Class Modifier

- java.lang.Object
- - org.eclipse.wst.jsdt.core.dom.ASTNode
  - - org.eclipse.wst.jsdt.core.dom.Modifier

All Implemented Interfaces:
  IExtendedModifier

    public final class Modifier
    extends ASTNode
    implements IExtendedModifier

Modifier node.

     Modifier:
        public
        protected
        private
        static
        abstract
        final
        native
        synchronized
        transient
        volatile
        strictfp

Note that JavaScript model class `Flags` also provides the same constants as this class.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Nested Class Summary

Nested Classes
`static class` `Modifier.ModifierKeyword` Modifier keywords (typesafe enumeration).

### Field Summary

Fields
`static int` `ABSTRACT` "abstract" modifier constant (bit mask).
`static int` `FINAL` "final" modifier constant (bit mask).
`static int` `GET` "get" modifier constant (bit mask) as defined on ES2015
`static SimplePropertyDescriptor` `KEYWORD_PROPERTY` The "keyword" structural property of this node type.
`static int` `NATIVE` "native" modifier constant (bit mask).
`static int` `NONE` Modifier constant (bit mask, value 0) indicating no modifiers.
`static int` `PRIVATE` "private" modifier constant (bit mask).
`static int` `PROTECTED` "protected" modifier constant (bit mask).
`static int` `PUBLIC` "public" modifier constant (bit mask).
`static int` `SET` "set" modifier constant (bit mask)
`static int` `STATIC` "static" modifier constant (bit mask).
`static int` `STRICTFP` "strictfp" modifier constant (bit mask).
`static int` `SYNCHRONIZED` "synchronized" modifier constant (bit mask).
`static int` `TRANSIENT` "transient" modifier constant (bit mask).
`static int` `VOLATILE` "volatile" modifier constant (bit mask).

### Fields inherited from class org.eclipse.wst.jsdt.core.dom.ASTNode

`ANONYMOUS_CLASS_DECLARATION, ARRAY_ACCESS, ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_NAME, ARRAY_TYPE, ARROW_FUNCTION_EXPRESSION, ASSIGNMENT, ASSIGNMENT_NAME, BLOCK, BLOCK_COMMENT, BOOLEAN_LITERAL, BREAK_STATEMENT, CATCH_CLAUSE, CHARACTER_LITERAL, CLASS_INSTANCE_CREATION, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, DEBUGGER_STATEMENT, DO_STATEMENT, EMPTY_EXPRESSION, EMPTY_STATEMENT, ENHANCED_FOR_STATEMENT, EXPORT_DECLARATION, EXPRESSION_STATEMENT, FIELD_ACCESS, FIELD_DECLARATION, FOR_IN_STATEMENT, FOR_OF_STATEMENT, FOR_STATEMENT, FUNCTION_DECLARATION, FUNCTION_DECLARATION_STATEMENT, FUNCTION_EXPRESSION, FUNCTION_INVOCATION, FUNCTION_REF, FUNCTION_REF_PARAMETER, IF_STATEMENT, IMPORT_DECLARATION, INFERRED_TYPE, INFIX_EXPRESSION, INITIALIZER, INSTANCEOF_EXPRESSION, JAVASCRIPT_UNIT, JSDOC, LABELED_STATEMENT, LINE_COMMENT, LIST_EXPRESSION, MALFORMED, MEMBER_REF, META_PROPERTY, MODIFIER, MODULE_SPECIFIER, NULL_LITERAL, NUMBER_LITERAL, OBJECT_LITERAL, OBJECT_LITERAL_FIELD, OBJECT_NAME, ORIGINAL, PACKAGE_DECLARATION, PARENTHESIZED_EXPRESSION, POSTFIX_EXPRESSION, PREFIX_EXPRESSION, PRIMITIVE_TYPE, PROTECT, QUALIFIED_NAME, QUALIFIED_TYPE, RECOVERED, REGULAR_EXPRESSION_LITERAL, REST_ELEMENT_NAME, RETURN_STATEMENT, SIMPLE_NAME, SIMPLE_TYPE, SINGLE_VARIABLE_DECLARATION, SPREAD_ELEMENT, STRING_LITERAL, SUPER_CONSTRUCTOR_INVOCATION, SUPER_FIELD_ACCESS, SUPER_METHOD_INVOCATION, SWITCH_CASE, SWITCH_STATEMENT, TAG_ELEMENT, TEMPLATE_ELEMENT, TEMPLATE_LITERAL, TEXT_ELEMENT, THIS_EXPRESSION, THROW_STATEMENT, TRY_STATEMENT, TYPE_DECLARATION, TYPE_DECLARATION_EXPRESSION, TYPE_DECLARATION_STATEMENT, TYPE_LITERAL, UNDEFINED_LITERAL, VARIABLE_DECLARATION_EXPRESSION, VARIABLE_DECLARATION_FRAGMENT, VARIABLE_DECLARATION_STATEMENT, WHILE_STATEMENT, WITH_STATEMENT, YIELD_EXPRESSION`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Modifier.ModifierKeyword` `getKeyword()` Returns the modifier keyword of this modifier node.
`boolean` `isAbstract()` Answer true if the receiver is the abstract modifier, false otherwise.
`static boolean` `isAbstract(int flags)` Returns whether the given flags includes the "abstract" modifier.
`boolean` `isAnnotation()`
`boolean` `isFinal()` Answer true if the receiver is the final modifier, false otherwise.
`static boolean` `isFinal(int flags)` Returns whether the given flags includes the "final" modifier.
`static boolean` `isGet(int flags)` Returns whether the given flags includes the "get" modifier.
`boolean` `isModifier()` Returns whether this extended modifier is a standard modifier.
`boolean` `isNative()` Answer true if the receiver is the native modifier, false otherwise.
`static boolean` `isNative(int flags)` Returns whether the given flags includes the "native" modifier.
`boolean` `isPrivate()` Answer true if the receiver is the private modifier, false otherwise.
`static boolean` `isPrivate(int flags)` Returns whether the given flags includes the "private" modifier.
`boolean` `isProtected()` Answer true if the receiver is the protected modifier, false otherwise.
`static boolean` `isProtected(int flags)` Returns whether the given flags includes the "protected" modifier.
`boolean` `isPublic()` Answer true if the receiver is the public modifier, false otherwise.
`static boolean` `isPublic(int flags)` Returns whether the given flags includes the "public" modifier.
`static boolean` `isSet(int flags)` Returns whether the given flags includes the "set" modifier.
`boolean` `isStatic()` Answer true if the receiver is the static modifier, false otherwise.
`static boolean` `isStatic(int flags)` Returns whether the given flags includes the "static" modifier.
`boolean` `isStrictfp()` Answer true if the receiver is the strictfp modifier, false otherwise.
`static boolean` `isStrictfp(int flags)` Returns whether the given flags includes the "strictfp" modifier.
`boolean` `isSynchronized()` Answer true if the receiver is the synchronized modifier, false otherwise.
`static boolean` `isSynchronized(int flags)` Returns whether the given flags includes the "synchronized" modifier.
`boolean` `isTransient()` Answer true if the receiver is the transient modifier, false otherwise.
`static boolean` `isTransient(int flags)` Returns whether the given flags includes the "transient" modifier.
`boolean` `isVolatile()` Answer true if the receiver is the volatile modifier, false otherwise.
`static boolean` `isVolatile(int flags)` Returns whether the given flags includes the "volatile" modifier.
`static java.util.List` `propertyDescriptors(int apiLevel)` Returns a list of structural property descriptors for this node type.
`void` `setKeyword(Modifier.ModifierKeyword modifierKeyord)` Sets the modifier keyword of this modifier node.

### Methods inherited from class org.eclipse.wst.jsdt.core.dom.ASTNode

`accept, copySubtree, copySubtrees, delete, equals, getAST, getBodyChild, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ABSTRACT

    public static final int ABSTRACT

"abstract" modifier constant (bit mask). Applicable to types and methods.

See Also:
  Constant Field Values

#### FINAL

    public static final int FINAL

"final" modifier constant (bit mask). Applicable to types, methods, fields, and variables.

See Also:
  Constant Field Values

#### KEYWORD_PROPERTY

    public static final SimplePropertyDescriptor KEYWORD_PROPERTY

The "keyword" structural property of this node type.

#### NATIVE

    public static final int NATIVE

"native" modifier constant (bit mask). Applicable only to methods.

See Also:
  Constant Field Values

#### NONE

    public static final int NONE

Modifier constant (bit mask, value 0) indicating no modifiers.

See Also:
  Constant Field Values

#### PRIVATE

    public static final int PRIVATE

"private" modifier constant (bit mask). Applicable to types, methods, constructors, and fields.

See Also:
  Constant Field Values

#### PROTECTED

    public static final int PROTECTED

"protected" modifier constant (bit mask). Applicable to types, methods, constructors, and fields.

See Also:
  Constant Field Values

#### PUBLIC

    public static final int PUBLIC

"public" modifier constant (bit mask). Applicable to types, methods, constructors, and fields.

See Also:
  Constant Field Values

#### STATIC

    public static final int STATIC

"static" modifier constant (bit mask). Applicable to types, methods, fields, and initializers.

See Also:
  Constant Field Values

#### STRICTFP

    public static final int STRICTFP

"strictfp" modifier constant (bit mask). Applicable to types and methods.

See Also:
  Constant Field Values

#### SYNCHRONIZED

    public static final int SYNCHRONIZED

"synchronized" modifier constant (bit mask). Applicable only to methods.

See Also:
  Constant Field Values

#### TRANSIENT

    public static final int TRANSIENT

"transient" modifier constant (bit mask). Applicable only to fields.

See Also:
  Constant Field Values

#### VOLATILE

    public static final int VOLATILE

"volatile" modifier constant (bit mask). Applicable only to fields.

See Also:
  Constant Field Values

#### GET

    public static final int GET

"get" modifier constant (bit mask) as defined on ES2015

Since:
  2.0
See Also:
  Constant Field Values

#### SET

    public static final int SET

"set" modifier constant (bit mask)

Since:
  2.0
See Also:
  Constant Field Values

### Method Detail

#### isAbstract

    public static boolean isAbstract(int flags)

Returns whether the given flags includes the "abstract" modifier. Applicable to types and methods.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `ABSTRACT` bit is set, and `false` otherwise

#### isFinal

    public static boolean isFinal(int flags)

Returns whether the given flags includes the "final" modifier. Applicable to types, methods, fields, and variables.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `FINAL` bit is set, and `false` otherwise

#### isNative

    public static boolean isNative(int flags)

Returns whether the given flags includes the "native" modifier. Applicable only to methods.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `NATIVE` bit is set, and `false` otherwise

#### isPrivate

    public static boolean isPrivate(int flags)

Returns whether the given flags includes the "private" modifier. Applicable to types, methods, constructors, and fields.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `PRIVATE` bit is set, and `false` otherwise

#### isProtected

    public static boolean isProtected(int flags)

Returns whether the given flags includes the "protected" modifier. Applicable to types, methods, constructors, and fields.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `PROTECTED` bit is set, and `false` otherwise

#### isPublic

    public static boolean isPublic(int flags)

Returns whether the given flags includes the "public" modifier. Applicable to types, methods, constructors, and fields.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `PUBLIC` bit is set, and `false` otherwise

#### isStatic

    public static boolean isStatic(int flags)

Returns whether the given flags includes the "static" modifier. Applicable to types, methods, fields, and initializers.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `STATIC` bit is set, and `false` otherwise

#### isStrictfp

    public static boolean isStrictfp(int flags)

Returns whether the given flags includes the "strictfp" modifier. Applicable to types and methods.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `STRICTFP` bit is set, and `false` otherwise

#### isSynchronized

    public static boolean isSynchronized(int flags)

Returns whether the given flags includes the "synchronized" modifier. Applicable only to methods.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `SYNCHRONIZED` bit is set, and `false` otherwise

#### isTransient

    public static boolean isTransient(int flags)

Returns whether the given flags includes the "transient" modifier. Applicable only to fields.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `TRANSIENT` bit is set, and `false` otherwise

#### isVolatile

    public static boolean isVolatile(int flags)

Returns whether the given flags includes the "volatile" modifier. Applicable only to fields.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `VOLATILE` bit is set, and `false` otherwise

#### isGet

    public static boolean isGet(int flags)

Returns whether the given flags includes the "get" modifier.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `GET` bit is set, and `false` otherwise
Since:
  2.0

#### isSet

    public static boolean isSet(int flags)

Returns whether the given flags includes the "set" modifier.

Parameters:
  `flags` - the modifier flags
Returns:
  `true` if the `SET` bit is set, and `false` otherwise
Since:
  2.0

#### propertyDescriptors

    public static java.util.List propertyDescriptors(int apiLevel)

Returns a list of structural property descriptors for this node type. Clients must not modify the result.

Parameters:
  `apiLevel` - the API level; one of the `AST.JLS*` constants
Returns:
  a list of property descriptors (element type: `StructuralPropertyDescriptor`)

#### getKeyword

    public Modifier.ModifierKeyword getKeyword()

Returns the modifier keyword of this modifier node.

Returns:
  the modifier keyword

#### isAbstract

    public boolean isAbstract()

Answer true if the receiver is the abstract modifier, false otherwise.

Returns:
  true if the receiver is the abstract modifier, false otherwise

#### isAnnotation

    public boolean isAnnotation()

See Also:
  `IExtendedModifier#isAnnotation()`

#### isFinal

    public boolean isFinal()

Answer true if the receiver is the final modifier, false otherwise.

Returns:
  true if the receiver is the final modifier, false otherwise

#### isModifier

    public boolean isModifier()

Description copied from interface: `IExtendedModifier`
Returns whether this extended modifier is a standard modifier.

Specified by:
  `isModifier` in interface `IExtendedModifier`
Returns:
  `true` if this is a standard modifier (instance of `Modifier`), and `false` otherwise
See Also:
  `IExtendedModifier.isModifier()`

#### isNative

    public boolean isNative()

Answer true if the receiver is the native modifier, false otherwise.

Returns:
  true if the receiver is the native modifier, false otherwise

#### isPrivate

    public boolean isPrivate()

Answer true if the receiver is the private modifier, false otherwise.

Returns:
  true if the receiver is the private modifier, false otherwise

#### isProtected

    public boolean isProtected()

Answer true if the receiver is the protected modifier, false otherwise.

Returns:
  true if the receiver is the protected modifier, false otherwise

#### isPublic

    public boolean isPublic()

Answer true if the receiver is the public modifier, false otherwise.

Returns:
  true if the receiver is the public modifier, false otherwise

#### isStatic

    public boolean isStatic()

Answer true if the receiver is the static modifier, false otherwise.

Returns:
  true if the receiver is the static modifier, false otherwise

#### isStrictfp

    public boolean isStrictfp()

Answer true if the receiver is the strictfp modifier, false otherwise.

Returns:
  true if the receiver is the strictfp modifier, false otherwise

#### isSynchronized

    public boolean isSynchronized()

Answer true if the receiver is the synchronized modifier, false otherwise.

Returns:
  true if the receiver is the synchronized modifier, false otherwise

#### isTransient

    public boolean isTransient()

Answer true if the receiver is the transient modifier, false otherwise.

Returns:
  true if the receiver is the transient modifier, false otherwise

#### isVolatile

    public boolean isVolatile()

Answer true if the receiver is the volatile modifier, false otherwise.

Returns:
  true if the receiver is the volatile modifier, false otherwise

#### setKeyword

    public void setKeyword(Modifier.ModifierKeyword modifierKeyord)

Sets the modifier keyword of this modifier node.

Parameters:
  `modifierKeyord` - the modifier keyword
Throws:
  `java.lang.IllegalArgumentException` - if the argument is `null`