java.lang.reflect.Modifier Maven / Gradle / Ivy
/*
This is not an official specification document, and usage is restricted.
NOTICE
(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
Neither this file nor any files generated from it describe a complete
specification, and they may only be used as described below. For
example, no permission is given for you to incorporate this file, in
whole or in part, in an implementation of a Java specification.
Sun Microsystems Inc. owns the copyright in this file and it is provided
to you for informative, as opposed to normative, use. The file and any
files generated from it may be used to generate other informative
documentation, such as a unified set of documents of API signatures for
a platform that includes technologies expressed as Java APIs. The file
may also be used to produce "compilation stubs," which allow
applications to be compiled and validated for such platforms.
Any work generated from this file, such as unified javadocs or compiled
stub files, must be accompanied by this notice in its entirety.
This work corresponds to the API signatures of JSR 219: Foundation
Profile 1.1. In the event of a discrepency between this work and the
JSR 219 specification, which is available at
http://www.jcp.org/en/jsr/detail?id=219, the latter takes precedence.
*/
package java.lang.reflect;
/**
* The 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.
*
* @see Class#getModifiers()
* @see Member#getModifiers()
*
* @author Nakul Saraiya
*/
public class Modifier
{
/**
* The int
value representing the public
* modifier.
*/
public static final int PUBLIC = 1;
/**
* The int
value representing the private
* modifier.
*/
public static final int PRIVATE = 2;
/**
* The int
value representing the protected
* modifier.
*/
public static final int PROTECTED = 4;
/**
* The int
value representing the static
* modifier.
*/
public static final int STATIC = 8;
/**
* The int
value representing the final
* modifier.
*/
public static final int FINAL = 16;
/**
* The int
value representing the synchronized
* modifier.
*/
public static final int SYNCHRONIZED = 32;
/**
* The int
value representing the volatile
* modifier.
*/
public static final int VOLATILE = 64;
/**
* The int
value representing the transient
* modifier.
*/
public static final int TRANSIENT = 128;
/**
* The int
value representing the native
* modifier.
*/
public static final int NATIVE = 256;
/**
* The int
value representing the interface
* modifier.
*/
public static final int INTERFACE = 512;
/**
* The int
value representing the abstract
* modifier.
*/
public static final int ABSTRACT = 1024;
/**
* The int
value representing the strictfp
* modifier.
*/
public static final int STRICT = 2048;
public Modifier() { }
/**
* Return true if the integer argument includes the
* public modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* public modifier; false otherwise.
*/
public static boolean isPublic(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* private modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* private modifier; false otherwise.
*/
public static boolean isPrivate(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* protected modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* protected modifier; false otherwise.
*/
public static boolean isProtected(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* static modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* static modifier; false otherwise.
*/
public static boolean isStatic(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* final modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* final modifier; false otherwise.
*/
public static boolean isFinal(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* synchronized modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* synchronized modifier; false otherwise.
*/
public static boolean isSynchronized(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* volatile modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* volatile modifier; false otherwise.
*/
public static boolean isVolatile(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* transient modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* transient modifier; false otherwise.
*/
public static boolean isTransient(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* native modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* native modifier; false otherwise.
*/
public static boolean isNative(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* interface modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* interface modifier; false otherwise.
*/
public static boolean isInterface(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* abstract modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* abstract modifier; false otherwise.
*/
public static boolean isAbstract(int mod) {
return false;
}
/**
* Return true if the integer argument includes the
* strictfp modifer, false otherwise.
*
* @param mod a set of modifers
* @return true if mod
includes the
* strictfp modifier; false otherwise.
*/
public static boolean isStrict(int mod) {
return false;
}
/**
* 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:
*
* 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.
*
* @param mod a set of modifers
* @return a string representation of the set of modifers
* represented by mod
*/
public static String toString(int mod) {
return null;
}
}