/** * Return the annotation of the given type, or null if none. */ public Annotation getAnnotation(String type) { Annotation anno; for (int i = 0; i < _annotations.size(); i++) { anno = (Annotation) _annotations.get(i); if (anno.getTypeName().equals(type)) return anno; } return null; }
/** * Return the annotation of the given type, or null if none. */ public Annotation getAnnotation(String type) { Annotation anno; for (int i = 0; i < _annotations.size(); i++) { anno = (Annotation) _annotations.get(i); if (anno.getTypeName().equals(type)) return anno; } return null; }
/** * Remove the given annotation. * * @return true if an annotation was removed, false otherwise */ public boolean removeAnnotation(Annotation anno) { return anno != null && removeAnnotation(anno.getTypeName()); }
/** * Remove the given annotation. * * @return true if an annotation was removed, false otherwise */ public boolean removeAnnotation(Annotation anno) { return anno != null && removeAnnotation(anno.getTypeName()); }
/** * Remove the annotation of the given type. * * @return true if an annotation was removed, false otherwise */ public boolean removeAnnotation(String type) { if (type == null) return false; Annotation anno; for (int i = 0; i < _annotations.size(); i++) { anno = (Annotation) _annotations.get(i); if (anno.getTypeName().equals(type)) { anno.invalidate(); _annotations.remove(i); return true; } } return false; }
/** * Remove the annotation of the given type. * * @return true if an annotation was removed, false otherwise */ public boolean removeAnnotation(String type) { if (type == null) return false; Annotation anno; for (int i = 0; i < _annotations.size(); i++) { anno = (Annotation) _annotations.get(i); if (anno.getTypeName().equals(type)) { anno.invalidate(); _annotations.remove(i); return true; } } return false; }
/** * The {@link Class} object for this annotation's type. */ public Class getType() { return Strings.toClass(getTypeName(), getClassLoader()); }
/** * The {@link Class} object for this annotation's type. */ public Class getType() { return Strings.toClass(getTypeName(), getClassLoader()); }
/** * The bytecode for the type of this annotation. */ public BCClass getTypeBC() { return getProject().loadClass(getTypeName(), getClassLoader()); }
/** * Import an annotation from another instance. * * @return the newly added annotation */ public Annotation addAnnotation(Annotation an) { Annotation anno = addAnnotation(an.getTypeName()); anno.setProperties(an.getProperties()); return anno; }
public void enterAnnotation(Annotation obj) { openBlock("Annotation"); println("type=" + obj.getTypeIndex() + " <" + obj.getTypeName() + ">"); }
/** * Import an annotation from another instance. * * @return the newly added annotation */ public Annotation addAnnotation(Annotation an) { Annotation anno = addAnnotation(an.getTypeName()); anno.setProperties(an.getProperties()); return anno; }
/** * The bytecode for the type of this annotation. */ public BCClass getTypeBC() { return getProject().loadClass(getTypeName(), getClassLoader()); }
public void enterAnnotation(Annotation obj) { openBlock("Annotation"); println("type=" + obj.getTypeIndex() + " <" + obj.getTypeName() + ">"); }
/** * Set the annotation value of this property by importing the given * annotation from another instance. */ private Annotation setValue(Value val, Annotation o) { Annotation anno = new Annotation(this); anno.setType(o.getTypeName()); anno.setProperties(o.getProperties()); val.index = -1; val.index2 = -1; val.value = anno; val.type = null; return anno; }
/** * Set the annotation value of this property by importing the given * annotation from another instance. */ private Annotation setValue(Value val, Annotation o) { Annotation anno = new Annotation(this); anno.setType(o.getTypeName()); anno.setProperties(o.getProperties()); val.index = -1; val.index2 = -1; val.value = anno; val.type = null; return anno; }