net.sf.mmm.util.reflect.api
Enum VisibilityModifier

java.lang.Object
  extended by java.lang.Enum<VisibilityModifier>
      extended by net.sf.mmm.util.reflect.api.VisibilityModifier
All Implemented Interfaces:
Serializable, Comparable<VisibilityModifier>

public enum VisibilityModifier
extends Enum<VisibilityModifier>

This enum contains the possible modifiers for the visibility of a java element (type, field, method or constructor).

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
Modifier, javax.lang.model.element.Modifier

Enum Constant Summary
FRIENDLY
          The modifier for "friendly" visibility.
PRIVATE
          The modifier for private visibility.
PROTECTED
          The modifier for protected visibility.
PUBLIC
          The modifier for public visibility.
 
Field Summary
private  int bits
           
 
Method Summary
 int getBits()
          This method gets the bit-mask of this visibility-modifier.
 int getOrder()
          This method gets a non-negative integer value that follows the strict order of the visibility.
static VisibilityModifier valueOf(int modifiers)
          This method gets the VisibilityModifier for the given modifiers.
static VisibilityModifier valueOf(String name)
          Returns the enum constant of this type with the specified name.
static VisibilityModifier[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PRIVATE

public static final VisibilityModifier PRIVATE
The modifier for private visibility.

See Also:
javax.lang.model.element.Modifier#PRIVATE

FRIENDLY

public static final VisibilityModifier FRIENDLY
The modifier for "friendly" visibility. This is the visibility of elements, that have no explicit visibility modifier (are NOT public, protected or private).


PROTECTED

public static final VisibilityModifier PROTECTED
The modifier for protected visibility.

See Also:
javax.lang.model.element.Modifier#PROTECTED

PUBLIC

public static final VisibilityModifier PUBLIC
The modifier for public visibility.

See Also:
javax.lang.model.element.Modifier#PUBLIC
Field Detail

bits

private final int bits
See Also:
getBits()
Method Detail

values

public static VisibilityModifier[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (VisibilityModifier c : VisibilityModifier.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static VisibilityModifier valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getBits

public int getBits()
This method gets the bit-mask of this visibility-modifier.

Returns:
the bit-mask.

getOrder

public int getOrder()
This method gets a non-negative integer value that follows the strict order of the visibility. The following equation applies:
 PRIVATE.getOrder() < FRIENDLY.getOrder()
 < PROTECTED.getOrder() < PUBLIC.getOrder()
 

Returns:
the order number of the visibility.

valueOf

public static VisibilityModifier valueOf(int modifiers)
This method gets the VisibilityModifier for the given modifiers.

Parameters:
modifiers - are the modifiers of a java element.
Returns:
the according visibility-modifier.
See Also:
Class.getModifiers(), Method.getModifiers(), Field.getModifiers()


Copyright © 2001-2010 mmm-Team. All Rights Reserved.