Mercurial Hosting > luan
comparison src/luan/LuanJavaFunction.java @ 1716:b82767112d8e
add String.regex
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Jul 2022 23:43:03 -0600 |
parents | 8dd8c556c449 |
children |
comparison
equal
deleted
inserted
replaced
1715:ad44e849c60c | 1716:b82767112d8e |
---|---|
29 this( JavaMethod.of(constr), obj ); | 29 this( JavaMethod.of(constr), obj ); |
30 } | 30 } |
31 | 31 |
32 private LuanJavaFunction(JavaMethod method,Object obj) { | 32 private LuanJavaFunction(JavaMethod method,Object obj) { |
33 this.method = method; | 33 this.method = method; |
34 this.obj = obj; | |
35 this.rtnConverter = getRtnConverter(method); | 34 this.rtnConverter = getRtnConverter(method); |
36 this.takesLuan = takesLuan(method); | 35 this.takesLuan = takesLuan(method); |
37 this.argConverters = getArgConverters(takesLuan,method); | 36 this.argConverters = getArgConverters(takesLuan,method); |
38 if( method.isVarArgs() ) { | 37 if( method.isVarArgs() ) { |
39 Class[] paramTypes = method.getParameterTypes(); | 38 Class[] paramTypes = method.getParameterTypes(); |
40 this.varArgCls = paramTypes[paramTypes.length-1].getComponentType(); | 39 this.varArgCls = paramTypes[paramTypes.length-1].getComponentType(); |
41 } else { | 40 } else { |
42 this.varArgCls = null; | 41 this.varArgCls = null; |
43 } | 42 } |
43 this.obj = obj; | |
44 } | |
45 | |
46 public LuanJavaFunction(LuanJavaFunction fn,Object obj) { | |
47 this.method = fn.method; | |
48 this.rtnConverter = fn.rtnConverter; | |
49 this.takesLuan = fn.takesLuan; | |
50 this.argConverters = fn.argConverters; | |
51 this.varArgCls = fn.varArgCls; | |
52 this.obj = obj; | |
44 } | 53 } |
45 | 54 |
46 @Override public String toString() { | 55 @Override public String toString() { |
47 return "java-function: " + method; | 56 return "java-function: " + method; |
48 } | 57 } |