int annotationMemberValue(int pos) throws Exception { Annotation anno = currentAnno; pos = super.annotationMemberValue(pos); currentMember = new AnnotationMemberValue(currentAnno, pool); currentAnno = anno; return pos; }
@Override public void visitAnnotationMemberValue(AnnotationMemberValue node) { values.add(String.valueOf(node.getValue())); } }
Object getValue(ClassLoader cl, ClassPool cp, Method m) throws ClassNotFoundException { return AnnotationImpl.make(cl, getType(cl), cp, value); }
@Override public void visitAnnotationMemberValue(AnnotationMemberValue node) { array[index] = new AnnotationMemberValue(node.getValue(), constPool); } }
Class getType(ClassLoader cl) throws ClassNotFoundException { if (value == null) throw new ClassNotFoundException("no type specified"); else return loadClass(cl, value.getTypeName()); }
public Object visit(ASTAnnotation node, Object data) { try { CtClass annotation = pool.get(node.getIdentifier()); javassist.bytecode.annotation.Annotation info = new javassist.bytecode.annotation.Annotation(cp, annotation); AnnotationInfoCreator creator = new AnnotationInfoCreator(pool, cp, info); node.childrenAccept(creator, data); AnnotationMemberValue mv = (AnnotationMemberValue) data; mv.setValue(info); } catch (NotFoundException e) { throw new RuntimeException(e); //To change body of catch statement use Options | File Templates. } return null; }
@Override public void visitAnnotationMemberValue(AnnotationMemberValue node) { array[index] = new AnnotationMemberValue(node.getValue(), constPool); } }
@Override Class<?> getType(ClassLoader cl) throws ClassNotFoundException { if (value == null) throw new ClassNotFoundException("no type specified"); return loadClass(cl, value.getTypeName()); }
((AnnotationMemberValue) memberValue).setValue(annotation); } else { ((EnumMemberValue) memberValue).setValue((String) value);
@Override int annotationMemberValue(int pos) throws Exception { Annotation anno = currentAnno; pos = super.annotationMemberValue(pos); currentMember = new AnnotationMemberValue(currentAnno, pool); currentAnno = anno; return pos; }
for (MemberValue arrayMemberValue : arrayMember.getValue()) { AnnotationMemberValue member = (AnnotationMemberValue) arrayMemberValue; Annotation memberAnnot = member.getValue(); ArrayMemberValue annot = (ArrayMemberValue) memberAnnot.getMemberValue("templateTokens"); List<String> addedTemplates = new ArrayList<>();
@Override Object getValue(ClassLoader cl, ClassPool cp, Method m) throws ClassNotFoundException { return AnnotationImpl.make(cl, getType(cl), cp, value); }
Class getType(ClassLoader cl) throws ClassNotFoundException { if (value == null) throw new ClassNotFoundException("no type specified"); else return loadClass(cl, value.getTypeName()); }
/** * Prepare any {@link QueryHint} declarations * * @param constantPool * @param queryHints * @param hint */ protected void prepareQueryHints(ConstPool constantPool, List<AnnotationMemberValue> queryHints, QueryHint hint) { Annotation queryHint = new Annotation(QueryHint.class.getName(), constantPool); StringMemberValue hintName = new StringMemberValue(constantPool); hintName.setValue(hint.name()); queryHint.addMemberValue("name", hintName); StringMemberValue hintValue = new StringMemberValue(constantPool); hintValue.setValue(hint.value()); queryHint.addMemberValue("value", hintValue); AnnotationMemberValue hintAnnotation = new AnnotationMemberValue(queryHint, constantPool); queryHints.add(hintAnnotation); } }
@Override public void visitAnnotationMemberValue(AnnotationMemberValue node) { values.add(String.valueOf(node.getValue())); } }
Object getValue(ClassLoader cl, ClassPool cp, Method m) throws ClassNotFoundException { return AnnotationImpl.make(cl, getType(cl), cp, value); }
Class getType(ClassLoader cl) throws ClassNotFoundException { if (value == null) throw new ClassNotFoundException("no type specified"); else return loadClass(cl, value.getTypeName()); }
namedQuery.addMemberValue("hints", hintArray); AnnotationMemberValue queryAnnotation = new AnnotationMemberValue(namedQuery, constantPool); values.add(queryAnnotation);
@Override public void visitAnnotationMemberValue(AnnotationMemberValue node) { values.add(String.valueOf(node.getValue())); } }
Object getValue(ClassLoader cl, ClassPool cp, Method m) throws ClassNotFoundException { return AnnotationImpl.make(cl, getType(cl), cp, value); }