Eclipse JDT
2.1

org.eclipse.jdt.core
Class Flags

java.lang.Object
  |
  +--org.eclipse.jdt.core.Flags

public final class Flags
extends Object

Utility class for decoding modifier flags in Java elements.

This class provides static methods only; it is not intended to be instantiated or subclassed by clients.

Note that the numeric values of these flags match the ones for class files as described in the Java Virtual Machine Specification. The AST class Modifier provides the same functionality as this class, only in the org.eclipse.jdt.core.dom package.

See Also:
IMember.getFlags()

Field Summary
static int AccAbstract
          Abstract property flag.
static int AccDeprecated
          Deprecated property flag.
static int AccFinal
          Final access flag.
static int AccInterface
          Interface property flag.
static int AccNative
          Native property flag.
static int AccPrivate
          Private access flag.
static int AccProtected
          Protected access flag.
static int AccPublic
          Public access flag.
static int AccStatic
          Static access flag.
static int AccStrictfp
          Strictfp property flag.
static int AccSuper
          Super property flag.
static int AccSynchronized
          Synchronized access flag.
static int AccSynthetic
          Synthetic property flag.
static int AccTransient
          Transient property flag.
static int AccVolatile
          Volatile property flag.
 
Method Summary
static boolean isAbstract(int flags)
          Returns whether the given integer includes the abstract modifier.
static boolean isDeprecated(int flags)
          Returns whether the given integer includes the indication that the element is deprecated (@deprecated tag in Javadoc comment).
static boolean isFinal(int flags)
          Returns whether the given integer includes the final modifier.
static boolean isInterface(int flags)
          Returns whether the given integer includes the interface modifier.
static boolean isNative(int flags)
          Returns whether the given integer includes the native modifier.
static boolean isPrivate(int flags)
          Returns whether the given integer includes the private modifier.
static boolean isProtected(int flags)
          Returns whether the given integer includes the protected modifier.
static boolean isPublic(int flags)
          Returns whether the given integer includes the public modifier.
static boolean isStatic(int flags)
          Returns whether the given integer includes the static modifier.
static boolean isStrictfp(int flags)
          Returns whether the given integer includes the strictfp modifier.
static boolean isSynchronized(int flags)
          Returns whether the given integer includes the synchronized modifier.
static boolean isSynthetic(int flags)
          Returns whether the given integer includes the indication that the element is synthetic.
static boolean isTransient(int flags)
          Returns whether the given integer includes the transient modifier.
static boolean isVolatile(int flags)
          Returns whether the given integer includes the volatile modifier.
static String toString(int flags)
          Returns a standard string describing the given modifier flags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AccPublic

public static final int AccPublic
Public access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccPrivate

public static final int AccPrivate
Private access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccProtected

public static final int AccProtected
Protected access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccStatic

public static final int AccStatic
Static access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccFinal

public static final int AccFinal
Final access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccSynchronized

public static final int AccSynchronized
Synchronized access flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccVolatile

public static final int AccVolatile
Volatile property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccTransient

public static final int AccTransient
Transient property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccNative

public static final int AccNative
Native property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccInterface

public static final int AccInterface
Interface property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccAbstract

public static final int AccAbstract
Abstract property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccStrictfp

public static final int AccStrictfp
Strictfp property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccSuper

public static final int AccSuper
Super property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccSynthetic

public static final int AccSynthetic
Synthetic property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0

AccDeprecated

public static final int AccDeprecated
Deprecated property flag. See The Java Virtual Machine Specification for more details.
Since:
2.0
Method Detail

isAbstract

public static boolean isAbstract(int flags)
Returns whether the given integer includes the abstract modifier.
Parameters:
flags - the flags
Returns:
true if the abstract modifier is included

isDeprecated

public static boolean isDeprecated(int flags)
Returns whether the given integer includes the indication that the element is deprecated (@deprecated tag in Javadoc comment).
Parameters:
flags - the flags
Returns:
true if the element is marked as deprecated

isFinal

public static boolean isFinal(int flags)
Returns whether the given integer includes the final modifier.
Parameters:
flags - the flags
Returns:
true if the final modifier is included

isInterface

public static boolean isInterface(int flags)
Returns whether the given integer includes the interface modifier.
Parameters:
flags - the flags
Returns:
true if the interface modifier is included
Since:
2.0

isNative

public static boolean isNative(int flags)
Returns whether the given integer includes the native modifier.
Parameters:
flags - the flags
Returns:
true if the native modifier is included

isPrivate

public static boolean isPrivate(int flags)
Returns whether the given integer includes the private modifier.
Parameters:
flags - the flags
Returns:
true if the private modifier is included

isProtected

public static boolean isProtected(int flags)
Returns whether the given integer includes the protected modifier.
Parameters:
flags - the flags
Returns:
true if the protected modifier is included

isPublic

public static boolean isPublic(int flags)
Returns whether the given integer includes the public modifier.
Parameters:
flags - the flags
Returns:
true if the public modifier is included

isStatic

public static boolean isStatic(int flags)
Returns whether the given integer includes the static modifier.
Parameters:
flags - the flags
Returns:
true if the static modifier is included

isStrictfp

public static boolean isStrictfp(int flags)
Returns whether the given integer includes the strictfp modifier.
Parameters:
flags - the flags
Returns:
true if the strictfp modifier is included

isSynchronized

public static boolean isSynchronized(int flags)
Returns whether the given integer includes the synchronized modifier.
Parameters:
flags - the flags
Returns:
true if the synchronized modifier is included

isSynthetic

public static boolean isSynthetic(int flags)
Returns whether the given integer includes the indication that the element is synthetic.
Parameters:
flags - the flags
Returns:
true if the element is marked synthetic

isTransient

public static boolean isTransient(int flags)
Returns whether the given integer includes the transient modifier.
Parameters:
flags - the flags
Returns:
true if the transient modifier is included

isVolatile

public static boolean isVolatile(int flags)
Returns whether the given integer includes the volatile modifier.
Parameters:
flags - the flags
Returns:
true if the volatile modifier is included

toString

public static String toString(int flags)
Returns a standard string describing the given modifier flags. Only modifier flags are included in the output; the deprecated and synthetic flags are ignored if set.

The flags are output in the following order:

   public protected private 
   static 
   abstract final native synchronized transient volatile strictfp
 
This is a compromise between the orders specified in sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, 9.1.1, and 9.3 of The Java Language Specification, Second Edition (JLS2).

Examples results:

	  "public static final"
	  "private native"
 

Parameters:
flags - the flags
Returns:
the standard string representation of the given flags

Eclipse JDT
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.