Example usage for org.objectweb.asm Opcodes ACC_PROTECTED

List of usage examples for org.objectweb.asm Opcodes ACC_PROTECTED

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes ACC_PROTECTED.

Prototype

int ACC_PROTECTED

To view the source code for org.objectweb.asm Opcodes ACC_PROTECTED.

Click Source Link

Usage

From source file:com.sun.tdk.jcov.instrument.DataClass.java

License:Open Source License

/**
 * Check whether <b>access</b> field has ACC_PUBLIC or ACC_PROTECTED flag
 *
 * @see #getAccess()//from www.j  ava 2 s  . co m
 * @see org.objectweb.asm.Opcodes
 * @return true if <b>access</b> field has ACC_PUBLIC or ACC_PROTECTED flag
 */
public boolean isPublicAPI() {
    return (access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) != 0;
}

From source file:com.sun.tdk.jcov.instrument.DataClass.java

License:Open Source License

/**
 * Checks whether this class has 'protected' modifier
 *
 * @return true if class is protected//from  ww  w .j  ava2s  . c o  m
 */
public boolean hasProtectedModifier() {
    return (access & Opcodes.ACC_PROTECTED) != 0;
}

From source file:com.sun.tdk.jcov.processing.CombinerDataProcessor.java

License:Open Source License

/**
 * Removes "public" and "protected" modifiers from the given list
 *
 * @param modifiers array of modifiers//  w  w  w  . j  a va2s .co  m
 * @return modified array
 */
private int makePrivate(int modifiers) {
    return modifiers & ~Opcodes.ACC_PUBLIC & ~Opcodes.ACC_PROTECTED;
}

From source file:com.sun.tdk.jcov.report.ClassCoverage.java

License:Open Source License

/**
 * <p> Use getAccess() method to check for more specific modifiers.
 * getAccess() method returns a bit-mask of org.objectweb.asm.Opcodes
 * constants. </p>// w  w  w.j a va2s.c o  m
 *
 * @return true if class is <b>protected</b>
 * @see ClassCoverage#getAccess()
 */
public boolean isProtected() {
    return (access & Opcodes.ACC_PROTECTED) != 0;
}

From source file:com.xruby.compiler.codegen.ClassGeneratorForNoArgRubyMethod.java

License:BSD License

protected MethodGenerator createMethodGenerator() {
    return new MethodGenerator(Opcodes.ACC_PROTECTED, Method.getMethod(this.getRunMethodName()), cv_, null,
            null, false) {// w  w  w . java  2  s.c o  m
        public void loadCurrentBlock() {
            this.loadArg(1);
        }

        public void loadMethodArg() {
        }
    };
}

From source file:com.xruby.compiler.codegen.FieldManager.java

License:BSD License

private MethodGenerator visitRubyBlock() {
    cv_.visit(CgConfig.TARGET_VERSION, Opcodes.ACC_PUBLIC, //need to modify fields when doing Proc#call, see RubyProc.java
            name_, null, // signature
            this.helper.getSuperName(), // superName
            null // interface
    );/*from   w w w .  jav  a2s  . c  o  m*/

    // set source file's name, for debug
    if (file_name_ != null) {
        cv_.visitSource(file_name_, null);
    }

    return new MethodGenerator(Opcodes.ACC_PROTECTED, Method.getMethod(this.helper.getRunMethodName()), cv_,
            null, symbol_table_of_the_current_scope_, false);
}

From source file:com.xruby.compiler.codegen.ClassGeneratorForRubyMethod.java

License:BSD License

protected MethodGenerator createMethodGenerator() {
    return new MethodGenerator(Opcodes.ACC_PROTECTED, Method.getMethod(this.getRunMethodName()), cv_, null,
            null, false);//w w w.  jav a 2  s. c o  m
}

From source file:com.xruby.compiler.codegen.ClassGeneratorForRubyProgram.java

License:BSD License

private MethodGenerator startRubyProgram(boolean createMain, boolean is_singleton) {
    cv_.visit(CgConfig.TARGET_VERSION, Opcodes.ACC_PUBLIC, name_, null, // signature
            Types.RUBY_PROGRAM_TYPE.getInternalName(), // superName
            null // interface
    );/*from   ww w  .  jav a 2s.c o  m*/

    // set source file's name, for debug
    if (this.fileName != null) {
        cv_.visitSource(this.fileName, null);
    }

    CgUtil.createImplicitConstructor(this.cv_, Types.RUBY_PROGRAM_TYPE);

    if (createMain) {
        createStaticVoidMain(cv_);
    }

    //Implement RubyProgram
    return new MethodGenerator(Opcodes.ACC_PROTECTED, RUBY_PROGRAM_RUN, cv_, this.binding, null, is_singleton);
}

From source file:com.xruby.runtime.lang.util.RunMethodHelper.java

License:BSD License

protected GeneratorAdapter startRun(Method runMethod, ClassVisitor cv) {
    GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PROTECTED, runMethod, null, null, cv);
    mg.visitCode();//w  ww .  ja  va  2 s  .  co  m
    return mg;
}

From source file:cz.vutbr.fit.xhriba01.bc.lib.Utils.java

License:Open Source License

/**
 * Creates text representation of asm method access flag.
 * //from ww w . j  av a 2s.  c  om
 * @param flag asm method access flag
 * @return formatted string representing the access flag
 */
public static String formatMethodAccessFlags(int flag) {
    List<String> accesses = new ArrayList<>();
    if ((flag & Opcodes.ACC_PUBLIC) != 0) {
        accesses.add("public");
    }
    if ((flag & Opcodes.ACC_PROTECTED) != 0) {
        accesses.add("protected");
    }
    if ((flag & Opcodes.ACC_PRIVATE) != 0) {
        accesses.add("private");
    }
    if ((flag & Opcodes.ACC_STATIC) != 0) {
        accesses.add("static");
    }
    if ((flag & Opcodes.ACC_ABSTRACT) != 0) {
        accesses.add("abstract");
    }
    if ((flag & Opcodes.ACC_FINAL) != 0) {
        accesses.add("final");
    }
    return join(accesses.toArray(new String[accesses.size()]), " ");
}