コード例 #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 private XSyntheticFieldDefinition(XTypeDefinition declaringType, XSyntheticFieldFlags flags, string name, XTypeReference fieldType, object initialValue)
     : base(declaringType)
 {
     this.flags = flags;
     this.name = name;
     this.fieldType = fieldType;
     this.initialValue = initialValue;
 }
コード例 #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public JavaFieldReference(string name, XTypeReference fieldType, XTypeReference declaringType, string javaName, string javaDescriptor, string javaClassName)
     : base(declaringType)
 {
     this.name = name;
     this.fieldType = fieldType;
     this.javaName = javaName;
     this.javaDescriptor = javaDescriptor;
     this.javaClassName = javaClassName;
 }
コード例 #3
0
        /// <summary>
        /// Create a synthetic field and add it to the given declaring type.
        /// </summary>
        public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType, string fullScopeId)
        {
            var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType, fullScopeId);
            if(declaringType != null)
                declaringType.Add(type);

            module.Register(type);
            return type;
        }
コード例 #4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 private XSyntheticTypeDefinition(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
     : base(module, declaringType, flags.HasFlag(XSyntheticTypeFlags.ValueType), null)
 {
     this.flags = flags;
     [email protected] = @namespace;
     this.name = name;
     this.baseType = baseType;
     fields = new List<XFieldDefinition>();
     methods = new List<XMethodDefinition>();
     nestedTypes = new List<XTypeDefinition>();
     interfaces = new List<XTypeReference>();
 }
コード例 #5
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public JavaMethodReference(string name, bool hasThis, XTypeReference returnType, XTypeReference declaringType,
               IEnumerable<XParameter> parameters, IEnumerable<string> genericParameterNames, string javaName, string javaDescriptor, string javaClassName)
     : base(declaringType)
 {
     this.name = name;
     this.hasThis = hasThis;
     this.returnType = returnType;
     this.javaName = javaName;
     this.javaDescriptor = javaDescriptor;
     this.javaClassName = javaClassName;
     this.parameters = (parameters ?? Enumerable.Empty<XParameter>()).ToList().AsReadOnly();
     genericParameters = (genericParameterNames ?? Enumerable.Empty<string>()).Select((x, i) => new XGenericParameter.SimpleXGenericParameter(this, i)).Cast<XGenericParameter>().ToList().AsReadOnly();
 }
コード例 #6
0
ファイル: XPointerType.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Default ctor
 /// </summary>
 public XPointerType(XTypeReference elementType)
     : base(elementType)
 {
 }
コード例 #7
0
 /// <summary>
 /// Ensure that javaImportType is loaded.
 /// </summary>
 private void EnsureJavaImportType()
 {
     if (javaImportType == null)
     {
         // Load java import type
         string className;
         javaImportType = TryGetJavaImportNames(out className)
                              ? Java.XBuilder.AsTypeReference(Module, className, XTypeUsageFlags.DeclaringType)
                              : Module.TypeSystem.NoType;
     }
 }
コード例 #8
0
 /// <summary>
 /// Does this type reference point to the same type as the given other reference?
 /// </summary>
 public override bool IsSame(XTypeReference other, bool ignoreSign)
 {
     if (base.IsSame(other, ignoreSign))
         return true;
     EnsureDexImportType();
     if (dexImportType != Module.TypeSystem.NoType)
     {
         if (dexImportType.IsSame(other, ignoreSign))
             return true;
     }
     EnsureJavaImportType();
     if (javaImportType != Module.TypeSystem.NoType)
     {
         if (javaImportType.IsSame(other, ignoreSign))
             return true;
     }
     return false;
 }
コード例 #9
0
 /// <summary>
 /// Create a synthetic field and add it to the given declaring type.
 /// </summary>
 public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
 {
     var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType);
     declaringType.Add(type);
     return type;
 }
コード例 #10
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public XOptionalModifierType(XTypeReference modifierType, XTypeReference elementType)
     : base(elementType)
 {
     this.modifierType = modifierType;
 }
コード例 #11
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public ILMethodReference(XTypeReference declaringType, MethodReference method)
     : base(declaringType)
 {
     this.method = method;
 }
コード例 #12
0
ファイル: XBuilder.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Create a System.Nullable&lt;T&gt; type with given T argument.
 /// </summary>
 private static XGenericInstanceType CreateNullableT(XModule module, XTypeReference argument)
 {
     return new XGenericInstanceType(new XTypeReference.SimpleXTypeReference(module, "System", "Nullable`1", null, true, new[] { "T" }), new[] { argument });            
 }
コード例 #13
0
ファイル: XBuilder.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Convert an Java method reference to an XMethodReference.
 /// </summary>
 public static XMethodReference AsMethodReference(XModule module, string methodName, string descriptor, XTypeReference declaringType, string className, bool hasThis)
 {
     if (declaringType.IsArray)
     {
         declaringType = module.TypeSystem.Object;
     }
     var _descriptor = Descriptors.ParseMethodDescriptor(descriptor);
     var returnType = AsTypeReference(module, _descriptor.ReturnType, XTypeUsageFlags.ReturnType);
     var parameters = _descriptor.Parameters.Select((x, i) => new JavaParameter(module, "p" + i, x));
     var name = methodName;
     if (name == "<init>") name = ".ctor";
     else if (name == "<clinit>") name = ".cctor";
     return new JavaMethodReference(name, hasThis, returnType, declaringType, parameters, null, methodName, descriptor, className);
 }
コード例 #14
0
ファイル: XBuilder.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Convert an Java field reference to an XFieldReference.
 /// </summary>
 public static XFieldReference AsFieldReference(XModule module, string fieldName, string descriptor, XTypeReference declaringType, string className)
 {
     var fieldType = AsTypeReference(module, Descriptors.ParseFieldType(descriptor), XTypeUsageFlags.FieldType);
     return new JavaFieldReference(fieldName, fieldType, declaringType, fieldName, descriptor, className);
 }
コード例 #15
0
 /// <summary>
 /// Create a synthetic field and add it to the given declaring type.
 /// </summary>
 public static XSyntheticFieldDefinition Create(XTypeDefinition declaringType, XSyntheticFieldFlags flags, string name, XTypeReference fieldType, object initialValue = null)
 {
     var field = new XSyntheticFieldDefinition(declaringType, flags, name, fieldType, initialValue);
     declaringType.Add(field);
     return field;
 }
コード例 #16
0
ファイル: XParameter.cs プロジェクト: Xtremrules/dot42
 public static XParameter Create(string name, XTypeReference type)
 {
     return new TypedParameter(name, type);
 }
コード例 #17
0
ファイル: XParameter.cs プロジェクト: Xtremrules/dot42
 public TypedParameter(string name, XTypeReference type, XParameterKind kind = XParameterKind.Input)
     : base(name, kind)
 {
     this.type = type;
 }
コード例 #18
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public XRequiredModifierType(XTypeReference modifierType, XTypeReference elementType)
     : base(elementType)
 {
     this.modifierType = modifierType;
 }
コード例 #19
0
ファイル: XByReferenceType.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Default ctor
 /// </summary>
 public XByReferenceType(XTypeReference elementType)
     : base(elementType)
 {
 }