站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

Contents | Prev | Next Java Core Reflection


The class java.lang.reflect.Modifier

    package java.lang.reflect;

    public final class Modifier extends Object

The Modifier class is an uninstantiable class that exports static methods and constants that are used to decode the Java language modifiers for classes and members, which are encoded in an integer.


Fields

NOTE: The values for the integer modifier constants below are those defined in The Java Virtual Machine Specification, chapter 4.

PUBLIC

    public final static int PUBLIC

The integer constant for the public access modifier.

PRIVATE

    public final static int PRIVATE

The integer constant for the private access modifier.

PROTECTED

    public final static int PROTECTED

The integer constant for the protected access modifier.

STATIC

    public final static int STATIC

The integer constant for the static modifier.

FINAL

    public final static int FINAL

The integer constant for the final modifier.

SYNCHRONIZED

    public final static int SYNCHRONIZED

The integer constant for the synchronized modifier.

VOLATILE

    public final static int VOLATILE

The integer constant for the volatile modifier.

TRANSIENT

    public final static int TRANSIENT

The integer constant for the transient modifier.

NATIVE

    public final static int NATIVE

The integer constant for the native modifier.

INTERFACE

    public final static int INTERFACE

The integer constant for the interface modifier.

ABSTRACT

    public final static int ABSTRACT

The integer constant for the abstract modifier.


Methods

isPublic

    public static boolean isPublic(int mod)

Returns true if the specified integer includes the public modifier.

isPrivate

    public static boolean isPrivate(int mod)

Returns true if the specified integer includes the private modifier.

isProtected

    public static boolean isProtected(int mod)

Returns true if the specified integer includes the protected modifier.

isStatic

    public static boolean isStatic(int mod)

Returns true if the specified integer includes the static modifier.

isFinal

    public static boolean isFinal(int mod)

Returns true if the specified integer includes the final modifier.

isSynchronized

    public static boolean isSynchronized(int mod)

Returns true if the specified integer includes the synchronized modifier.

isVolatile

    public static boolean isVolatile(int mod)

Returns true if the specified integer includes the volatile modifier..

isTransient

    public static boolean isTransient(int mod)

Returns true if the specified integer includes the transient modifier..

isNative

    public static boolean isNative(int mod)

Returns true if the specified integer includes the native modifier..

isInterface

    public static boolean isInterface(int mod)

Returns true if the specified integer includes the interface modifier..

isAbstract

    public static boolean isAbstract(int mod)

Returns true if the specified integer includes the abstract modifier..

toString

    public static String toString(int mod)

Returns a string containing a space-separated list of the names of the modifiers included in the specified integer. For example:

    

        public final synchronized

        private transient volatile

The modifier names are returned in canonical order as specified by The Java Language Specification.



Contents | Prev | Next
Copyright © 1996, 1997 Sun Microsystems, Inc. All rights reserved.