Java Code Examples for org.objectweb.asm.Opcodes#ACC_MANDATED

The following examples show how to use org.objectweb.asm.Opcodes#ACC_MANDATED . 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: Textifier.java    From Concurnas with MIT License 4 votes vote down vote up
/**
 * Appends a string representation of the given access flags to {@link #stringBuilder}.
 *
 * @param accessFlags some access flags.
 */
private void appendAccess(final int accessFlags) {
  if ((accessFlags & Opcodes.ACC_PUBLIC) != 0) {
    stringBuilder.append("public ");
  }
  if ((accessFlags & Opcodes.ACC_PRIVATE) != 0) {
    stringBuilder.append("private ");
  }
  if ((accessFlags & Opcodes.ACC_PROTECTED) != 0) {
    stringBuilder.append("protected ");
  }
  if ((accessFlags & Opcodes.ACC_FINAL) != 0) {
    stringBuilder.append("final ");
  }
  if ((accessFlags & Opcodes.ACC_STATIC) != 0) {
    stringBuilder.append("static ");
  }
  if ((accessFlags & Opcodes.ACC_SYNCHRONIZED) != 0) {
    stringBuilder.append("synchronized ");
  }
  if ((accessFlags & Opcodes.ACC_VOLATILE) != 0) {
    stringBuilder.append("volatile ");
  }
  if ((accessFlags & Opcodes.ACC_TRANSIENT) != 0) {
    stringBuilder.append("transient ");
  }
  if ((accessFlags & Opcodes.ACC_ABSTRACT) != 0) {
    stringBuilder.append("abstract ");
  }
  if ((accessFlags & Opcodes.ACC_STRICT) != 0) {
    stringBuilder.append("strictfp ");
  }
  if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0) {
    stringBuilder.append("synthetic ");
  }
  if ((accessFlags & Opcodes.ACC_MANDATED) != 0) {
    stringBuilder.append("mandated ");
  }
  if ((accessFlags & Opcodes.ACC_ENUM) != 0) {
    stringBuilder.append("enum ");
  }
}
 
Example 2
Source File: SAXClassAdapter.java    From JByteMod-Beta with GNU General Public License v2.0 4 votes vote down vote up
static void appendAccess(final int access, final StringBuilder sb) {
  if ((access & Opcodes.ACC_PUBLIC) != 0) {
    sb.append("public ");
  }
  if ((access & Opcodes.ACC_PRIVATE) != 0) {
    sb.append("private ");
  }
  if ((access & Opcodes.ACC_PROTECTED) != 0) {
    sb.append("protected ");
  }
  if ((access & Opcodes.ACC_FINAL) != 0) {
    if ((access & ACCESS_MODULE) == 0) {
      sb.append("final ");
    } else {
      sb.append("transitive ");
    }
  }
  if ((access & Opcodes.ACC_STATIC) != 0) {
    sb.append("static ");
  }
  if ((access & Opcodes.ACC_SUPER) != 0) {
    if ((access & ACCESS_CLASS) == 0) {
      if ((access & ACCESS_MODULE_REQUIRES) != 0) {
        sb.append("transitive ");
      } else {
        if ((access & ACCESS_MODULE) == 0) {
          sb.append("synchronized ");
        } else {
          sb.append("open ");
        }
      }
    } else {
      sb.append("super ");
    }
  }
  if ((access & Opcodes.ACC_VOLATILE) != 0) {
    if ((access & ACCESS_FIELD) == 0) {
      sb.append("bridge ");
    } else {
      if ((access & ACCESS_MODULE_REQUIRES) == 0) {
        sb.append("volatile ");
      } else {
        sb.append("static ");
      }
    }
  }
  if ((access & Opcodes.ACC_TRANSIENT) != 0) {
    if ((access & ACCESS_FIELD) == 0) {
      sb.append("varargs ");
    } else {
      sb.append("transient ");
    }
  }
  if ((access & Opcodes.ACC_NATIVE) != 0) {
    sb.append("native ");
  }
  if ((access & Opcodes.ACC_STRICT) != 0) {
    sb.append("strict ");
  }
  if ((access & Opcodes.ACC_INTERFACE) != 0) {
    sb.append("interface ");
  }
  if ((access & Opcodes.ACC_ABSTRACT) != 0) {
    sb.append("abstract ");
  }
  if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
    sb.append("synthetic ");
  }
  if ((access & Opcodes.ACC_ANNOTATION) != 0) {
    sb.append("annotation ");
  }
  if ((access & Opcodes.ACC_ENUM) != 0) {
    sb.append("enum ");
  }
  if ((access & Opcodes.ACC_DEPRECATED) != 0) {
    sb.append("deprecated ");
  }
  if ((access & Opcodes.ACC_MANDATED) != 0) {
    if ((access & ACCESS_CLASS) == 0) {
      sb.append("module ");
    } else {
      sb.append("mandated ");
    }
  }
}
 
Example 3
Source File: Textifier.java    From JByteMod-Beta with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends a string representation of the given access modifiers to
 * {@link #buf buf}.
 *
 * @param access
 *          some access modifiers.
 */
private void appendAccess(final int access) {
  if ((access & Opcodes.ACC_PUBLIC) != 0) {
    buf.append("public ");
  }
  if ((access & Opcodes.ACC_PRIVATE) != 0) {
    buf.append("private ");
  }
  if ((access & Opcodes.ACC_PROTECTED) != 0) {
    buf.append("protected ");
  }
  if ((access & Opcodes.ACC_FINAL) != 0) {
    buf.append("final ");
  }
  if ((access & Opcodes.ACC_STATIC) != 0) {
    buf.append("static ");
  }
  if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
    buf.append("synchronized ");
  }
  if ((access & Opcodes.ACC_VOLATILE) != 0) {
    buf.append("volatile ");
  }
  if ((access & Opcodes.ACC_TRANSIENT) != 0) {
    buf.append("transient ");
  }
  if ((access & Opcodes.ACC_ABSTRACT) != 0) {
    buf.append("abstract ");
  }
  if ((access & Opcodes.ACC_STRICT) != 0) {
    buf.append("strictfp ");
  }
  if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
    buf.append("synthetic ");
  }
  if ((access & Opcodes.ACC_MANDATED) != 0) {
    buf.append("mandated ");
  }
  if ((access & Opcodes.ACC_ENUM) != 0) {
    buf.append("enum ");
  }
}
 
Example 4
Source File: ASMClassParser.java    From TickDynamic with MIT License 4 votes vote down vote up
protected int parseAccessFlags() throws Exception {
	String current;
	int access = 0;
	
	//They share value(Mutually exclusive, one is for method, one is for field)
	boolean gotTransient = false;
	boolean gotVarargs = false;
	while(true)
	{
		current = nextToken();
		if(current == null)
			return access;
		
		//A lot of these actually are not a keyword, but something the compiler adds, just keep it here for now
		if(current.equals("public"))
			access += Opcodes.ACC_PUBLIC;
		else if(current.equals("private"))
			access += Opcodes.ACC_PRIVATE;
		else if(current.equals("protected"))
			access += Opcodes.ACC_PROTECTED;
		else if(current.equals("static"))
			access += Opcodes.ACC_STATIC;
		else if(current.equals("final"))
			access += Opcodes.ACC_FINAL;
		/*else if(current.equals("super"))
			access += Opcodes.ACC_SUPER;*/ //This one is added on newer compilers whenever a class has a super class
		else if(current.equals("synchronized"))
			access += Opcodes.ACC_SYNCHRONIZED;
		else if(current.equals("volatile"))
			access += Opcodes.ACC_VOLATILE;
		else if(current.equals("bridge"))
			access += Opcodes.ACC_BRIDGE;
		else if(current.equals("varargs"))
		{
			if(!gotTransient)
			{
				access += Opcodes.ACC_VARARGS;
				gotVarargs = true;
			}
		}
		else if(current.equals("transient"))
		{
			if(!gotVarargs)
			{
				access += Opcodes.ACC_TRANSIENT;
				gotTransient = true;
			}
		}
		else if(current.equals("native"))
			access += Opcodes.ACC_NATIVE;
		else if(current.equals("interface"))
			access += Opcodes.ACC_INTERFACE;
		else if(current.equals("abstract"))
			access += Opcodes.ACC_ABSTRACT;
		else if(current.equals("strict"))
			access += Opcodes.ACC_STRICT;
		else if(current.equals("synthetic"))
			access += Opcodes.ACC_SYNTHETIC;
		else if(current.equals("annotation"))
			access += Opcodes.ACC_ANNOTATION;
		else if(current.equals("enum"))
			access += Opcodes.ACC_ENUM;
		else if(current.equals("mandated"))
			access += Opcodes.ACC_MANDATED;
		else
		{
			//Move back from our peek
			currentToken--;
			//System.out.println("Access: " + Integer.toHexString(access).toUpperCase());
			return access;
		}
	}
}
 
Example 5
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
@SuppressWarnings("unused")
private static String getAccessModifiers(int access){
	LinkedList<String> modifiers = new LinkedList<String>();
	if((Opcodes.ACC_ABSTRACT & access) == Opcodes.ACC_ABSTRACT){
		modifiers.add("abstract");
	}
	if((Opcodes.ACC_ANNOTATION & access) == Opcodes.ACC_ANNOTATION){
		modifiers.add("annotation");
	}
	if((Opcodes.ACC_BRIDGE & access) == Opcodes.ACC_BRIDGE){
		modifiers.add("bridge");
	}
	if((Opcodes.ACC_DEPRECATED & access) == Opcodes.ACC_DEPRECATED){
		modifiers.add("deprecated");
	}
	if((Opcodes.ACC_ENUM & access) == Opcodes.ACC_ENUM){
		modifiers.add("enum");
	}
	if((Opcodes.ACC_FINAL & access) == Opcodes.ACC_FINAL){
		modifiers.add("final");
	}
	if((Opcodes.ACC_INTERFACE & access) == Opcodes.ACC_INTERFACE){
		modifiers.add("interface");
	}
	if((Opcodes.ACC_MANDATED & access) == Opcodes.ACC_MANDATED){
		modifiers.add("mandated");
	}
	if((Opcodes.ACC_NATIVE & access) == Opcodes.ACC_NATIVE){
		modifiers.add("native");
	}
	if((Opcodes.ACC_PRIVATE & access) == Opcodes.ACC_PRIVATE){
		modifiers.add("private");
	}
	if((Opcodes.ACC_PROTECTED & access) == Opcodes.ACC_PROTECTED){
		modifiers.add("protected");
	}
	if((Opcodes.ACC_PUBLIC & access) == Opcodes.ACC_PUBLIC){
		modifiers.add("public");
	}
	if((Opcodes.ACC_STATIC & access) == Opcodes.ACC_STATIC){
		modifiers.add("static");
	}
	if((Opcodes.ACC_STRICT & access) == Opcodes.ACC_STRICT){
		modifiers.add("strict");
	}
	if((Opcodes.ACC_SUPER & access) == Opcodes.ACC_SUPER){
		modifiers.add("super");
	}
	if((Opcodes.ACC_SYNCHRONIZED & access) == Opcodes.ACC_SYNCHRONIZED){
		modifiers.add("synchronized");
	}
	if((Opcodes.ACC_SYNTHETIC & access) == Opcodes.ACC_SYNTHETIC){
		modifiers.add("synthetic");
	}
	if((Opcodes.ACC_TRANSIENT & access) == Opcodes.ACC_TRANSIENT){
		modifiers.add("transient");
	}
	if((Opcodes.ACC_VARARGS & access) == Opcodes.ACC_VARARGS){
		modifiers.add("varargs");
	}
	if((Opcodes.ACC_VOLATILE & access) == Opcodes.ACC_VOLATILE){
		modifiers.add("volatile");
	}
	return modifiers.toString();
}
 
Example 6
Source File: Textifier.java    From JReFrameworker with MIT License 4 votes vote down vote up
/**
 * Appends a string representation of the given access flags to {@link #stringBuilder}.
 *
 * @param accessFlags some access flags.
 */
private void appendAccess(final int accessFlags) {
  if ((accessFlags & Opcodes.ACC_PUBLIC) != 0) {
    stringBuilder.append("public ");
  }
  if ((accessFlags & Opcodes.ACC_PRIVATE) != 0) {
    stringBuilder.append("private ");
  }
  if ((accessFlags & Opcodes.ACC_PROTECTED) != 0) {
    stringBuilder.append("protected ");
  }
  if ((accessFlags & Opcodes.ACC_FINAL) != 0) {
    stringBuilder.append("final ");
  }
  if ((accessFlags & Opcodes.ACC_STATIC) != 0) {
    stringBuilder.append("static ");
  }
  if ((accessFlags & Opcodes.ACC_SYNCHRONIZED) != 0) {
    stringBuilder.append("synchronized ");
  }
  if ((accessFlags & Opcodes.ACC_VOLATILE) != 0) {
    stringBuilder.append("volatile ");
  }
  if ((accessFlags & Opcodes.ACC_TRANSIENT) != 0) {
    stringBuilder.append("transient ");
  }
  if ((accessFlags & Opcodes.ACC_ABSTRACT) != 0) {
    stringBuilder.append("abstract ");
  }
  if ((accessFlags & Opcodes.ACC_STRICT) != 0) {
    stringBuilder.append("strictfp ");
  }
  if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0) {
    stringBuilder.append("synthetic ");
  }
  if ((accessFlags & Opcodes.ACC_MANDATED) != 0) {
    stringBuilder.append("mandated ");
  }
  if ((accessFlags & Opcodes.ACC_ENUM) != 0) {
    stringBuilder.append("enum ");
  }
}
 
Example 7
Source File: Textifier.java    From JReFrameworker with MIT License 4 votes vote down vote up
/**
 * Appends a string representation of the given access flags to {@link #stringBuilder}.
 *
 * @param accessFlags some access flags.
 */
private void appendAccess(final int accessFlags) {
  if ((accessFlags & Opcodes.ACC_PUBLIC) != 0) {
    stringBuilder.append("public ");
  }
  if ((accessFlags & Opcodes.ACC_PRIVATE) != 0) {
    stringBuilder.append("private ");
  }
  if ((accessFlags & Opcodes.ACC_PROTECTED) != 0) {
    stringBuilder.append("protected ");
  }
  if ((accessFlags & Opcodes.ACC_FINAL) != 0) {
    stringBuilder.append("final ");
  }
  if ((accessFlags & Opcodes.ACC_STATIC) != 0) {
    stringBuilder.append("static ");
  }
  if ((accessFlags & Opcodes.ACC_SYNCHRONIZED) != 0) {
    stringBuilder.append("synchronized ");
  }
  if ((accessFlags & Opcodes.ACC_VOLATILE) != 0) {
    stringBuilder.append("volatile ");
  }
  if ((accessFlags & Opcodes.ACC_TRANSIENT) != 0) {
    stringBuilder.append("transient ");
  }
  if ((accessFlags & Opcodes.ACC_ABSTRACT) != 0) {
    stringBuilder.append("abstract ");
  }
  if ((accessFlags & Opcodes.ACC_STRICT) != 0) {
    stringBuilder.append("strictfp ");
  }
  if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0) {
    stringBuilder.append("synthetic ");
  }
  if ((accessFlags & Opcodes.ACC_MANDATED) != 0) {
    stringBuilder.append("mandated ");
  }
  if ((accessFlags & Opcodes.ACC_ENUM) != 0) {
    stringBuilder.append("enum ");
  }
}
 
Example 8
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
@SuppressWarnings("unused")
private static String getAccessModifiers(int access){
	LinkedList<String> modifiers = new LinkedList<String>();
	if((Opcodes.ACC_ABSTRACT & access) == Opcodes.ACC_ABSTRACT){
		modifiers.add("abstract");
	}
	if((Opcodes.ACC_ANNOTATION & access) == Opcodes.ACC_ANNOTATION){
		modifiers.add("annotation");
	}
	if((Opcodes.ACC_BRIDGE & access) == Opcodes.ACC_BRIDGE){
		modifiers.add("bridge");
	}
	if((Opcodes.ACC_DEPRECATED & access) == Opcodes.ACC_DEPRECATED){
		modifiers.add("deprecated");
	}
	if((Opcodes.ACC_ENUM & access) == Opcodes.ACC_ENUM){
		modifiers.add("enum");
	}
	if((Opcodes.ACC_FINAL & access) == Opcodes.ACC_FINAL){
		modifiers.add("final");
	}
	if((Opcodes.ACC_INTERFACE & access) == Opcodes.ACC_INTERFACE){
		modifiers.add("interface");
	}
	if((Opcodes.ACC_MANDATED & access) == Opcodes.ACC_MANDATED){
		modifiers.add("mandated");
	}
	if((Opcodes.ACC_NATIVE & access) == Opcodes.ACC_NATIVE){
		modifiers.add("native");
	}
	if((Opcodes.ACC_PRIVATE & access) == Opcodes.ACC_PRIVATE){
		modifiers.add("private");
	}
	if((Opcodes.ACC_PROTECTED & access) == Opcodes.ACC_PROTECTED){
		modifiers.add("protected");
	}
	if((Opcodes.ACC_PUBLIC & access) == Opcodes.ACC_PUBLIC){
		modifiers.add("public");
	}
	if((Opcodes.ACC_STATIC & access) == Opcodes.ACC_STATIC){
		modifiers.add("static");
	}
	if((Opcodes.ACC_STRICT & access) == Opcodes.ACC_STRICT){
		modifiers.add("strict");
	}
	if((Opcodes.ACC_SUPER & access) == Opcodes.ACC_SUPER){
		modifiers.add("super");
	}
	if((Opcodes.ACC_SYNCHRONIZED & access) == Opcodes.ACC_SYNCHRONIZED){
		modifiers.add("synchronized");
	}
	if((Opcodes.ACC_SYNTHETIC & access) == Opcodes.ACC_SYNTHETIC){
		modifiers.add("synthetic");
	}
	if((Opcodes.ACC_TRANSIENT & access) == Opcodes.ACC_TRANSIENT){
		modifiers.add("transient");
	}
	if((Opcodes.ACC_VARARGS & access) == Opcodes.ACC_VARARGS){
		modifiers.add("varargs");
	}
	if((Opcodes.ACC_VOLATILE & access) == Opcodes.ACC_VOLATILE){
		modifiers.add("volatile");
	}
	return modifiers.toString();
}