public class JavaUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JavaUtil.JavaConverter |
static interface |
JavaUtil.NumericConverter |
static interface |
JavaUtil.RubyConverter
Deprecated.
|
Constructor and Description |
---|
JavaUtil() |
Modifier and Type | Method and Description |
---|---|
static Object |
coerceJavaObjectToType(ThreadContext context,
Object javaObject,
Class target)
Deprecated.
|
static Object |
coerceNilToType(RubyNil nil,
Class target)
Deprecated.
|
static Object |
coerceOtherToType(ThreadContext context,
IRubyObject arg,
Class target)
Deprecated.
|
static Object |
coerceStringToType(RubyString string,
Class target)
Deprecated.
|
static Object |
convertArgument(Ruby runtime,
Object argument,
Class<?> parameterType)
Deprecated.
|
static Object |
convertArgumentToType(ThreadContext context,
IRubyObject arg,
Class target)
Deprecated.
|
static IRubyObject |
convertJavaArrayElementToRuby(Ruby runtime,
JavaUtil.JavaConverter converter,
Object array,
int i) |
static IRubyObject[] |
convertJavaArrayToRuby(Ruby runtime,
Object[] objects) |
static RubyArray |
convertJavaArrayToRubyWithNesting(ThreadContext context,
Object array) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
boolean b) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
double d) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
float f) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
int i) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
JavaUtil.JavaConverter converter,
Object object)
Deprecated.
|
static IRubyObject |
convertJavaToRuby(Ruby runtime,
long l) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
Object object) |
static IRubyObject |
convertJavaToRuby(Ruby runtime,
Object object,
Class javaClass) |
static IRubyObject |
convertJavaToUsableRubyObject(Ruby runtime,
Object object)
Returns a usable RubyObject; for types that are not converted to Ruby native
types, a Java proxy will be returned.
|
static IRubyObject |
convertJavaToUsableRubyObjectWithConverter(Ruby runtime,
Object object,
JavaUtil.JavaConverter converter) |
static Object |
convertProcToInterface(ThreadContext context,
RubyBasicObject rubyObject,
Class target) |
static Object |
convertProcToInterface(ThreadContext context,
RubyObject rubyObject,
Class target) |
static Object |
convertRubyToJava(IRubyObject rubyObject)
Deprecated.
|
static Object |
convertRubyToJava(IRubyObject rubyObject,
Class javaClass)
Deprecated.
|
static boolean |
convertRubyToJavaBoolean(IRubyObject rubyObject)
Deprecated.
|
static byte |
convertRubyToJavaByte(IRubyObject rubyObject)
Deprecated.
|
static char |
convertRubyToJavaChar(IRubyObject rubyObject)
Deprecated.
|
static double |
convertRubyToJavaDouble(IRubyObject rubyObject)
Deprecated.
|
static float |
convertRubyToJavaFloat(IRubyObject rubyObject)
Deprecated.
|
static int |
convertRubyToJavaInt(IRubyObject rubyObject)
Deprecated.
|
static long |
convertRubyToJavaLong(IRubyObject rubyObject)
Deprecated.
|
static short |
convertRubyToJavaShort(IRubyObject rubyObject)
Deprecated.
|
static JavaUtil.RubyConverter |
getArrayConverter(Class type)
Deprecated.
|
static String |
getJavaCasedName(String javaCasedName) |
static JavaUtil.JavaConverter |
getJavaConverter(Class clazz) |
static String |
getJavaPropertyName(String beanMethodName)
For methods that match /(get|set|is)([A-Z0-9])(.*)/, return the "name"
part of the property with leading lower-case.
|
static JavaUtil.NumericConverter |
getNumericConverter(Class target) |
static String |
getRubyCasedName(String javaCasedName)
Build a Ruby name from a Java name by treating '_' as divider and successive
caps as all the same word.
|
static Set<String> |
getRubyNamesForJavaName(String javaName,
List<Method> methods)
Given a simple Java method name and the Java Method objects that represent
all its overloads, add to the given nameSet all possible Ruby names that would
be valid.
|
static boolean |
isDuckTypeConvertable(Class providedArgumentType,
Class parameterType) |
static boolean |
isJavaObject(IRubyObject object)
Test if a passed instance is a wrapper Java object.
|
static IRubyObject |
java_to_primitive(IRubyObject recv,
IRubyObject object,
Block unusedBlock)
Deprecated.
|
static IRubyObject |
java_to_ruby(Ruby runtime,
IRubyObject object)
Deprecated.
|
static Object |
objectFromJavaProxy(IRubyObject self) |
static IRubyObject |
primitive_to_java(IRubyObject recv,
IRubyObject object,
Block unusedBlock)
Deprecated.
|
static Class<?> |
primitiveToWrapper(Class<?> type) |
static IRubyObject |
ruby_to_java(IRubyObject recv,
IRubyObject object,
Block unusedBlock)
Deprecated.
|
static Object |
unwrapJavaObject(IRubyObject object)
Unwrap a wrapped Java object.
|
static JavaObject |
unwrapJavaObject(Ruby runtime,
IRubyObject convertee,
String errorMessage)
Deprecated.
|
static Object |
unwrapJavaValue(IRubyObject object) |
static Object |
unwrapJavaValue(Ruby runtime,
IRubyObject object,
String errorMessage)
Deprecated.
|
public static final boolean CAN_SET_ACCESSIBLE
@Deprecated public static final JavaUtil.RubyConverter RUBY_BOOLEAN_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_BYTE_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_SHORT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_CHAR_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_INTEGER_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_LONG_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_FLOAT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter RUBY_DOUBLE_CONVERTER
@Deprecated public static final Map<Class,JavaUtil.RubyConverter> RUBY_CONVERTERS
@Deprecated public static final JavaUtil.RubyConverter ARRAY_BOOLEAN_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_BYTE_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_SHORT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_CHAR_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_INT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_LONG_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_FLOAT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_DOUBLE_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_OBJECT_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_CLASS_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_STRING_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_BIGINTEGER_CONVERTER
@Deprecated public static final JavaUtil.RubyConverter ARRAY_BIGDECIMAL_CONVERTER
@Deprecated public static final Map<Class,JavaUtil.RubyConverter> ARRAY_CONVERTERS
public static IRubyObject[] convertJavaArrayToRuby(Ruby runtime, Object[] objects)
public static RubyArray convertJavaArrayToRubyWithNesting(ThreadContext context, Object array)
public static JavaUtil.JavaConverter getJavaConverter(Class clazz)
public static IRubyObject convertJavaToRuby(Ruby runtime, Object object)
public static IRubyObject convertJavaToRuby(Ruby runtime, Object object, Class javaClass)
public static IRubyObject convertJavaToRuby(Ruby runtime, int i)
public static IRubyObject convertJavaToRuby(Ruby runtime, long l)
public static IRubyObject convertJavaToRuby(Ruby runtime, float f)
public static IRubyObject convertJavaToRuby(Ruby runtime, double d)
public static IRubyObject convertJavaToRuby(Ruby runtime, boolean b)
public static IRubyObject convertJavaToUsableRubyObject(Ruby runtime, Object object)
runtime
- object
- public static IRubyObject convertJavaToUsableRubyObjectWithConverter(Ruby runtime, Object object, JavaUtil.JavaConverter converter)
public static IRubyObject convertJavaArrayElementToRuby(Ruby runtime, JavaUtil.JavaConverter converter, Object array, int i)
public static boolean isDuckTypeConvertable(Class providedArgumentType, Class parameterType)
public static Object convertProcToInterface(ThreadContext context, RubyObject rubyObject, Class target)
public static Object convertProcToInterface(ThreadContext context, RubyBasicObject rubyObject, Class target)
public static JavaUtil.NumericConverter getNumericConverter(Class target)
public static boolean isJavaObject(IRubyObject object)
object
- public static Object unwrapJavaObject(IRubyObject object)
object
- isJavaObject(IRubyObject)
@Deprecated public static Object unwrapJavaValue(Ruby runtime, IRubyObject object, String errorMessage)
public static Object unwrapJavaValue(IRubyObject object)
object
- public static String getJavaPropertyName(String beanMethodName)
beanMethodName
- the bean method from which to extract a namepublic static String getRubyCasedName(String javaCasedName)
javaCasedName
- public static Set<String> getRubyNamesForJavaName(String javaName, List<Method> methods)
javaName
- methods
- public static Object objectFromJavaProxy(IRubyObject self)
@Deprecated public static Object convertRubyToJava(IRubyObject rubyObject)
@Deprecated public static Object convertRubyToJava(IRubyObject rubyObject, Class javaClass)
@Deprecated public static byte convertRubyToJavaByte(IRubyObject rubyObject)
@Deprecated public static short convertRubyToJavaShort(IRubyObject rubyObject)
@Deprecated public static char convertRubyToJavaChar(IRubyObject rubyObject)
@Deprecated public static int convertRubyToJavaInt(IRubyObject rubyObject)
@Deprecated public static long convertRubyToJavaLong(IRubyObject rubyObject)
@Deprecated public static float convertRubyToJavaFloat(IRubyObject rubyObject)
@Deprecated public static double convertRubyToJavaDouble(IRubyObject rubyObject)
@Deprecated public static boolean convertRubyToJavaBoolean(IRubyObject rubyObject)
@Deprecated public static Object convertArgumentToType(ThreadContext context, IRubyObject arg, Class target)
@Deprecated public static Object coerceNilToType(RubyNil nil, Class target)
@Deprecated public static IRubyObject convertJavaToRuby(Ruby runtime, JavaUtil.JavaConverter converter, Object object)
@Deprecated public static JavaUtil.RubyConverter getArrayConverter(Class type)
@Deprecated public static IRubyObject ruby_to_java(IRubyObject recv, IRubyObject object, Block unusedBlock)
@Deprecated public static IRubyObject java_to_primitive(IRubyObject recv, IRubyObject object, Block unusedBlock)
@Deprecated public static IRubyObject primitive_to_java(IRubyObject recv, IRubyObject object, Block unusedBlock)
@Deprecated public static Object convertArgument(Ruby runtime, Object argument, Class<?> parameterType)
@Deprecated public static IRubyObject java_to_ruby(Ruby runtime, IRubyObject object)
@Deprecated public static Object coerceStringToType(RubyString string, Class target)
@Deprecated public static Object coerceOtherToType(ThreadContext context, IRubyObject arg, Class target)
@Deprecated public static Object coerceJavaObjectToType(ThreadContext context, Object javaObject, Class target)
@Deprecated public static JavaObject unwrapJavaObject(Ruby runtime, IRubyObject convertee, String errorMessage)
Copyright © 2001-2015 JRuby. All Rights Reserved.