use of org.simpleflatmapper.ow2asm.FieldVisitor in project SimpleFlatMapper by arnaudroger.
the class MapperAsmBuilder method declareMapperFields.
private static <S, T> void declareMapperFields(ClassWriter cw, FieldMapper<S, T> mapper, int index) {
if (mapper == null)
return;
FieldVisitor fv;
Type mapperClass = AsmUtils.findClosestPublicTypeExposing(mapper.getClass(), FieldMapper.class);
fv = cw.visitField(ACC_PRIVATE + ACC_FINAL, "fieldMapper" + index, toTargetTypeDeclaration(AsmUtils.toAsmType(mapperClass)), toTargetTypeDeclaration(AsmUtils.toGenericAsmType(mapperClass)), null);
fv.visitEnd();
}
use of org.simpleflatmapper.ow2asm.FieldVisitor in project SimpleFlatMapper by arnaudroger.
the class InstantiatorBuilder method appendGetters.
private static <S> void appendGetters(Map<Parameter, Getter<? super S, ?>> injections, ClassWriter cw) {
FieldVisitor fv;
for (Entry<Parameter, Getter<? super S, ?>> entry : injections.entrySet()) {
GetterCall getterCall = getGetterCall(entry.getKey().getType(), entry.getValue().getClass());
fv = cw.visitField(ACC_FINAL, "getter_" + entry.getKey().getName(), AsmUtils.toTargetTypeDeclaration(getterCall.getterType), null, null);
fv.visitEnd();
}
}
Aggregations