| java.lang.Object org.cojen.classfile.Modifiers
Modifiers | public class Modifiers (Code) | | The Modifiers class is an immutable wrapper around a modifier bitmask. The
methods provided to manipulate the bitmask ensure that it is always
legal. i.e. setting it public automatically clears it from being private or
protected.
author: Brian S O'Neill |
Method Summary | |
public boolean | equals(Object obj) | final public int | getBitmask() Returns the bitmask. | public static Modifiers | getInstance(int bitmask) Returns a Modifiers object with the given bitmask. | public int | hashCode() | public boolean | isAbstract() | public boolean | isBridge() | public boolean | isEnum() | public boolean | isFinal() | public boolean | isInterface() | public boolean | isNative() | public boolean | isPrivate() | public boolean | isProtected() | public boolean | isPublic() | public boolean | isStatic() | public boolean | isStrict() | public boolean | isSynchronized() | public boolean | isTransient() | public boolean | isVarArgs() | public boolean | isVolatile() | public Modifiers | toAbstract(boolean b) When set abstract, the bitmask is cleared from being final, volatile,
transient, native, synchronized, and strictfp. | public Modifiers | toBridge(boolean b) Used to identify if a method is a bridge method. | public Modifiers | toEnum(boolean b) Used to identify if a field is an enum constant. | public Modifiers | toFinal(boolean b) When set final, the bitmask is cleared from being an interface or
abstract. | public Modifiers | toInterface(boolean b) When set as an interface, non-interface settings are cleared and the
bitmask is set abstract. | public Modifiers | toNative(boolean b) When set native, non-native-method settings are cleared. | public Modifiers | toPrivate(boolean b) When set private, the bitmask is cleared from being public or protected. | public Modifiers | toProtected(boolean b) When set protected, the bitmask is cleared from being public or private. | public Modifiers | toPublic(boolean b) When set public, the bitmask is cleared from being private or protected. | public Modifiers | toStatic(boolean b) | public Modifiers | toStrict(boolean b) | public String | toString() Returns the string value generated by the Modifier class. | public Modifiers | toSynchronized(boolean b) When set synchronized, non-method settings are cleared. | public Modifiers | toTransient(boolean b) When set transient, non-field settings are cleared. | public Modifiers | toVarArgs(boolean b) Used to identify if a method accepts a variable amount of
arguments. | public Modifiers | toVolatile(boolean b) When set volatile, non-field settings are cleared. |
getBitmask | final public int getBitmask()(Code) | | Returns the bitmask.
|
getInstance | public static Modifiers getInstance(int bitmask)(Code) | | Returns a Modifiers object with the given bitmask.
|
hashCode | public int hashCode()(Code) | | |
isAbstract | public boolean isAbstract()(Code) | | |
isBridge | public boolean isBridge()(Code) | | |
isEnum | public boolean isEnum()(Code) | | |
isFinal | public boolean isFinal()(Code) | | |
isInterface | public boolean isInterface()(Code) | | |
isNative | public boolean isNative()(Code) | | |
isPrivate | public boolean isPrivate()(Code) | | |
isProtected | public boolean isProtected()(Code) | | |
isPublic | public boolean isPublic()(Code) | | |
isStatic | public boolean isStatic()(Code) | | |
isStrict | public boolean isStrict()(Code) | | |
isSynchronized | public boolean isSynchronized()(Code) | | |
isTransient | public boolean isTransient()(Code) | | |
isVarArgs | public boolean isVarArgs()(Code) | | |
isVolatile | public boolean isVolatile()(Code) | | |
toAbstract | public Modifiers toAbstract(boolean b)(Code) | | When set abstract, the bitmask is cleared from being final, volatile,
transient, native, synchronized, and strictfp. When cleared from being
abstract, the bitmask is also cleared from being an interface.
Parameters: b - true to set abstract, false otherwise |
toBridge | public Modifiers toBridge(boolean b)(Code) | | Used to identify if a method is a bridge method.
Parameters: b - true to set bridge, false otherwise |
toEnum | public Modifiers toEnum(boolean b)(Code) | | Used to identify if a field is an enum constant.
Parameters: b - true to set enum, false otherwise |
toFinal | public Modifiers toFinal(boolean b)(Code) | | When set final, the bitmask is cleared from being an interface or
abstract.
Parameters: b - true to set final, false otherwise |
toInterface | public Modifiers toInterface(boolean b)(Code) | | When set as an interface, non-interface settings are cleared and the
bitmask is set abstract.
Parameters: b - true to set interface, false otherwise |
toNative | public Modifiers toNative(boolean b)(Code) | | When set native, non-native-method settings are cleared.
Parameters: b - true to set native, false otherwise |
toPrivate | public Modifiers toPrivate(boolean b)(Code) | | When set private, the bitmask is cleared from being public or protected.
Parameters: b - true to set private, false otherwise |
toProtected | public Modifiers toProtected(boolean b)(Code) | | When set protected, the bitmask is cleared from being public or private.
Parameters: b - true to set protected, false otherwise |
toPublic | public Modifiers toPublic(boolean b)(Code) | | When set public, the bitmask is cleared from being private or protected.
Parameters: b - true to set public, false otherwise |
toStatic | public Modifiers toStatic(boolean b)(Code) | | Parameters: b - true to set static, false otherwise |
toStrict | public Modifiers toStrict(boolean b)(Code) | | Parameters: b - true to set strictfp, false otherwise |
toSynchronized | public Modifiers toSynchronized(boolean b)(Code) | | When set synchronized, non-method settings are cleared.
Parameters: b - true to set synchronized, false otherwise |
toTransient | public Modifiers toTransient(boolean b)(Code) | | When set transient, non-field settings are cleared.
Parameters: b - true to set transient, false otherwise |
toVarArgs | public Modifiers toVarArgs(boolean b)(Code) | | Used to identify if a method accepts a variable amount of
arguments.
Parameters: b - true to set varargs, false otherwise |
toVolatile | public Modifiers toVolatile(boolean b)(Code) | | When set volatile, non-field settings are cleared.
Parameters: b - true to set volatile, false otherwise |
|
|