org.eclipse.emf.codegen.merge.java.facade
Class FacadeFlags

java.lang.Object
  extended by org.eclipse.emf.codegen.merge.java.facade.FacadeFlags

public final class FacadeFlags
extends java.lang.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.

Since:
2.2.0
See Also:
JNode.getFlags()

Field Summary
static int ABSTRACT
          Abstract property flag.
static int ANNOTATION
          Annotation property flag (added in J2SE 1.5).
static int BRIDGE
          Bridge method property flag (added in J2SE 1.5).
static int DEFAULT
          Constant representing the absence of any flag
static int DEPRECATED
          Deprecated property flag.
static int ENUM
          Enum property flag (added in J2SE 1.5).
static int FINAL
          Final access flag.
static int INTERFACE
          Interface property flag.
static int NATIVE
          Native property flag.
static int PRIVATE
          Private access flag.
static int PROTECTED
          Protected access flag.
static int PUBLIC
          Public access flag.
static int STATIC
          Static access flag.
static int STRICTFP
          Strictfp property flag.
static int SUPER
          Super property flag.
static int SYNCHRONIZED
          Synchronized access flag.
static int SYNTHETIC
          Synthetic property flag.
static int TRANSIENT
          Transient property flag.
static int VARARGS
          Varargs method property flag (added in J2SE 1.5).
static int VOLATILE
          Volatile property flag.
 
Method Summary
static boolean isAbstract(int flags)
          Returns whether the given integer includes the abstract modifier.
static boolean isAnnotation(int flags)
          Returns whether the given integer has the AccAnnotation bit set.
static boolean isBridge(int flags)
          Returns whether the given integer has the AccBridge bit set.
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 isEnum(int flags)
          Returns whether the given integer has the AccEnum bit set.
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 isVarargs(int flags)
          Returns whether the given integer has the AccVarargs bit set.
static boolean isVolatile(int flags)
          Returns whether the given integer includes the volatile modifier.
static java.lang.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

DEFAULT

public static final int DEFAULT
Constant representing the absence of any flag

See Also:
Constant Field Values

PUBLIC

public static final int PUBLIC
Public access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
Private access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

PROTECTED

public static final int PROTECTED
Protected access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

STATIC

public static final int STATIC
Static access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

FINAL

public static final int FINAL
Final access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

SYNCHRONIZED

public static final int SYNCHRONIZED
Synchronized access flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

VOLATILE

public static final int VOLATILE
Volatile property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

TRANSIENT

public static final int TRANSIENT
Transient property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

NATIVE

public static final int NATIVE
Native property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

INTERFACE

public static final int INTERFACE
Interface property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

ABSTRACT

public static final int ABSTRACT
Abstract property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

STRICTFP

public static final int STRICTFP
Strictfp property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

SUPER

public static final int SUPER
Super property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

SYNTHETIC

public static final int SYNTHETIC
Synthetic property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

DEPRECATED

public static final int DEPRECATED
Deprecated property flag. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

BRIDGE

public static final int BRIDGE
Bridge method property flag (added in J2SE 1.5). Used to flag a compiler-generated bridge methods. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

VARARGS

public static final int VARARGS
Varargs method property flag (added in J2SE 1.5). Used to flag variable arity method declarations. See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

ENUM

public static final int ENUM
Enum property flag (added in J2SE 1.5). See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values

ANNOTATION

public static final int ANNOTATION
Annotation property flag (added in J2SE 1.5). See The Java Virtual Machine Specification for more details.

See Also:
Constant Field Values
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

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

isBridge

public static boolean isBridge(int flags)
Returns whether the given integer has the AccBridge bit set.

Parameters:
flags - the flags
Returns:
true if the AccBridge flag is included
See Also:
BRIDGE

isVarargs

public static boolean isVarargs(int flags)
Returns whether the given integer has the AccVarargs bit set.

Parameters:
flags - the flags
Returns:
true if the AccVarargs flag is included
See Also:
VARARGS

isEnum

public static boolean isEnum(int flags)
Returns whether the given integer has the AccEnum bit set.

Parameters:
flags - the flags
Returns:
true if the AccEnum flag is included
See Also:
ENUM

isAnnotation

public static boolean isAnnotation(int flags)
Returns whether the given integer has the AccAnnotation bit set.

Parameters:
flags - the flags
Returns:
true if the AccAnnotation flag is included
See Also:
ANNOTATION

toString

public static java.lang.String toString(int flags)
Returns a standard string describing the given modifier flags. Only modifier flags are included in the output; deprecated, synthetic, bridge, etc. flags are ignored.

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).

Note that the flags of a method can include the AccVarargs flag that has no standard description. Since the AccVarargs flag has the same value as the AccTransient flag (valid for fields only), attempting to get the description of method modifiers with the AccVarargs flag set would result in an unexpected description. Clients should ensure that the AccVarargs is not included in the flags of a method as follows:

 IMethod method = ...
 int flags = method.getFlags() & ~Flags.AccVarargs;
 return Flags.toString(flags);
 

Examples results:

    "public static final"
    "private native"
 

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

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.