26using IKVM.ByteCode.Decoding;
31 sealed partial class ClassFile
37 internal sealed class ConstantPoolItemFieldref : ConstantPoolItemFMI
40 RuntimeJavaField _field;
41 RuntimeJavaType _fieldJavaType;
48 public ConstantPoolItemFieldref(RuntimeContext context, FieldrefConstantData data) :
49 base(context, data.
Class, data.NameAndType)
54 protected override void Validate(
string name,
string descriptor,
int majorVersion)
58 if (!
IsValidFieldName(name,
new ClassFormatVersion((ushort)majorVersion, 0)))
63 public override void Link(RuntimeJavaType thisType,
LoadMode mode)
65 base.Link(thisType, mode);
67 if (_fieldJavaType != null)
70 RuntimeJavaField fw = null;
71 var wrapper = GetClassType();
75 if (!wrapper.IsUnloadable)
77 fw = wrapper.GetFieldWrapper(
Name, Signature);
82 var classLoader = thisType.ClassLoader;
83 var fld = classLoader.FieldTypeWrapperFromSig(this.Signature, mode);
87 if (_fieldJavaType ==
null)
99 public RuntimeJavaType GetFieldType()
101 return _fieldJavaType;
108 public RuntimeJavaField GetField()
114 public override RuntimeJavaMember GetMember()
global::java.lang.Class Class
global::java.lang.invoke.LambdaForm.Name Name
static bool IsValidFieldName(string name, ClassFormatVersion version)
Returns true if the given string is a valid field name given the specified class format version.
static bool IsValidFieldDescriptor(string descriptor)
Returns true if the specified descriptor is a valid field descriptor.