@JRubyMethod public IRubyObject static_value() { try { return convertToRuby( getRuntime(), field.get(null) ); } catch (IllegalAccessException iae) { throw getRuntime().newTypeError("illegal static value access: " + iae.getMessage()); } }
@JRubyMethod public IRubyObject static_value() { try { return convertToRuby( getRuntime(), field.get(null) ); } catch (IllegalAccessException iae) { throw getRuntime().newTypeError("illegal static value access: " + iae.getMessage()); } }
@JRubyMethod(name = "public?") public RubyBoolean public_p() { return getRuntime().newBoolean(Modifier.isPublic(field.getModifiers())); }
@JRubyMethod public RubyString value_type() { return getRuntime().newString(field.getType().getName()); }
@JRubyMethod(name = "static?") public RubyBoolean static_p() { return getRuntime().newBoolean(Modifier.isStatic(field.getModifiers())); }
@JRubyMethod(name = "final?") public RubyBoolean final_p() { return getRuntime().newBoolean(Modifier.isFinal(field.getModifiers())); }
@JRubyMethod(name = "final?") public RubyBoolean final_p() { return getRuntime().newBoolean(Modifier.isFinal(field.getModifiers())); }
@JRubyMethod(name = "public?") public RubyBoolean public_p() { return getRuntime().newBoolean(Modifier.isPublic(field.getModifiers())); }
@JRubyMethod(name = "final?") public RubyBoolean final_p() { return getRuntime().newBoolean(Modifier.isFinal(field.getModifiers())); }
@JRubyMethod(name = "type") public IRubyObject field_type() { return JavaClass.get(getRuntime(), field.getType()); }
@JRubyMethod public RubyString name() { return getRuntime().newString(field.getName()); }
@JRubyMethod(name = "type") public IRubyObject field_type() { return JavaClass.get(getRuntime(), field.getType()); }
private Object unwrapJavaObject(final IRubyObject object) throws RaiseException { Object javaObject = JavaUtil.unwrapJavaValue(object); if ( javaObject == null ) { throw getRuntime().newTypeError("not a java object: " + object); } return javaObject; }
private Object unwrapJavaObject(final IRubyObject object) throws RaiseException { Object javaObject = JavaUtil.unwrapJavaValue(object); if ( javaObject == null ) { throw getRuntime().newTypeError("not a java object: " + object); } return javaObject; }
@JRubyMethod(name = {"==", "==="}) public IRubyObject op_equal(IRubyObject other) { if (!(other instanceof JavaField)) { return getRuntime().getFalse(); } return getRuntime().newBoolean(field.equals(((JavaField) other).field)); }
@JRubyMethod(name = {"==", "==="}) public IRubyObject op_equal(IRubyObject other) { if (!(other instanceof JavaField)) { return getRuntime().getFalse(); } return getRuntime().newBoolean(field.equals(((JavaField) other).field)); }
@JRubyMethod public RubyString to_generic_string() { return getRuntime().newString(field.toGenericString()); }
@JRubyMethod(name = "enum_constant?") public RubyBoolean enum_constant_p() { return getRuntime().newBoolean(field.isEnumConstant()); }
@JRubyMethod(name = "enum_constant?") public RubyBoolean enum_constant_p() { return getRuntime().newBoolean(field.isEnumConstant()); }
@JRubyMethod public RubyString to_generic_string() { return getRuntime().newString(field.toGenericString()); }