Java Code Examples for java.lang.reflect.Modifier#STRICT

The following examples show how to use java.lang.reflect.Modifier#STRICT . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
public static void main(String [] argv) {
    int allMods = Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE |
        Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL |
        Modifier.TRANSIENT | Modifier.VOLATILE | Modifier.SYNCHRONIZED |
        Modifier.NATIVE | Modifier.STRICT | Modifier.INTERFACE;

    String allModsString = "public protected private abstract static " +
        "final transient volatile synchronized native strictfp interface";

    /* zero should have an empty string */
    testString(0, "");

    /* test to make sure all modifiers print out in the proper order */
    testString(allMods, allModsString);

    /* verify no extraneous modifiers are printed */
    testString(~0, allModsString);
}
 
Example 2
Source Project: PATDroid   File: SmaliClassDetailLoader.java    License: Apache License 2.0 6 votes vote down vote up
private static int translateAccessFlags(int accessFlags) {
        int f = 0;
        f |= (AccessFlags.ABSTRACT.isSet(accessFlags) ? Modifier.ABSTRACT : 0);
//        f |= (AccessFlags.ANNOTATION.isSet(accessFlags) ? Modifier.ANNOTATION : 0);
//        f |= (AccessFlags.BRIDGE.isSet(accessFlags) ? Modifier.BRIDGE : 0);
//        f |= (AccessFlags.CONSTRUCTOR.isSet(accessFlags) ? Modifier.CONSTRUCTOR : 0);
//        f |= (AccessFlags.DECLARED_SYNCHRONIZED.isSet(accessFlags) ? Modifier.DECLARED_SYNCHRONIZED : 0);
//        f |= (AccessFlags.ENUM.isSet(accessFlags) ? Modifier.ENUM : 0);
        f |= (AccessFlags.FINAL.isSet(accessFlags) ? Modifier.FINAL : 0);
        f |= (AccessFlags.INTERFACE.isSet(accessFlags) ? Modifier.INTERFACE : 0);
        f |= (AccessFlags.NATIVE.isSet(accessFlags) ? Modifier.NATIVE : 0);
        f |= (AccessFlags.PRIVATE.isSet(accessFlags) ? Modifier.PRIVATE : 0);
        f |= (AccessFlags.PROTECTED.isSet(accessFlags) ? Modifier.PROTECTED : 0);
        f |= (AccessFlags.PUBLIC.isSet(accessFlags) ? Modifier.PUBLIC : 0);
        f |= (AccessFlags.STATIC.isSet(accessFlags) ? Modifier.STATIC : 0);
        f |= (AccessFlags.STRICTFP.isSet(accessFlags) ? Modifier.STRICT : 0);
        f |= (AccessFlags.SYNCHRONIZED.isSet(accessFlags) ? Modifier.SYNCHRONIZED : 0);
//        f |= (AccessFlags.SYNTHETIC.isSet(accessFlags) ? Modifier.SYNTHETIC : 0);
        f |= (AccessFlags.TRANSIENT.isSet(accessFlags) ? Modifier.TRANSIENT : 0);
//        f |= (AccessFlags.VARARGS.isSet(accessFlags) ? Modifier.VARARGS : 0);
        f |= (AccessFlags.VOLATILE.isSet(accessFlags) ? Modifier.VOLATILE : 0);
        return f;
    }
 
Example 3
Source Project: ModTheSpire   File: ClassInfo.java    License: MIT License 4 votes vote down vote up
/**
 * Convert an ASM access mask to a reflection Modifier mask.
 *
 * @param asmAccessMask the ASM access mask
 *
 * @return the Modifier mask
 */
private int convertAccessMaskToModifierMask(int asmAccessMask)
{
    int modifier = 0;

    // Convert the ASM access info into Reflection API modifiers.

    if ((asmAccessMask & Opcodes.ACC_FINAL) != 0)
        modifier |= Modifier.FINAL;

    if ((asmAccessMask & Opcodes.ACC_NATIVE) != 0)
        modifier |= Modifier.NATIVE;

    if ((asmAccessMask & Opcodes.ACC_INTERFACE) != 0)
        modifier |= Modifier.INTERFACE;

    if ((asmAccessMask & Opcodes.ACC_ABSTRACT) != 0)
        modifier |= Modifier.ABSTRACT;

    if ((asmAccessMask & Opcodes.ACC_PRIVATE) != 0)
        modifier |= Modifier.PRIVATE;

    if ((asmAccessMask & Opcodes.ACC_PROTECTED) != 0)
        modifier |= Modifier.PROTECTED;

    if ((asmAccessMask & Opcodes.ACC_PUBLIC) != 0)
        modifier |= Modifier.PUBLIC;

    if ((asmAccessMask & Opcodes.ACC_STATIC) != 0)
        modifier |= Modifier.STATIC;

    if ((asmAccessMask & Opcodes.ACC_STRICT) != 0)
        modifier |= Modifier.STRICT;

    if ((asmAccessMask & Opcodes.ACC_SYNCHRONIZED) != 0)
        modifier |= Modifier.SYNCHRONIZED;

    if ((asmAccessMask & Opcodes.ACC_TRANSIENT) != 0)
        modifier |= Modifier.TRANSIENT;

    if ((asmAccessMask & Opcodes.ACC_VOLATILE) != 0)
        modifier |= Modifier.VOLATILE;

    return modifier;
}