Java Code Examples for org.apache.bcel.Const#ACC_SUPER

The following examples show how to use org.apache.bcel.Const#ACC_SUPER . 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 check out the related API usage on the sidebar.
Example 1
Source File: Utility.java    From commons-bcel with Apache License 2.0 6 votes vote down vote up
/**
 * Convert bit field of flags into string such as `static final'.
 *
 * Special case: Classes compiled with new compilers and with the
 * `ACC_SUPER' flag would be said to be "synchronized". This is
 * because SUN used the same value for the flags `ACC_SUPER' and
 * `ACC_SYNCHRONIZED'.
 *
 * @param  access_flags Access flags
 * @param  for_class access flags are for class qualifiers ?
 * @return String representation of flags
 */
public static String accessToString( final int access_flags, final boolean for_class ) {
    final StringBuilder buf = new StringBuilder();
    int p = 0;
    for (int i = 0; p < Const.MAX_ACC_FLAG_I; i++) { // Loop through known flags
        p = pow2(i);
        if ((access_flags & p) != 0) {
            /* Special case: Classes compiled with new compilers and with the
             * `ACC_SUPER' flag would be said to be "synchronized". This is
             * because SUN used the same value for the flags `ACC_SUPER' and
             * `ACC_SYNCHRONIZED'.
             */
            if (for_class && ((p == Const.ACC_SUPER) || (p == Const.ACC_INTERFACE))) {
                continue;
            }
            buf.append(Const.getAccessName(i)).append(" ");
        }
    }
    return buf.toString().trim();
}
 
Example 2
Source File: TestReturn01Creator.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
public TestReturn01Creator() {
  _cg = new ClassGen(TEST_PACKAGE+".TestReturn01", "java.lang.Object", "TestReturn01.java",
          Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {  });

  _cp = _cg.getConstantPool();
  _factory = new InstructionFactory(_cg, _cp);
}
 
Example 3
Source File: TestArrayAccess04Creator.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
public TestArrayAccess04Creator() {
  _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess04", "java.lang.Object", "TestArrayAccess04.java",
          Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {  });

  _cp = _cg.getConstantPool();
  _factory = new InstructionFactory(_cg, _cp);
}
 
Example 4
Source File: TestReturn03Creator.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
public TestReturn03Creator() {
  _cg = new ClassGen(TEST_PACKAGE+".TestReturn03", "java.lang.Object", "TestReturn03.java",
          Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {  });

  _cp = _cg.getConstantPool();
  _factory = new InstructionFactory(_cg, _cp);
}
 
Example 5
Source File: TestArrayAccess02Creator.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
public TestArrayAccess02Creator() {
  _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess02", "java.lang.Object", "TestArrayAccess02.java",
          Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {  });

  _cp = _cg.getConstantPool();
  _factory = new InstructionFactory(_cg, _cp);
}
 
Example 6
Source File: TestArrayAccess03Creator.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
public TestArrayAccess03Creator() {
  _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess03", "java.lang.Object", "TestArrayAccess03.java",
          Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {  });

  _cp = _cg.getConstantPool();
  _factory = new InstructionFactory(_cg, _cp);
}
 
Example 7
Source File: JavaClass.java    From commons-bcel with Apache License 2.0 4 votes vote down vote up
public final boolean isSuper() {
    return (super.getAccessFlags() & Const.ACC_SUPER) != 0;
}
 
Example 8
Source File: GeneratingAnnotatedClassesTestCase.java    From commons-bcel with Apache License 2.0 4 votes vote down vote up
private ClassGen createClassGen(final String classname)
{
    return new ClassGen(classname, "java.lang.Object", "<generated>",
            Const.ACC_PUBLIC | Const.ACC_SUPER, null);
}
 
Example 9
Source File: AnnotationGenTestCase.java    From commons-bcel with Apache License 2.0 4 votes vote down vote up
private ClassGen createClassGen(final String classname)
{
    return new ClassGen(classname, "java.lang.Object", "<generated>",
            Const.ACC_PUBLIC | Const.ACC_SUPER, null);
}