Esempio n. 1
0
 public override AnnotationVisitor VisitAnnotation(string descriptor, bool visible
                                                   )
 {
     CheckVisitEndNotCalled();
     // Annotations can only appear in V1_5 or more classes.
     CheckMethodAdapter.CheckDescriptor(OpcodesConstants.V1_5, descriptor, false);
     return(new CheckAnnotationAdapter(base.VisitAnnotation(descriptor, visible)));
 }
Esempio n. 2
0
 public override void VisitEnum(string name, string descriptor, string value)
 {
     CheckVisitEndNotCalled();
     CheckName(name);
     // Annotations can only appear in V1_5 or more classes.
     CheckMethodAdapter.CheckDescriptor(OpcodesConstants.V1_5, descriptor, false);
     if (value == null)
     {
         throw new ArgumentException("Invalid enum value");
     }
     base.VisitEnum(name, descriptor, value);
 }
Esempio n. 3
0
        public override AnnotationVisitor VisitTypeAnnotation(int typeRef, TypePath typePath
                                                              , string descriptor, bool visible)
        {
            CheckVisitEndNotCalled();
            var sort = new TypeReference(typeRef).GetSort();

            if (sort != TypeReference.Field)
            {
                throw new ArgumentException("Invalid type reference sort 0x" + sort.ToString("x8"));
            }
            CheckClassAdapter.CheckTypeRef(typeRef);
            CheckMethodAdapter.CheckDescriptor(OpcodesConstants.V1_5, descriptor, false);
            return(new CheckAnnotationAdapter(base.VisitTypeAnnotation(typeRef, typePath, descriptor
                                                                       , visible)));
        }