/** * Load a class constant onto the stack. * For primitive types, this translates into a * getstatic for the TYPE field of the primitive's wrapper type. * For non-primitives, things get much more complex. Suffice it to * say that the operation involves adding synthetic static fields * and even methods to the class. Note that this instruction requires * up to 3 stack positions to execute. */ public ClassConstantInstruction classconstant() { return new ClassConstantInstruction(getMethod().getDeclarer(), this, nop()); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the class of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, Class type) { BCClass owner = getCode().getMethod().getDeclarer(); String typeName = (type == null) ? null : type.getName(); return setField(owner.getName(), name, typeName); }
/** * Load a class constant onto the stack. * For primitive types, this translates into a * getstatic for the TYPE field of the primitive's wrapper type. * For non-primitives, things get much more complex. Suffice it to * say that the operation involves adding synthetic static fields * and even methods to the class. Note that this instruction requires * up to 3 stack positions to execute. */ public ClassConstantInstruction classconstant() { return new ClassConstantInstruction(getMethod().getDeclarer(), this, nop()); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the class of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, Class type) { BCClass owner = getCode().getMethod().getDeclarer(); String typeName = (type == null) ? null : type.getName(); return setField(owner.getName(), name, typeName); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the class of the method return type * @param param the class of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, Class returnType, Class[] params) { BCClass owner = getCode().getMethod().getDeclarer(); String returnName = (returnType == null) ? null : returnType.getName(); String[] paramNames = null; if (params != null) { paramNames = new String[params.length]; for (int i = 0; i < params.length; i++) paramNames[i] = params[i].getName(); } return setMethod(owner.getName(), name, returnName, paramNames, false); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the class of the method return type * @param param the class of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, Class returnType, Class[] params) { BCClass owner = getCode().getMethod().getDeclarer(); String returnName = (returnType == null) ? null : returnType.getName(); String[] paramNames = null; if (params != null) { paramNames = new String[params.length]; for (int i = 0; i < params.length; i++) paramNames[i] = params[i].getName(); } return setMethod(owner.getName(), name, returnName, paramNames, false); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the full class name of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, String type) { BCClass owner = getCode().getMethod().getDeclarer(); return setField(owner.getName(), name, type); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the full class name of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, String type) { BCClass owner = getCode().getMethod().getDeclarer(); return setField(owner.getName(), name, type); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the full class name of the method return type * @param param the full class names of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, String returnType, String[] params) { BCClass owner = getCode().getMethod().getDeclarer(); return setMethod(owner.getName(), name, returnType, params); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the full class name of the method return type * @param param the full class names of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, String returnType, String[] params) { BCClass owner = getCode().getMethod().getDeclarer(); return setMethod(owner.getName(), name, returnType, params); }
/** * When adding class entries, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getCode().getMethod().getDeclarer(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } } }
/** * When adding class entries, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getCode().getMethod().getDeclarer(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } } }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the class of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, BCClass type) { BCClass owner = getCode().getMethod().getDeclarer(); String typeName = (type == null) ? null : type.getName(); return setField(owner.getName(), name, typeName); }
/** * Set the field this instruction operates on, for fields that are * declared by the current class. * * @param name the field name * @param type the class of the field type * @return this instruction, for method chaining */ public FieldInstruction setField(String name, BCClass type) { BCClass owner = getCode().getMethod().getDeclarer(); String typeName = (type == null) ? null : type.getName(); return setField(owner.getName(), name, typeName); }
/** * Set the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethod(BCMethod method) { if (method == null) return setMethodIndex(0); return setMethod(method.getDeclarer().getName(), method.getName(), method.getReturnName(), method.getParamNames(), false); }
/** * Set the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethod(BCMethod method) { if (method == null) return setMethodIndex(0); return setMethod(method.getDeclarer().getName(), method.getName(), method.getReturnName(), method.getParamNames(), false); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the class of the method return type * @param param the class of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, BCClass returnType, BCClass[] params) { BCClass owner = getCode().getMethod().getDeclarer(); String returnName = (returnType == null) ? null : returnType.getName(); String[] paramNames = null; if (params != null) { paramNames = new String[params.length]; for (int i = 0; i < params.length; i++) paramNames[i] = params[i].getName(); } return setMethod(owner.getName(), name, returnName, paramNames, false); }
/** * Set the method this instruction operates on, for methods that are * declared by the current class. * * @param name the method name * @param returnType the class of the method return type * @param param the class of the method param types * @return this instruction, for method chaining */ public MethodInstruction setMethod(String name, BCClass returnType, BCClass[] params) { BCClass owner = getCode().getMethod().getDeclarer(); String returnName = (returnType == null) ? null : returnType.getName(); String[] paramNames = null; if (params != null) { paramNames = new String[params.length]; for (int i = 0; i < params.length; i++) paramNames[i] = params[i].getName(); } return setMethod(owner.getName(), name, returnName, paramNames, false); }
if (getCreateSubclass() && code.getMethod().getDeclarer() == _pc && (field == null || !field.isPublic())) {
if (getCreateSubclass() && code.getMethod().getDeclarer() == _pc && (field == null || !field.isPublic())) {