Class Overview
A class whose instances are filters over Modifier bits.
Filtering is done by returning boolean values.
Classes, methods and fields can be filtered, or filtering
can be done directly on modifier bits.
WARNING: The contents of this source file are not part of any
supported API. Code that depends on them does so at its own risk:
they are subject to change or removal without notice.
Summary
[Expand]
Inherited Constants |
From class
java.lang.reflect.Modifier
int |
ABSTRACT |
The int value representing the abstract
modifier. |
int |
FINAL |
The int value representing the final
modifier. |
int |
INTERFACE |
The int value representing the interface
modifier. |
int |
NATIVE |
The int value representing the native
modifier. |
int |
PRIVATE |
The int value representing the private
modifier. |
int |
PROTECTED |
The int value representing the protected
modifier. |
int |
PUBLIC |
The int value representing the public
modifier. |
int |
STATIC |
The int value representing the static
modifier. |
int |
STRICT |
The int value representing the strictfp
modifier. |
int |
SYNCHRONIZED |
The int value representing the synchronized
modifier. |
int |
TRANSIENT |
The int value representing the transient
modifier. |
int |
VOLATILE |
The int value representing the volatile
modifier. |
|
Public Constructors |
|
ModifierFilter(long oneOf)
Constructor - Specify a filter.
|
|
ModifierFilter(long oneOf, long must, long cannot)
Constructor - Specify a filter.
|
[Expand]
Inherited Methods |
From class
java.lang.reflect.Modifier
static
boolean
|
isAbstract(int mod)
Return true if the integer argument includes the
abstract modifier, false otherwise.
|
static
boolean
|
isFinal(int mod)
Return true if the integer argument includes the
final modifier, false otherwise.
|
static
boolean
|
isInterface(int mod)
Return true if the integer argument includes the
interface modifier, false otherwise.
|
static
boolean
|
isNative(int mod)
Return true if the integer argument includes the
native modifier, false otherwise.
|
static
boolean
|
isPrivate(int mod)
Return true if the integer argument includes the
private modifier, false otherwise.
|
static
boolean
|
isProtected(int mod)
Return true if the integer argument includes the
protected modifier, false otherwise.
|
static
boolean
|
isPublic(int mod)
Return true if the integer argument includes the
public modifier, false otherwise.
|
static
boolean
|
isStatic(int mod)
Return true if the integer argument includes the
static modifier, false otherwise.
|
static
boolean
|
isStrict(int mod)
Return true if the integer argument includes the
strictfp modifier, false otherwise.
|
static
boolean
|
isSynchronized(int mod)
Return true if the integer argument includes the
synchronized modifier, false otherwise.
|
static
boolean
|
isTransient(int mod)
Return true if the integer argument includes the
transient modifier, false otherwise.
|
static
boolean
|
isVolatile(int mod)
Return true if the integer argument includes the
volatile modifier, false otherwise.
|
static
String
|
toString(int mod)
Return a string describing the access modifier flags in
the specified modifier.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Constants
public
static
final
long
ALL_ACCESS
All access modifiers.
A short-hand set of modifier bits that can be used in the
constructors of this class to specify all access modifiers,
Same as PRIVATE | PROTECTED | PUBLIC | PACKAGE.
Constant Value:
-9223372036854775801
(0x8000000000000007)
public
static
final
long
PACKAGE
Package private access.
A "pseudo-" modifier bit that can be used in the
constructors of this class to specify package private
access. This is needed since there is no Modifier.PACKAGE.
Constant Value:
-9223372036854775808
(0x8000000000000000)
Public Constructors
public
ModifierFilter
(long oneOf)
Constructor - Specify a filter.
Parameters
oneOf
| If zero, everything passes the filter.
If non-zero, at least one of the specified
bits must be on in the modifier bits to
pass the filter.
|
public
ModifierFilter
(long oneOf, long must, long cannot)
Constructor - Specify a filter.
For example, the filter below will only pass synchronized
methods that are private or package private access and are
not native or static.
ModifierFilter( Modifier.PRIVATE | ModifierFilter.PACKAGE,
Modifier.SYNCHRONIZED,
Modifier.NATIVE | Modifier.STATIC)
Each of the three arguments must either be
zero or the or'ed combination of the bits specified in the
class Modifier or this class. During filtering, these values
are compared against the modifier bits as follows:
Parameters
oneOf
| If zero, ignore this argument.
If non-zero, at least one of the bits must be on. |
must
| All bits specified must be on. |
cannot
| None of the bits specified can be on.
|
Public Methods
public
boolean
checkClass
(ClassDefinition cdef)
Filter a ClassDefinition.
Returns
- Whether the modifier of the class
passes this filter.
See Also
- sun.tools.ClassDefinition
public
boolean
checkMember
(MemberDefinition field)
Filter a MemberDefinition.
Returns
- Whether the modifier of the field
passes this filter.
See Also
- sun.tools.MemberDefinition
public
boolean
checkModifier
(int modifierBits)
Parameters
modifierBits
| Bits as specified in the Modifier class |
Returns
- Whether the modifierBits pass this filter.