@Override public AnnotationVisitor visitTypeAnnotation(int typeRef, @Nullable TypePath typePath, String descriptor, boolean visible) { if (typePath == null) { return visitAnnotation(descriptor, visible); } // Corner case, limitation: the case when annotation is not set on a field but on a type parameter of this field is not // yet supported. In this case "typePath" is not null. e.g.: List<@Annotation C> field return null; }
@Override public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (isNotSynthetic(flags)) { //Flags from asm lib are defined in Opcodes class and map to flags defined in Flags class int filteredFlags = Flags.filterAccessBytecodeFlags(flags); JavaType type = convertAsmType(Type.getType(desc)); JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(filteredFlags, name, type, classSymbol, value); classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } // checks for annotations on the field return new BytecodeFieldVisitor(symbol, this); } return null; }
@Override public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (!BytecodeCompleter.isSynthetic(flags)) { //Flags from asm lib are defined in Opcodes class and map to flags defined in Flags class final JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(bytecodeCompleter.filterBytecodeFlags(flags), name, convertAsmType(org.objectweb.asm.Type.getType(desc)), classSymbol); classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } // checks for annotations on the field return new BytecodeFieldVisitor(symbol, this); } return null; }
@Override public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (!BytecodeCompleter.isSynthetic(flags)) { //Flags from asm lib are defined in Opcodes class and map to flags defined in Flags class final JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(bytecodeCompleter.filterBytecodeFlags(flags), name, convertAsmType(org.objectweb.asm.Type.getType(desc)), classSymbol); classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } // checks for annotations on the field return new BytecodeFieldVisitor(symbol, this); } return null; }
@Override public AnnotationVisitor visitTypeAnnotation(int typeRef, @Nullable TypePath typePath, String descriptor, boolean visible) { if (typePath == null) { return visitAnnotation(descriptor, visible); } // Corner case, limitation: the case when annotation is not set on a field but on a type parameter of this field is not // yet supported. In this case "typePath" is not null. e.g.: List<@Annotation C> field return null; }
@Override public FieldVisitor visitField(int flags, String name, String desc, @Nullable String signature, @Nullable Object value) { Preconditions.checkNotNull(name); Preconditions.checkNotNull(desc); if (isNotSynthetic(flags)) { //Flags from asm lib are defined in Opcodes class and map to flags defined in Flags class int filteredFlags = Flags.filterAccessBytecodeFlags(flags); JavaType type = convertAsmType(Type.getType(desc)); JavaSymbol.VariableJavaSymbol symbol = new JavaSymbol.VariableJavaSymbol(filteredFlags, name, type, classSymbol, value); classSymbol.members.enter(symbol); if (signature != null) { ReadType typeReader = new ReadType(); new SignatureReader(signature).accept(typeReader); symbol.type = typeReader.typeRead; } // checks for annotations on the field return new BytecodeFieldVisitor(symbol, this); } return null; }