Examples of MethodParameterContext


Examples of net.sf.oval.context.MethodParameterContext

    public boolean isSatisfied(Object validatedObject, Object value, OValContext context, Validator validator) {
        requireMessageVariablesRecreation();
        try {
            if (context != null) {
                if (context instanceof MethodParameterContext) {
                    MethodParameterContext ctx = (MethodParameterContext) context;
                    Method method = ctx.getMethod();
                    String[] paramNames = Java.parameterNames(method);
                    int index = -1;
                    for(int i=0; i<paramNames.length; i++) {
                        if(paramNames[i].equals(to)) {
                            index = i;
                            break;
                        }
                    }
                    if(index < 0) {
                        return false;
                    }
                    otherKey = to;
                    otherValue = Binder.bind(to, method.getParameterTypes()[index], method.getGenericParameterTypes()[index], method.getParameterAnnotations()[index], Scope.Params.current().all());
                }
                if (context instanceof FieldContext) {
                    FieldContext ctx = (FieldContext) context;
                    try {
                        Field otherField = ctx.getField().getDeclaringClass().getDeclaredField(to);
                        otherKey = to;
                        otherValue = otherField.get(validatedObject);
                    } catch(Exception e) {
                        return false;
                    }
View Full Code Here

Examples of net.sf.oval.context.MethodParameterContext

    public boolean isSatisfied(Object validatedObject, Object value, OValContext context, Validator validator) {
        requireMessageVariablesRecreation();
        try {
            if (context != null) {
                if (context instanceof MethodParameterContext) {
                    MethodParameterContext ctx = (MethodParameterContext) context;
                    Method method = ctx.getMethod();
                    String[] paramNames = Java.parameterNames(method);
                    int index = -1;
                    for(int i=0; i<paramNames.length; i++) {
                        if(paramNames[i].equals(to)) {
                            index = i;
                            break;
                        }
                    }
                    if(index < 0) {
                        return false;
                    }
                    otherKey = to;

                    RootParamNode rootParamNode = Scope.Params.current().getRootParamNode();
                    Class<?> clazz = method.getParameterTypes()[index];
                    Type type = method.getGenericParameterTypes()[index];

                    otherValue = Binder.bind(rootParamNode, to, clazz, type, method.getParameterAnnotations()[index]);


                }
                if (context instanceof FieldContext) {
                    FieldContext ctx = (FieldContext) context;
                    try {
                        Field otherField = ctx.getField().getDeclaringClass().getDeclaredField(to);
                        otherKey = to;
                        otherValue = otherField.get(validatedObject);
                    } catch(Exception e) {
                        return false;
                    }
View Full Code Here

Examples of net.sf.oval.context.MethodParameterContext

            return true;
        }
        try {
            if (context != null) {
                if (context instanceof MethodParameterContext) {
                    MethodParameterContext ctx = (MethodParameterContext) context;
                    String[] paramNames = Java.parameterNames(ctx.getMethod());
                    key = paramNames[ctx.getParameterIndex()];
                }
                if (context instanceof FieldContext) {
                    FieldContext ctx = (FieldContext) context;
                    key = ctx.getField().getName();
                }
            }
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
View Full Code Here

Examples of net.sf.oval.context.MethodParameterContext

    public boolean isSatisfied(Object validatedObject, Object value, OValContext context, Validator validator) {
        requireMessageVariablesRecreation();
        try {
            if (context != null) {
                if (context instanceof MethodParameterContext) {
                    MethodParameterContext ctx = (MethodParameterContext) context;
                    Method method = ctx.getMethod();
                    String[] paramNames = Java.parameterNames(method);
                    int index = -1;
                    for (int i = 0; i < paramNames.length; i++) {
                        if (paramNames[i].equals(to)) {
                            index = i;
                            break;
                        }
                    }
                    if (index < 0) {
                        return false;
                    }
                    otherKey = to;

                    RootParamNode rootParamNode = Scope.Params.current().getRootParamNode();
                    Class<?> clazz = method.getParameterTypes()[index];
                    Type type = method.getGenericParameterTypes()[index];

                    otherValue = Binder.bind(rootParamNode, to, clazz, type, method.getParameterAnnotations()[index]);


                }
                if (context instanceof FieldContext) {
                    FieldContext ctx = (FieldContext) context;
                    try {
                        Field otherField = ctx.getField().getDeclaringClass().getDeclaredField(to);
                        otherKey = to;
                        otherValue = otherField.get(validatedObject);
                    } catch (Exception e) {
                        return false;
                    }
View Full Code Here

Examples of net.sf.oval.context.MethodParameterContext

            return true;
        }
        try {
            if (context != null) {
                if (context instanceof MethodParameterContext) {
                    MethodParameterContext ctx = (MethodParameterContext) context;
                    String[] paramNames = Java.parameterNames(ctx.getMethod());
                    key = paramNames[ctx.getParameterIndex()];
                }
                if (context instanceof FieldContext) {
                    FieldContext ctx = (FieldContext) context;
                    key = ctx.getField().getName();
                }
            }
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
View Full Code Here

Examples of org.wicketstuff.rest.utils.wicket.MethodParameterContext

    AttributesWrapper attributesWrapper)
  {
    List<Object> parametersValues = new ArrayList<>();

    Map<String, String> pathParameters = mappedMethod.getPathVariables();
    MethodParameterContext parameterContext = new MethodParameterContext(attributesWrapper,
      pathParameters, webSerialDeserial);

    for (MethodParameter<?> methodParameter : mappedMethod.getMethodInfo().getMethodParameters())
    {
      Object paramValue = methodParameter.extractParameterValue(parameterContext);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.