[/url] [url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
java.lang.reflect
Class Modifierjava.lang.Object
![](/images/load.gif)
public class Modifier extends ObjectThe Modifier class provides static methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from The JavaTM Virtual Machine Specification, Second edition tables 4.1, 4.4, 4.5, and 4.7. Modifier类提供了静态方法和常量来对类和成员访问修饰符进行编码。修饰符用整数表示, 以不同的bit位来表示不同的修饰符。表示修饰符的常量值来自于Java语言规范(第二版) 表4.1、4.4、4.5和4.7。
See Also: Class.getModifiers(), Member.getModifiers()Field Summary
static int
The int value representing the abstract modifier. 表示abstract修饰符的int值。
static int
The int value representing the final modifier. 表示final修饰符的int值。
static int
The int value representing the interface modifier. 表示interface修饰符的int值。
static int
The int value representing the native modifier. 表示native修饰符的int值。
static int
The int value representing the private modifier. 表示private修饰符的int值。
static int
The int value representing the protected modifier. 表示protected修饰符的int值。
static int
The int value representing the public modifier. 表示public修饰符的int值。
static int
The int value representing the static modifier. 表示static修饰符的int值。
static int
The int value representing the strictfp modifier. 表示strictfp修饰符的int值。
static int
The int value representing the synchronized modifier. 表示synchronized修饰符的int值。
static int
The int value representing the transient modifier. 表示transient修饰符的int值。
static int
The int value representing the volatile modifier. 表示volatile修饰符的int值。
Constructor Summary
Modifier()
Method Summary
static boolean
isAbstract(int mod)
Return true if the integer argument includes the abstract modifer, false otherwise. 如果整数参数包含abstract修饰符,返回true,否则为false。
static boolean
isFinal(int mod)
Return true if the integer argument includes the final modifer, false otherwise. 如果整数参数包含final修饰符,返回true,否则为false。
static boolean
isInterface(int mod)
Return true if the integer argument includes the interface modifer, false otherwise. 如果整数参数包含interface修饰符,返回true,否则为false。
static boolean
isNative(int mod)
Return true if the integer argument includes the native modifer, false otherwise. 如果整数参数包含native修饰符,返回true,否则为false。
static boolean
isPrivate(int mod)
Return true if the integer argument includes the private modifer, false otherwise. 如果整数参数包含private修饰符,返回true,否则为false。
static boolean
isProtected(int mod)
Return true if the integer argument includes the protected modifer, false otherwise. 如果整数参数包含protected修饰符,返回true,否则为false。
static boolean
isPublic(int mod)
Return true if the integer argument includes the public modifer, false otherwise. 如果整数参数包含public修饰符,返回true,否则为false。
static boolean
isStatic(int mod)
Return true if the integer argument includes the static modifer, false otherwise. 如果整数参数包含static修饰符,返回true,否则为false。
static boolean
isStrict(int mod)
Return true if the integer argument includes the strictfp modifer, false otherwise. 如果整数参数包含strictfp修饰符,返回true,否则为false。
static boolean
isSynchronized(int mod)
Return true if the integer argument includes the synchronized modifer, false otherwise. 如果整数参数包含synchronized修饰符,返回true,否则为false。
static boolean
isTransient(int mod)
Return true if the integer argument includes the transient modifer, false otherwise. 如果整数参数包含transient修饰符,返回true,否则为false。
static boolean
isVolatile(int mod)
Return true if the integer argument includes the volatile modifer, false otherwise. 如果整数参数包含volatile修饰符,返回true,否则为false。
static String
toString(int mod)
Return a string describing the access modifier flags in the specified modifier. 返回指定修饰符中描述访问修饰符标记的字符串。
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
PUBLICpublic static final int PUBLIC
The int value representing the public modifier. 表示public修饰符的int值。
See Also: Constant Field ValuesPRIVATEpublic static final int PRIVATE
The int value representing the private modifier. 表示private修饰符的int值。
See Also: Constant Field ValuesPROTECTEDpublic static final int PROTECTED
The int value representing the protected modifier. 表示protected修饰符的int值。
See Also: Constant Field ValuesSTATICpublic static final int STATIC
The int value representing the static modifier. 表示static修饰符的int值。
See Also: Constant Field ValuesFINALpublic static final int FINAL
The int value representing the final modifier. 表示final修饰符的int值。
See Also: Constant Field ValuesSYNCHRONIZEDpublic static final int SYNCHRONIZED
The int value representing the synchronized modifier. 表示synchronized修饰符的int值。
See Also: Constant Field ValuesVOLATILEpublic static final int VOLATILE
The int value representing the volatile modifier. 表示volatile修饰符的int值。
See Also: Constant Field ValuesTRANSIENTpublic static final int TRANSIENT
The int value representing the transient modifier. 表示transient修饰符的int值。
See Also: Constant Field ValuesNATIVEpublic static final int NATIVE
The int value representing the native modifier. 表示native修饰符的int值。
See Also: Constant Field ValuesINTERFACEpublic static final int INTERFACE
The int value representing the interface modifier. 表示interface修饰符的int值。
See Also: Constant Field ValuesABSTRACTpublic static final int ABSTRACT
The int value representing the abstract modifier. 表示abstract修饰符的int值。
See Also: Constant Field ValuesSTRICTpublic static final int STRICT
The int value representing the strictfp modifier. 表示strictfp修饰符的int值。
See Also: Constant Field ValuesConstructor Detail
Modifierpublic Modifier()
Method Detail
isPublicpublic static boolean isPublic(int mod)
Return true if the integer argument includes the public modifer, false otherwise. 如果整数参数包含public修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the public modifier; false otherwise. 如果mod包含public修饰符,返回true,否则为false。isPrivatepublic static boolean isPrivate(int mod)
Return true if the integer argument includes the private modifer, false otherwise. 如果整数参数包含private修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the private modifier; false otherwise. 如果mod包含private修饰符,返回true,否则为false。isProtectedpublic static boolean isProtected(int mod)
Return true if the integer argument includes the protected modifer, false otherwise. 如果整数参数包含protected修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the protected modifier; false otherwise. 如果mod包含protected修饰符,返回true,否则为false。isStaticpublic static boolean isStatic(int mod)
Return true if the integer argument includes the static modifer, false otherwise. 如果整数参数包含static修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the static modifier; false otherwise. 如果mod包含static修饰符,返回true,否则为false。isFinalpublic static boolean isFinal(int mod)
Return true if the integer argument includes the final modifer, false otherwise. 如果整数参数包含final修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the final modifier; false otherwise. 如果mod包含final修饰符,返回true,否则为false。isSynchronizedpublic static boolean isSynchronized(int mod)
Return true if the integer argument includes the synchronized modifer, false otherwise. 如果整数参数包含synchronized修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the synchronized modifier; false otherwise. 如果mod包含synchronized修饰符,返回true,否则为false。isVolatilepublic static boolean isVolatile(int mod)
Return true if the integer argument includes the volatile modifer, false otherwise. 如果整数参数包含volatile修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the volatile modifier; false otherwise. 如果mod包含volatile修饰符,返回true,否则为false。isTransientpublic static boolean isTransient(int mod)
Return true if the integer argument includes the transient modifer, false otherwise. 如果整数参数包含transient修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the transient modifier; false otherwise. 如果mod包含transient修饰符,返回true,否则为false。isNativepublic static boolean isNative(int mod)
Return true if the integer argument includes the native modifer, false otherwise. 如果整数参数包含native修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the native modifier; false otherwise. 如果mod包含native修饰符,返回true,否则为false。isInterfacepublic static boolean isInterface(int mod)
Return true if the integer argument includes the interface modifer, false otherwise. 如果整数参数包含interface修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the interface modifier; false otherwise. 如果mod包含interface修饰符,返回true,否则为false。isAbstractpublic static boolean isAbstract(int mod)
Return true if the integer argument includes the abstract modifer, false otherwise. 如果整数参数包含abstract修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the abstract modifier; false otherwise. 如果mod包含abstract修饰符,返回true,否则为false。isStrictpublic static boolean isStrict(int mod)
Return true if the integer argument includes the strictfp modifer, false otherwise. 如果整数参数包含strictfp修饰符,返回true,否则为false。
Parameters: mod - a set of modifers 一组修饰符 Returns: true if mod includes the strictfp modifier; false otherwise. 如果mod包含strictfp修饰符,返回true,否则为false。toStringpublic static String toString(int mod)
Return a string describing the access modifier flags in the specified modifier. For example: 返回指定修饰符中描述访问修饰符标记的字符串。例如: public final synchronized strictfp
The modifier names are returned in an order consistent with the suggested modifier orderings given in The Java Language Specification, Second Edition sections §8.1.1, §8.3.1, §8.4.3, §8.8.3, and §9.1.1. The full modifier ordering used by this method is: 返回的修饰符名称按Java语言规范(第二版)8.1.1,8.3.1,8.4.3,9.1.1节中建议的顺序排序。 方法使用的完整修饰符顺序如下: public protected private abstract static final transient volatile synchronized native strictfp interface The interface modifier discussed in this class is not a true modifier in the Java language and it appears after all other modifiers listed by this method. This method may return a string of modifiers that are not valid modifiers of a Java entity; in other words, no checking is done on the possible validity of the combination of modifiers represented by the input. 在该类中讨论的interface修饰符在Java语言中不是一个真正的修饰符,它出现在方法列出的所有修饰符之后。 方法可能返回的修饰符字符串不是一个有效的Java实体修饰符。换言之,输入表示的修饰符组合 的可能有效性不做检查。
Parameters: mod - a set of modifers 一组修饰符 Returns: a string representation of the set of modifers represented by mod mod表示的一组修饰符的字符串形式[/url][url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.