示例#1
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="StaticInitMerger" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="prefix">
 ///     the prefix to use to rename the existing &lt;clinit&gt; methods.
 /// </param>
 /// <param name="classVisitor">
 ///     the class visitor to which this visitor must delegate method calls. May be
 ///     null.
 /// </param>
 protected internal StaticInitMerger(VisitorAsmApiVersion api, string prefix, ClassVisitor classVisitor
                                     )
     : base(api, classVisitor)
 {
     /* latest api = */
     renamedClinitMethodPrefix = prefix;
 }
示例#2
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="RecordComponentRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be
 ///     <see cref="Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 /// <param name="recordComponentVisitor">
 ///     the record component visitor this remapper must delegate to.
 /// </param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited record component.
 /// </param>
 protected internal RecordComponentRemapper(VisitorAsmApiVersion api, RecordComponentVisitor recordComponentVisitor
                                            , Remapper remapper)
     : base(api, recordComponentVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#3
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="MethodRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="methodVisitor">the method visitor this remapper must deleted to.</param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited method.
 /// </param>
 protected internal MethodRemapper(VisitorAsmApiVersion api, MethodVisitor methodVisitor, Remapper
     remapper)
     : base(api, methodVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#4
0
 // Nothing to do.
 // -----------------------------------------------------------------------------------------------
 // Accept methods
 // -----------------------------------------------------------------------------------------------
 /// <summary>
 ///     Checks that this record component node is compatible with the given ASM API version.
 /// </summary>
 /// <remarks>
 ///     Checks that this record component node is compatible with the given ASM API version. This
 ///     method checks that this node, and all its children recursively, do not contain elements that
 ///     were introduced in more recent versions of the ASM API than the given version.
 /// </remarks>
 /// <param name="api">
 ///     an ASM API version. Must be
 ///     <see cref="Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 // [Obsolete(@"this API is experimental.")]
 public virtual void CheckExperimental(VisitorAsmApiVersion api)
 {
     if (api != VisitorAsmApiVersion.Asm8Experimental)
     {
         throw new UnsupportedClassVersionException();
     }
 }
示例#5
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="AnnotationNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="typeRef">
 ///     a reference to the annotated type. See
 ///     <see cref="Org.Objectweb.Asm.TypeReference" />
 ///     .
 /// </param>
 /// <param name="typePath">
 ///     the path to the annotated type argument, wildcard bound, array element type, or
 ///     static inner type within 'typeRef'. May be
 ///     <literal>null</literal>
 ///     if the annotation targets
 ///     'typeRef' as a whole.
 /// </param>
 /// <param name="descriptor">the class descriptor of the annotation class.</param>
 public TypeAnnotationNode(VisitorAsmApiVersion api, int typeRef, TypePath typePath, string descriptor
                           )
     : base(api, descriptor)
 {
     this.typeRef  = typeRef;
     this.typePath = typePath;
 }
示例#6
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="ClassRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Opcodes.Asm6" />
 ///     or
 ///     <see cref="Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="classVisitor">the class visitor this remapper must deleted to.</param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited class.
 /// </param>
 protected internal ClassRemapper(VisitorAsmApiVersion api, ClassVisitor classVisitor, Remapper remapper
                                  )
     : base(api, classVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#7
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="FieldRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="fieldVisitor">the field visitor this remapper must deleted to.</param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited field.
 /// </param>
 protected internal FieldRemapper(VisitorAsmApiVersion api, FieldVisitor fieldVisitor, Remapper remapper
                                  )
     : base(api, fieldVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#8
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="ModuleRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     or
 ///     <see cref="Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="moduleVisitor">the module visitor this remapper must deleted to.</param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited module.
 /// </param>
 protected internal ModuleRemapper(VisitorAsmApiVersion api, ModuleVisitor moduleVisitor, Remapper
                                   remapper)
     : base(api, moduleVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#9
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="AnnotationRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     or
 ///     <see cref="Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="annotationVisitor">
 ///     the annotation visitor this remapper must deleted to.
 /// </param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited annotation.
 /// </param>
 protected internal AnnotationRemapper(VisitorAsmApiVersion api, AnnotationVisitor annotationVisitor
                                       , Remapper remapper)
     : base(api, annotationVisitor)
 {
     /* latest api = */
     this.remapper = remapper;
 }
示例#10
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="ClassNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 public ClassNode(VisitorAsmApiVersion api)
     : base(api)
 {
     interfaces   = new List <string>();
     innerClasses = new List <InnerClassNode>();
     fields       = new List <FieldNode>();
     methods      = new List <MethodNode>();
 }
示例#11
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="AdviceAdapter" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Opcodes.Asm6" />
 ///     or
 ///     <see cref="Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="methodVisitor">
 ///     the method visitor to which this adapter delegates calls.
 /// </param>
 /// <param name="access">
 ///     the method's access flags (see
 ///     <see cref="Opcodes" />
 ///     ).
 /// </param>
 /// <param name="name">the method's name.</param>
 /// <param name="descriptor">
 ///     the method's descriptor (see
 ///     <see cref="Org.Objectweb.Asm.Type">Type</see>
 ///     ).
 /// </param>
 protected internal AdviceAdapter(VisitorAsmApiVersion api, MethodVisitor methodVisitor, AccessFlags access
                                  , string name, string descriptor)
     : base(api, methodVisitor, access, name, descriptor)
 {
     methodAccess  = access;
     methodDesc    = descriptor;
     isConstructor = "<init>".Equals(name);
 }
示例#12
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="SignatureRemapper" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this remapper. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     .
 /// </param>
 /// <param name="signatureVisitor">
 ///     the signature visitor this remapper must deleted to.
 /// </param>
 /// <param name="remapper">
 ///     the remapper to use to remap the types in the visited signature.
 /// </param>
 protected internal SignatureRemapper(VisitorAsmApiVersion api, SignatureVisitor signatureVisitor,
                                      Remapper remapper)
     : base(api)
 {
     /* latest api = */
     this.signatureVisitor = signatureVisitor;
     this.remapper         = remapper;
 }
示例#13
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="SignatureVisitor" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 public SignatureVisitor(VisitorAsmApiVersion api)
 {
     if (api != VisitorAsmApiVersion.Asm7 && api != VisitorAsmApiVersion.Asm6 && api != VisitorAsmApiVersion
         .Asm5 && api != VisitorAsmApiVersion.Asm4 && api != VisitorAsmApiVersion.Asm8Experimental)
     {
         throw new ArgumentException("Unsupported api " + api);
     }
     this.api = api;
 }
示例#14
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="SimpleVerifier" />
 ///     to verify a specific class. This class will not be
 ///     loaded into the JVM since it may be incorrect.
 /// </summary>
 /// <param name="api">
 ///     the ASM API version supported by this verifier. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="currentClass">the type of the class to be verified.</param>
 /// <param name="currentSuperClass">
 ///     the type of the super class of the class to be verified.
 /// </param>
 /// <param name="currentClassInterfaces">
 ///     the types of the interfaces directly implemented by the class to
 ///     be verified.
 /// </param>
 /// <param name="isInterface">whether the class to be verifier is an interface.</param>
 protected internal SimpleVerifier(VisitorAsmApiVersion api, Type currentClass, Type currentSuperClass
                                   , IList <Type> currentClassInterfaces, bool isInterface)
     : base(api)
 {
     this.currentClass           = currentClass;
     this.currentSuperClass      = currentSuperClass;
     this.currentClassInterfaces = currentClassInterfaces;
     isInterface__ = isInterface;
 }
示例#15
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="RecordComponentNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be
 ///     <see cref="Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 /// <param name="access">
 ///     the record component access flags (see
 ///     <see cref="Opcodes" />
 ///     ). The
 ///     only valid value is
 ///     <see cref="Opcodes.Acc_Deprecated" />
 ///     .
 /// </param>
 /// <param name="name">the record component name.</param>
 /// <param name="descriptor">
 ///     the record component descriptor (see
 ///     <see cref="Org.Objectweb.Asm.Type" />
 ///     ).
 /// </param>
 /// <param name="signature">the record component signature.</param>
 // [Obsolete(@"this API is experimental.")]
 public RecordComponentNode(VisitorAsmApiVersion api, AccessFlags access, string name, string descriptor, string
                            signature)
     : base(api)
 {
     accessExperimental     = access;
     nameExperimental       = name;
     descriptorExperimental = descriptor;
     signatureExperimental  = signature;
 }
示例#16
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="LocalVariableAnnotationNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="typeRef">
 ///     a reference to the annotated type. See
 ///     <see cref="Org.Objectweb.Asm.TypeReference" />
 ///     .
 /// </param>
 /// <param name="start">
 ///     the fist instructions corresponding to the continuous ranges that make the scope
 ///     of this local variable (inclusive).
 /// </param>
 /// <param name="end">
 ///     the last instructions corresponding to the continuous ranges that make the scope of
 ///     this local variable (exclusive). This array must have the same size as the 'start' array.
 /// </param>
 /// <param name="index">
 ///     the local variable's index in each range. This array must have the same size as
 ///     the 'start' array.
 /// </param>
 /// <param name="typePath">
 ///     the path to the annotated type argument, wildcard bound, array element type, or
 ///     static inner type within 'typeRef'. May be
 ///     <literal>null</literal>
 ///     if the annotation targets
 ///     'typeRef' as a whole.
 /// </param>
 /// <param name="descriptor">the class descriptor of the annotation class.</param>
 public LocalVariableAnnotationNode(VisitorAsmApiVersion api, int typeRef, TypePath typePath, LabelNode
                                    [] start, LabelNode[] end, int[] index, string descriptor)
     : base(api, typeRef, typePath, descriptor)
 {
     /* latest api = */
     this.start = Util.AsArrayList(start);
     this.end   = Util.AsArrayList(end);
     this.index = Util.AsArrayList(index);
 }
示例#17
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="CheckSignatureAdapter" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="type">
 ///     the type of signature to be checked. See
 ///     <see cref="Class_Signature" />
 ///     ,
 ///     <see cref="Method_Signature" />
 ///     and
 ///     <see cref="Type_Signature" />
 ///     .
 /// </param>
 /// <param name="signatureVisitor">
 ///     the visitor to which this adapter must delegate calls. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 protected internal CheckSignatureAdapter(VisitorAsmApiVersion api, int type, SignatureVisitor signatureVisitor
                                          )
     : base(api)
 {
     /* latest api = */
     this.type             = type;
     state                 = State.Empty;
     this.signatureVisitor = signatureVisitor;
 }
示例#18
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="FieldNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     or
 ///     <see cref="Opcodes.Asm5" />
 ///     .
 /// </param>
 /// <param name="access">
 ///     the field's access flags (see
 ///     <see cref="Opcodes" />
 ///     ). This parameter
 ///     also indicates if the field is synthetic and/or deprecated.
 /// </param>
 /// <param name="name">the field's name.</param>
 /// <param name="descriptor">
 ///     the field's descriptor (see
 ///     <see cref="Org.Objectweb.Asm.Type" />
 ///     ).
 /// </param>
 /// <param name="signature">the field's signature.</param>
 /// <param name="value">
 ///     the field's initial value. This parameter, which may be
 ///     <literal>null</literal>
 ///     if the
 ///     field does not have an initial value, must be an
 ///     <see cref="int" />
 ///     , a
 ///     <see cref="float" />
 ///     , a
 ///     <see cref="long" />
 ///     , a
 ///     <see cref="double" />
 ///     or a
 ///     <see cref="string" />
 ///     .
 /// </param>
 public FieldNode(VisitorAsmApiVersion api, AccessFlags access, string name, string descriptor, string signature
                  , object value)
     : base(api)
 {
     this.access    = access;
     this.name      = name;
     desc           = descriptor;
     this.signature = signature;
     this.value     = value;
 }
示例#19
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="LocalVariablesSorter" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="access">access flags of the adapted method.</param>
 /// <param name="descriptor">
 ///     the method's descriptor (see
 ///     <see cref="Org.Objectweb.Asm.Type" />
 ///     ).
 /// </param>
 /// <param name="methodVisitor">
 ///     the method visitor to which this adapter delegates calls.
 /// </param>
 protected internal LocalVariablesSorter(VisitorAsmApiVersion api, AccessFlags access, string descriptor, MethodVisitor
                                         methodVisitor)
     : base(api, methodVisitor)
 {
     nextLocal = (AccessFlags.Static & access) == 0 ? 1 : 0;
     foreach (var argumentType in Type.GetArgumentTypes(descriptor))
     {
         nextLocal += argumentType.GetSize();
     }
     firstLocal = nextLocal;
 }
示例#20
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="ClassVisitor" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Opcodes.Asm6" />
 ///     or
 ///     <see cref="Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="classVisitor">
 ///     the class visitor to which this visitor must delegate method calls. May be
 ///     null.
 /// </param>
 public ClassVisitor(VisitorAsmApiVersion api, ClassVisitor classVisitor)
 {
     if (api != VisitorAsmApiVersion.Asm7 && api != VisitorAsmApiVersion.Asm6 && api != VisitorAsmApiVersion
         .Asm5 && api != VisitorAsmApiVersion.Asm4 && api != VisitorAsmApiVersion.Asm8Experimental)
     {
         throw new ArgumentException("Unsupported api " + api);
     }
     if (api == VisitorAsmApiVersion.Asm8Experimental)
     {
         Constants.CheckAsm8Experimental(this);
     }
     this.api = api;
     cv       = classVisitor;
 }
示例#21
0
 // Nothing to do.
 // -----------------------------------------------------------------------------------------------
 // Accept methods
 // -----------------------------------------------------------------------------------------------
 /// <summary>
 ///     Checks that this field node is compatible with the given ASM API version.
 /// </summary>
 /// <remarks>
 ///     Checks that this field node is compatible with the given ASM API version. This method checks
 ///     that this node, and all its children recursively, do not contain elements that were introduced
 ///     in more recent versions of the ASM API than the given version.
 /// </remarks>
 /// <param name="api">
 ///     an ASM API version. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Opcodes.Asm6" />
 ///     or
 ///     <see cref="Opcodes.Asm7" />
 ///     .
 /// </param>
 public virtual void Check(VisitorAsmApiVersion api)
 {
     if (api == VisitorAsmApiVersion.Asm4)
     {
         if (visibleTypeAnnotations != null && !(visibleTypeAnnotations.Count == 0))
         {
             throw new UnsupportedClassVersionException();
         }
         if (invisibleTypeAnnotations != null && !(invisibleTypeAnnotations.Count == 0))
         {
             throw new UnsupportedClassVersionException();
         }
     }
 }
示例#22
0
 /// <summary>
 ///     Constructs a
 ///     <see cref="ModuleNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="name">the fully qualified name (using dots) of the module.</param>
 /// <param name="access">
 ///     the module access flags, among
 ///     <c>ACC_OPEN</c>
 ///     ,
 ///     <c>ACC_SYNTHETIC</c>
 ///     and
 ///     <c>ACC_MANDATED</c>
 ///     .
 /// </param>
 /// <param name="version">
 ///     the module version, or
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="requires">
 ///     The dependencies of this module. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="exports">
 ///     The packages exported by this module. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="opens">
 ///     The packages opened by this module. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="uses">
 ///     The internal names of the services used by this module. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="provides">
 ///     The services provided by this module. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 public ModuleNode(VisitorAsmApiVersion api, string name, AccessFlags access, string version, IList <ModuleRequireNode
                                                                                                     > requires, IList <ModuleExportNode> exports, IList <ModuleOpenNode> opens, IList <
                       string> uses, IList <ModuleProvideNode> provides)
     : base(api)
 {
     // TODO(forax): why is there no 'mainClass' and 'packages' parameters in this constructor?
     this.name     = name;
     this.access   = access;
     this.version  = version;
     this.requires = requires;
     this.exports  = exports;
     this.opens    = opens;
     this.uses     = uses;
     this.provides = provides;
 }
示例#23
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="RecordComponentVisitor" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be
 ///     <see cref="Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 /// <param name="recordComponentVisitor">
 ///     the record component visitor to which this visitor must delegate
 ///     method calls. May be null.
 /// </param>
 //  [Obsolete(@"this API is experimental.")]
 public RecordComponentVisitor(VisitorAsmApiVersion api, RecordComponentVisitor recordComponentVisitor
                               )
 {
     /*package-private*/
     if (api != VisitorAsmApiVersion.Asm7 && api != VisitorAsmApiVersion.Asm6 && api != VisitorAsmApiVersion
         .Asm5 && api != VisitorAsmApiVersion.Asm4 && api != VisitorAsmApiVersion.Asm8Experimental)
     {
         throw new ArgumentException("Unsupported api " + api);
     }
     if (api == VisitorAsmApiVersion.Asm8Experimental)
     {
         Constants.CheckAsm8Experimental(this);
     }
     this.api  = api;
     delegate_ = recordComponentVisitor;
 }
示例#24
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="MethodNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="access">
 ///     the method's access flags (see
 ///     <see cref="Org.Objectweb.Asm.Opcodes" />
 ///     ). This parameter also indicates if
 ///     the method is synthetic and/or deprecated.
 /// </param>
 /// <param name="name">the method's name.</param>
 /// <param name="descriptor">
 ///     the method's descriptor (see
 ///     <see cref="Org.Objectweb.Asm.Type" />
 ///     ).
 /// </param>
 /// <param name="signature">
 ///     the method's signature. May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 /// <param name="exceptions">
 ///     the internal names of the method's exception classes (see
 ///     <see cref="Org.Objectweb.Asm.Type.GetInternalName()" />
 ///     ). May be
 ///     <literal>null</literal>
 ///     .
 /// </param>
 public MethodNode(VisitorAsmApiVersion api, AccessFlags access, string name, string descriptor, string signature
                   , string[] exceptions)
     : base(api)
 {
     this.access     = access;
     this.name       = name;
     desc            = descriptor;
     this.signature  = signature;
     this.exceptions = Util.AsArrayList(exceptions);
     if (access.HasNotFlagFast(AccessFlags.Abstract))
     {
         localVariables = new List <LocalVariableNode>(5);
     }
     tryCatchBlocks = new List <TryCatchBlockNode>();
     instructions   = new InsnList();
 }
示例#25
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="RecordComponentVisitor" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be
 ///     <see cref="Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 //  [Obsolete(@"this API is experimental.")]
 public RecordComponentVisitor(VisitorAsmApiVersion api)
     : this(api, null)
 {
 }
示例#26
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="CheckRecordComponentAdapter" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm8_Experimental" />
 ///     .
 /// </param>
 /// <param name="recordComponentVisitor">
 ///     the record component visitor to which this adapter must delegate
 ///     calls.
 /// </param>
 protected internal CheckRecordComponentAdapter(VisitorAsmApiVersion api, RecordComponentVisitor recordComponentVisitor
                                                )
     : base(api, recordComponentVisitor)
 {
 }
示例#27
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="CheckFieldAdapter" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="fieldVisitor">
 ///     the field visitor to which this adapter must delegate calls.
 /// </param>
 protected internal CheckFieldAdapter(VisitorAsmApiVersion api, FieldVisitor fieldVisitor)
     : base(api, fieldVisitor)
 {
 }
示例#28
0
 // Nothing to do.
 // ------------------------------------------------------------------------
 // Accept methods
 // ------------------------------------------------------------------------
 /// <summary>
 ///     Checks that this annotation node is compatible with the given ASM API version.
 /// </summary>
 /// <remarks>
 ///     Checks that this annotation node is compatible with the given ASM API version. This method
 ///     checks that this node, and all its children recursively, do not contain elements that were
 ///     introduced in more recent versions of the ASM API than the given version.
 /// </remarks>
 /// <param name="api">
 ///     an ASM API version. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 public virtual void Check(VisitorAsmApiVersion api)
 {
 }
示例#29
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="AnnotationNode" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm6" />
 ///     or
 ///     <see cref="Org.Objectweb.Asm.Opcodes.Asm7" />
 ///     .
 /// </param>
 /// <param name="descriptor">the class descriptor of the annotation class.</param>
 public AnnotationNode(VisitorAsmApiVersion api, string descriptor)
     : base(api)
 {
     desc = descriptor;
 }
示例#30
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="ClassVisitor" />
 ///     .
 /// </summary>
 /// <param name="api">
 ///     the ASM API version implemented by this visitor. Must be one of
 ///     <see cref="Opcodes.Asm4" />
 ///     ,
 ///     <see cref="Opcodes.Asm5" />
 ///     ,
 ///     <see cref="Opcodes.Asm6" />
 ///     or
 ///     <see cref="Opcodes.Asm7" />
 ///     .
 /// </param>
 public ClassVisitor(VisitorAsmApiVersion api)
     : this(api, null)
 {
 }