2
Copyright (C) 2002, 2003, 2004 Jeroen Frijters
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
25
using System.Reflection;
26
using System.Reflection.Emit;
28
[AttributeUsage(AttributeTargets.Class)]
29
public sealed class ExceptionIsUnsafeForMappingAttribute : Attribute
33
[AttributeUsage(AttributeTargets.Method)]
34
public sealed class RemappedInterfaceMethodAttribute : Attribute
37
private string mappedTo;
39
public RemappedInterfaceMethodAttribute(string name, string mappedTo)
42
this.mappedTo = mappedTo;
53
public string MappedTo
62
[AttributeUsage(AttributeTargets.Assembly)]
63
public sealed class RemappedClassAttribute : Attribute
66
private Type remappedType;
68
public RemappedClassAttribute(string name, Type remappedType)
71
this.remappedType = remappedType;
82
public Type RemappedType
91
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
92
public sealed class RemappedTypeAttribute : Attribute
96
public RemappedTypeAttribute(Type type)
110
[AttributeUsage(AttributeTargets.Module)]
111
public sealed class JavaModuleAttribute : Attribute
115
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Assembly)]
116
public sealed class NoPackagePrefixAttribute : Attribute
120
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method)]
121
public sealed class UnloadableTypeAttribute : Attribute
125
public UnloadableTypeAttribute(string name)
139
[AttributeUsage(AttributeTargets.Struct)]
140
public sealed class GhostInterfaceAttribute : Attribute
144
// Whenever the VM or compiler generates a helper class/method/field, it should be marked
145
// with this custom attribute, so that it can be hidden from Java reflection.
146
// NOTE when this attribute is applied to a class, it means that instances of this class
147
// will appear to be instances of the base class.
148
[AttributeUsage(AttributeTargets.All)]
149
public sealed class HideFromReflectionAttribute : Attribute
154
public enum Modifiers : ushort
162
Synchronized = 0x0020,
171
[AttributeUsage(AttributeTargets.All)]
172
public sealed class ModifiersAttribute : Attribute
174
private Modifiers modifiers;
176
public ModifiersAttribute(Modifiers modifiers)
178
this.modifiers = modifiers;
181
public Modifiers Modifiers
190
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method)]
191
public sealed class ThrowsAttribute : Attribute
193
private string[] classes;
195
// NOTE this is not CLS compliant, so maybe we should have a couple of overloads
196
public ThrowsAttribute(string[] classes)
198
this.classes = classes;
201
// dotted Java class names (e.g. java.lang.Throwable)
202
public string[] Classes
211
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
212
public sealed class ImplementsAttribute : Attribute
214
private string[] interfaces;
216
// NOTE this is not CLS compliant, so maybe we should have a couple of overloads
217
public ImplementsAttribute(string[] interfaces)
219
this.interfaces = interfaces;
222
public string[] Interfaces
231
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
232
public sealed class InnerClassAttribute : Attribute
234
private string innerClassName;
235
private string outerClassName;
237
private Modifiers modifiers;
239
public InnerClassAttribute(string innerClassName, string outerClassName, string name, Modifiers modifiers)
241
this.innerClassName = innerClassName;
242
this.outerClassName = outerClassName;
244
this.modifiers = modifiers;
247
public string InnerClassName
251
return innerClassName;
255
public string OuterClassName
259
return OuterClassName;
263
// NOTE returns null for anonymous inner classes
272
public Modifiers Modifiers