Examples of FieldContext


Examples of net.sf.oval.context.FieldContext

                    }
                    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.FieldContext

      Model ss = (Model) validatedObject;
     
      try {
              if (context != null) {
                  if (context instanceof FieldContext) {
                      FieldContext ctx = (FieldContext) context;
                      String fieldName = ctx.getField().getName();
                     
                      Query<? extends Object> all = Model.all(validatedObject.getClass());
                List<? extends Object> fetched = all.filter(fieldName, value).fetch();
                if(fetched.size() == 0) return true;
                Object sskey = SienaModelUtils.keyValue(ss);
View Full Code Here

Examples of net.sf.oval.context.FieldContext

                    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.FieldContext

                    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.FieldContext

        if (violations.isEmpty()) {
            return true;
        } else {
            for (ConstraintViolation violation : violations) {
                if (violation.getContext() instanceof FieldContext) {
                    final FieldContext ctx = (FieldContext) violation.getContext();
                    final String fkey = (key == null ? "" : key + ".") + ctx.getField().getName();
                    final Error error = new Error(fkey, violation.getMessage(), violation.getMessageVariables() == null ? new String[0] : violation.getMessageVariables().values().toArray(new String[0]));
                    Validation.current().errors.add(error);
                }
            }
            return false;
View Full Code Here

Examples of net.sf.oval.context.FieldContext

                    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.FieldContext

                    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.FieldContext

        if (violations.isEmpty()) {
            return true;
        } else {
            for (ConstraintViolation violation : violations) {
                if (violation.getContext() instanceof FieldContext) {
                    final FieldContext ctx = (FieldContext) violation.getContext();
                    final String fkey = (key == null ? "" : key + ".") + ctx.getField().getName();
                    final Error error = new Error(fkey, violation.getMessage(), violation.getMessageVariables() == null ? new String[0] : violation.getMessageVariables().values().toArray(new String[0]));
                    Validation.current().errors.add(error);
                }
            }
            return false;
View Full Code Here

Examples of org.elasticsearch.search.aggregations.support.FieldContext

        Filter parentFilter = context.filterCache().cache(parentDocMapper.typeFilter());
        Filter childFilter = context.filterCache().cache(childDocMapper.typeFilter());

        ParentChildIndexFieldData parentChildIndexFieldData = context.fieldData().getForField(parentFieldMapper);
        ValuesSourceConfig<ValuesSource.Bytes.WithOrdinals.ParentChild> config = new ValuesSourceConfig<>(ValuesSource.Bytes.WithOrdinals.ParentChild.class);
        config.fieldContext(new FieldContext(parentFieldMapper.names().indexName(), parentChildIndexFieldData, parentFieldMapper));
        return new ParentToChildrenAggregator.Factory(aggregationName, config, parentType, parentFilter, childFilter);
    }
View Full Code Here

Examples of org.ocpsoft.rewrite.annotation.api.FieldContext

      @Override
      public void process(ClassContext context, Resource annotation, HandlerChain chain)
      {
         if (context instanceof FieldContext) {
            FieldContext fieldContext = (FieldContext) context;
            elements.add(fieldContext.getJavaField().getName());
         }
         else if (context instanceof ClassContext) {

            ClassContext classContext = (ClassContext) context;
            elements.add(classContext.getJavaClass().getSimpleName());
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.