Jalopy 1.0b10

de.hunsicker.jalopy.language
Class JavaNodeModifier

java.lang.Object
  |
  +--java.lang.reflect.Modifier
        |
        +--de.hunsicker.jalopy.language.JavaNodeModifier

public final class JavaNodeModifier
extends Modifier

Helper class which resolves the different modifiers of a MODIFIERS node.

This class can be used to get the access level of a class, method, field...

Version:
$Revision: 1.3 $
Author:
Marco Hunsicker

Field Summary
static int UNKNOWN
          Unknown keyword.
 
Fields inherited from class java.lang.reflect.Modifier
ABSTRACT, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, TRANSIENT, VOLATILE
 
Method Summary
static boolean isAbstract(AST modifiers)
          Indicates whether the given modifiers node contains the abstract keyword.
static boolean isFinal(AST modifiers)
          Indicates whether the given modifiers node contains the final keyword.
static boolean isFriendly(AST modifiers)
          Indicates whether the given modifiers node denotes package protected (friendly) access.
static boolean isFriendly(int modifiers)
          Indicates whether the given modifier denotes package protected (friendly) access.
static boolean isPrivate(AST modifiers)
          Indicates whether the given modifiers node contains the private keyword.
static boolean isProtected(AST modifiers)
          Indicates whether the given modifiers node contains the protected keyword.
static boolean isPublic(AST modifiers)
          Indicates whether the given modifiers node contains the public keyword.
static boolean isStatic(AST modifiers)
          Indicates whether the given modifiers node contains the static keyword.
static boolean isSynchronized(AST modifiers)
          Indicates whether the given modifiers node contains the synchronized keyword.
static int valueOf(AST modifiers)
          Returns the modifier mask of the given modifiers node.
 
Methods inherited from class java.lang.reflect.Modifier
isAbstract, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
Unknown keyword.
Method Detail

isAbstract

public static boolean isAbstract(AST modifiers)
Indicates whether the given modifiers node contains the abstract keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the abstract keyword.

isFinal

public static boolean isFinal(AST modifiers)
Indicates whether the given modifiers node contains the final keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the final keyword.

isFriendly

public static boolean isFriendly(AST modifiers)
Indicates whether the given modifiers node denotes package protected (friendly) access.
Parameters:
modifiers -  
Returns:
true if the node denotes package protected access.

isFriendly

public static boolean isFriendly(int modifiers)
Indicates whether the given modifier denotes package protected (friendly) access.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the node denotes package protected access.

isPrivate

public static boolean isPrivate(AST modifiers)
Indicates whether the given modifiers node contains the private keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the private keyword.

isProtected

public static boolean isProtected(AST modifiers)
Indicates whether the given modifiers node contains the protected keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the protected keyword.

isPublic

public static boolean isPublic(AST modifiers)
Indicates whether the given modifiers node contains the public keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the public keyword.

isStatic

public static boolean isStatic(AST modifiers)
Indicates whether the given modifiers node contains the static keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the static keyword.

isSynchronized

public static boolean isSynchronized(AST modifiers)
Indicates whether the given modifiers node contains the synchronized keyword.
Parameters:
modifiers - MODIFIERS node to check.
Returns:
true if the given node contains the synchronized keyword.

valueOf

public static int valueOf(AST modifiers)
Returns the modifier mask of the given modifiers node.
Parameters:
modifiers - MODIFIERS node or one of the valid nodes representing modifiers (e.g. LITERAL_public, LITERAL_synchronized etc.).
Returns:
modifier mask of the given modifiers.
Throws:
IllegalArgumentException - if modifiers == null or modifiers.getType() != JavaTokenTypes.MODIFIERS

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002