/** * Remove the annotation of the given type. * * @return true if an annotation was removed, false otherwise */ public boolean removeAnnotation(BCClass type) { return type != null && removeAnnotation(type.getName()); }
/** * Set the declaring type of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodDeclarer(BCClass type) { String name = null; if (type != null) name = type.getName(); return setMethodDeclarer(name); }
/** * Change a parameter type of this method. * * @see java.util.List#set(int,Object) */ public void setParam(int pos, BCClass type) { setParam(pos, type.getName()); }
/** * Return true if this class or any of its superclasses implement/extend * the given interface/class. * This method does not recurse into interfaces-of-interfaces. */ public boolean isInstanceOf(BCClass type) { if (type == null) return false; return isInstanceOf(type.getName()); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, BCClass type) { String typeName = (type == null) ? null : type.getName(); return addLocalVariable(name, typeName); }
/** * Set the class value of this property. */ public void setValue(BCClass value) { setClassNameValue(value.getName()); }
/** * Set this property value to a new annotation of the given type, * returning the annotation for manipulation. */ public Annotation newAnnotationValue(BCClass type) { return newAnnotationValue(type.getName()); }
/** * Set the return type of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodReturn(BCClass type) { String name = null; if (type != null) name = type.getName(); return setMethodReturn(name); }
/** * Remove an interface declared by this class. * * @return true if the class had the interface, false otherwise */ public boolean removeDeclaredInterface(BCClass type) { if (type == null) return false; return removeDeclaredInterface(type.getName()); }
/** * Add a field to this class. * * @return the added field */ public BCField declareField(String name, BCClass type) { String typeName = (type == null) ? null : type.getName(); return declareField(name, typeName); }
/** * Return the name of the class only, without package. */ public String getClassName() { String name = _project.getNameCache().getExternalForm(getName(), true); return name.substring(name.lastIndexOf('.') + 1); }
/** * Return the name of the class only, without package. */ public String getClassName() { String name = _project.getNameCache().getExternalForm(getName(), true); return name.substring(name.lastIndexOf('.') + 1); }
/** * Set the type of this instruction. Types that have no direct * support will be converted accordingly. * * @return this instruction, for method chaining */ public TypedInstruction setType(BCClass type) { if (type == null) return setType((String) null); return setType(type.getName()); } }
/** * Set the type of this local. */ public void setType(BCClass type) { if (type == null) setType((String) null); else setType(type.getName()); }
/** * Set the superclass of this class. */ public void setSuperclass(BCClass type) { if (type == null) setSuperclass((String) null); else setSuperclass(type.getName()); }
/** * Remove the exception handler that catches the given type. * * @return true if the handler was removed, false otherwise */ public boolean removeExceptionHandler(BCClass catchType) { if (catchType == null) return removeExceptionHandler((String) null); return removeExceptionHandler(catchType.getName()); }
/** * Set the type being converted from. Types that have no direct * support will be converted accordingly. * * @return this instruction, for method chaining */ public ConvertInstruction setFromType(BCClass type) { if (type == null) return setFromType((String) null); return setFromType(type.getName()); }
/** * Set the class of the exception type, or null for catch-all clauses used * for finally blocks. */ public void setCatch(BCClass type) { if (type == null) setCatch((String) null); else setCatch(type.getName()); }
/** * Set the value of this constant. * * @return this instruction, for method chaining */ public ConstantInstruction setValue(BCClass value) { if (value == null) return setNull(); calculateOpcode(value.getName(), true, false); return this; }
/** * 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); }