Package com.dooapp.gaedo.finders

Examples of com.dooapp.gaedo.finders.FieldInformer


    if (fieldName.length() > 0) {
      String realFieldName = fieldName.substring(0, 1)
          .toLowerCase();
      if (fieldName.length() > 1)
        realFieldName += fieldName.substring(1);
      FieldInformer returned = realInformer.get(realFieldName);
      Class<?> returnType = invokedMethod.getReturnType();
      if (!returnType.isAssignableFrom(returned.getClass())) {
        throw new ReturnTypeMismatch(invokedMethod, returned
            .getClass(), returnType);
      }
      return returnType.cast(returned);
    } else {
      throw new EmptyGetDontWork(invokedMethod);
View Full Code Here


    return locators.add(e);
  }

  @Override
  public FieldInformer getInformerFor(Property field) {
    FieldInformer returned = null;
    Map<FieldInformerLocator, Exception> thrownDuringSearch = new LinkedHashMap<FieldInformerLocator, Exception>();
    for (FieldInformerLocator locator : locators) {
      try {
        returned = locator.getInformerFor(field);
        if (returned != null) {
View Full Code Here

   * @return a {@link FieldInformer} or an exception
   * @see #internalGet(String)
   */
  @Override
  public FieldInformer get(String string, Collection<Property> propertyPath) {
    FieldInformer returned = internalGet(string);
    if(returned instanceof FieldInformerAPI) {
      returned = ((FieldInformerAPI) returned).with(new LinkedList<Property>(propertyPath));
    }
    return returned;
  }
View Full Code Here

      this.field = field;
    }

    @Override
    public FieldInformer get(String string, Collection<Property> propertyPath) {
      FieldInformer returned = ReflectionBackedInformer.this.get(string);
      if(returned instanceof FieldInformerAPI) {
        // Improve path with this informer one
        Collection<Property> newPath = new LinkedList<Property>(propertyPath);
        newPath.add(field);
        returned = ((FieldInformerAPI) returned).with(newPath);
View Full Code Here

   * @return a method resolving call to an informer
   */
  private MethodResolver createSubInformerResolvers(Method method) {
    // First thing to check is method startup
    String methodName = method.getName();
    FieldInformer returned = methodNameToFieldInformer(method, realInformer);
    Class<?> returnType = method.getReturnType();
    if (!returnType.isAssignableFrom(returned.getClass())) {
      throw new ReturnTypeMismatchException(method,
          returned.getClass(), returnType);
    }
    return new SubInformerMethodResolver(returned, realInformer);
  }
View Full Code Here

    }
  }

  @Override
  public FieldInformer get(String string, Collection<Property> propertyPath) {
    FieldInformer returned = internalGet(string);
    if(returned instanceof FieldInformerAPI) {
      returned = ((FieldInformerAPI) returned).with(new LinkedList<Property>(propertyPath));
    }
    return returned;
  }
View Full Code Here

      this.field = field;
    }

    @Override
    public FieldInformer get(String string, Collection<Property> propertyPath) {
      FieldInformer returned = ReflectionBackedInformer.this.get(string);
      if(returned instanceof FieldInformerAPI) {
        // Improve path with this informer one
        Collection<Property> newPath = new LinkedList<Property>(propertyPath);
        newPath.add(field);
        returned = ((FieldInformerAPI) returned).with(newPath);
View Full Code Here

   * @return a method resolving call to an informer
   */
  private MethodResolver createSubInformerResolvers(Method method) {
    // First thing to check is method startup
    String methodName = method.getName();
    FieldInformer returned = methodNameToFieldInformer(method, realInformer);
    Class<?> returnType = method.getReturnType();
    if (!returnType.isAssignableFrom(returned.getClass())) {
      throw new ReturnTypeMismatchException(method,
          returned.getClass(), returnType);
    }
    return new SubInformerMethodResolver(returned, realInformer);
  }
View Full Code Here

    return locators.add(e);
  }

  @Override
  public FieldInformer getInformerFor(Property field) {
    FieldInformer returned = null;
    Map<FieldInformerLocator, Exception> thrownDuringSearch = new LinkedHashMap<FieldInformerLocator, Exception>();
    for (FieldInformerLocator locator : locators) {
      try {
        returned = locator.getInformerFor(field);
        if (returned != null) {
View Full Code Here

  public String consumeSort(String methodString, String consumableText, Map<String, String> fieldNames,DynamicFinderMethodResolver created) {
    boolean found = false;
    for(Map.Entry<String, String> fieldEntry: fieldNames.entrySet()) {
      if(consumableText.startsWith(fieldEntry.getKey())) {
        consumableText = consumableText.substring(fieldEntry.getKey().length());
        FieldInformer informer = backEnd.getInformer().get(fieldEntry.getValue());
        found = false;
        for(SortingExpression.Direction direction : SortingExpression.Direction.values()) {
          if(consumableText.startsWith(direction.getText())) {
            consumableText = consumableText.substring(direction.getText().length());
            created.addSortingExpression(informer, direction);
View Full Code Here

TOP

Related Classes of com.dooapp.gaedo.finders.FieldInformer

Copyright © 2018 www.massapicom. 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.