/** * Return the return type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodReturnBC() { String type = getMethodReturnName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodReturnBC() { String type = getMethodReturnName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodDeclarerBC() { String type = getMethodDeclarerName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public BCClass[] getMethodParamBCs() { String[] paramNames = getMethodParamNames(); BCClass[] params = new BCClass[paramNames.length]; for (int i = 0; i < paramNames.length; i++) params[i] = getProject().loadClass(paramNames[i], getClassLoader()); return params; }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodDeclarerBC() { String type = getMethodDeclarerName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public BCClass[] getMethodParamBCs() { String[] paramNames = getMethodParamNames(); BCClass[] params = new BCClass[paramNames.length]; for (int i = 0; i < paramNames.length; i++) params[i] = getProject().loadClass(paramNames[i], getClassLoader()); return params; }
/** * Return the method this instruction operates on, or null if not set. */ public BCMethod getMethod() { String dec = getMethodDeclarerName(); if (dec == null) return null; BCClass bc = getProject().loadClass(dec, getClassLoader()); BCMethod[] meths = bc.getMethods(getMethodName(),getMethodParamNames()); if (meths.length == 0) return null; return meths[0]; }
/** * Return the method this instruction operates on, or null if not set. */ public BCMethod getMethod() { String dec = getMethodDeclarerName(); if (dec == null) return null; BCClass bc = getProject().loadClass(dec, getClassLoader()); BCMethod[] meths = bc.getMethods(getMethodName(),getMethodParamNames()); if (meths.length == 0) return null; return meths[0]; }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public String getMethodDeclarerName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { // InvokeDynamic doesn't hvae a method declarer, but it does have a bootstrap index. InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = String.valueOf(ide.getBootstrapMethodAttrIndex()); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = getProject().getNameCache().getExternalForm (entry.getClassEntry().getNameEntry().getValue(), false); } if (name.length() == 0) return null; return name; }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public String getMethodDeclarerName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { // InvokeDynamic doesn't hvae a method declarer, but it does have a bootstrap index. InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = String.valueOf(ide.getBootstrapMethodAttrIndex()); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = getProject().getNameCache().getExternalForm (entry.getClassEntry().getNameEntry().getValue(), false); } if (name.length() == 0) return null; return name; }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public String getMethodReturnName() { if (_index == 0) return null; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry().getValue(); } NameCache cache = getProject().getNameCache(); String name = cache.getExternalForm(cache.getDescriptorReturnName(desc), false); if (name.length() == 0) return null; return name; }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public String getMethodReturnName() { if (_index == 0) return null; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry().getValue(); } NameCache cache = getProject().getNameCache(); String name = cache.getExternalForm(cache.getDescriptorReturnName(desc), false); if (name.length() == 0) return null; return name; }
NameCache cache = getProject().getNameCache(); returnType = cache.getInternalForm(returnType, true); dec = cache.getInternalForm(dec, false);
NameCache cache = getProject().getNameCache(); returnType = cache.getInternalForm(returnType, true); dec = cache.getInternalForm(dec, false);
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public String[] getMethodParamNames() { if (_index == 0) return new String[0]; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry(). getValue(); } NameCache cache = getProject().getNameCache(); String[] names = cache.getDescriptorParamNames(desc); for (int i = 0; i < names.length; i++) names[i] = cache.getExternalForm(names[i], false); return names; }
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public String[] getMethodParamNames() { if (_index == 0) return new String[0]; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry(). getValue(); } NameCache cache = getProject().getNameCache(); String[] names = cache.getDescriptorParamNames(desc); for (int i = 0; i < names.length; i++) names[i] = cache.getExternalForm(names[i], false); return names; }