public static int getArityValue(JRubyMethod anno, int actualRequired) { if (anno.optional() > 0 || anno.rest()) { return -(actualRequired + 1); } return actualRequired; }
public static int getArityValue(JRubyMethod anno, int actualRequired) { if (anno.optional() > 0 || anno.rest()) { return -(actualRequired + 1); } return actualRequired; }
public static int getArityValue(JRubyMethod anno, int actualRequired) { if (anno.optional() > 0 || anno.rest()) { return -(actualRequired + 1); } return actualRequired; }
public static int getArityValue(JRubyMethod anno, int actualRequired) { if (anno.optional() > 0 || anno.rest()) { return -(actualRequired + 1); } return actualRequired; }
public static Arity fromAnnotation(JRubyMethod anno, int required) { return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, int required) { return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, int required) { return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, int required) { return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static long getEncodedSignature(JRubyMethod anno) { return encodeSignature(anno.required(), anno.optional(), 0, 0, 0, anno.rest(), false); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno, Class[] parameterTypes, boolean isStatic) { int required; if (anno.optional() == 0 && !anno.rest() && anno.required() == 0) { // try count specific args to determine required int i = parameterTypes.length; if (isStatic) i--; if (parameterTypes.length > 0) { if (parameterTypes[0] == ThreadContext.class) i--; if (parameterTypes[parameterTypes.length - 1] == Block.class) i--; } required = i; } else { required = anno.required(); } return createArity(required, anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static long getEncodedSignature(JRubyMethod anno) { return encodeSignature(anno.required(), anno.optional(), 0, 0, 0, anno.rest(), false); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public static Arity fromAnnotation(JRubyMethod anno) { return createArity(anno.required(), anno.optional(), anno.rest()); }
public ReflectedJavaMethod( RubyModule implementationClass, Method method, JRubyMethod annotation) { super(implementationClass, annotation.visibility()); this.method = method; Class<?>[] params = method.getParameterTypes(); this.needsBlock = params.length > 0 && params[params.length - 1] == Block.class; this.isStatic = Modifier.isStatic(method.getModifiers()); Arity arity = Arity.fromAnnotation(annotation, params, this.isStatic); setArity(arity); this.required = arity.getValue() >= 0 ? arity.getValue() : Math.abs(arity.getValue())-1; this.optional = annotation.optional(); this.rest = annotation.rest(); this.needsThreadContext = params.length > 0 && params[0] == ThreadContext.class; this.argsAsIs = ! isStatic && optional == 0 && !rest && !needsBlock && !needsThreadContext; if (rest) { max = -1; } else { max = required + optional; } }
public ReflectedJavaMethod( RubyModule implementationClass, Method method, JRubyMethod annotation) { super(implementationClass, annotation.visibility()); this.method = method; Class<?>[] params = method.getParameterTypes(); this.needsBlock = params.length > 0 && params[params.length - 1] == Block.class; this.isStatic = Modifier.isStatic(method.getModifiers()); Arity arity = Arity.fromAnnotation(annotation, params, this.isStatic); setArity(arity); this.required = arity.getValue() >= 0 ? arity.getValue() : Math.abs(arity.getValue())-1; this.optional = annotation.optional(); this.rest = annotation.rest(); this.needsThreadContext = params.length > 0 && params[0] == ThreadContext.class; this.argsAsIs = ! isStatic && optional == 0 && !rest && !needsBlock && !needsThreadContext; if (rest) { max = -1; } else { max = required + optional; } }