Package com.dooapp.gaedo.finders

Examples of com.dooapp.gaedo.finders.FieldInformer


  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


  public String consumeFilter(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());
        Map<String, Method> queries = Utils.getUppercasedMap(informer.getClass().getMethods());
        found = false;
        for(Map.Entry<String, Method> methodEntry : queries.entrySet()) {
          if(consumableText.startsWith(methodEntry.getKey())) {
            consumableText = consumableText.substring(methodEntry.getKey().length());
            created.addQueryExpression(informer, methodEntry.getValue());
            found = true;
          }
        }
        // TODO insert here code for call chaining
        if(!found) {
          throw new UnableToBuildDueToMissingQueryExpressionException(consumableText, methodString, fieldEntry.getKey(),
                  Utils.getUppercasedMap(Utils.removeGaedoInternalMethodsFrom(informer.getClass().getMethods())).keySet());
        }
        for(Combinator c: Combinator.values()) {
          if(consumableText.startsWith(c.getText())) {
            consumableText = consumableText.substring(c.getText().length());
            created.setCombinator(c);
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

   * @param method input method
   * @return a method resolving call to an informer
   */
  private MethodResolver createSubInformerResolvers(Method method) {
    // First thing to check is method startup
    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

      public QueryExpression createMatchingExpression(
          InformerType informer) {
       
        QueryExpression returned = null;
        for(int index=0; index<id.length; index++) {
          FieldInformer fieldInformer = getInformer().get(idProperties.get(index).getName());
          QueryExpression propertyEquality = fieldInformer.equalsTo(id[index]);
          if(returned==null) {
            returned = propertyEquality;
          } else {
            returned = Expressions.and(returned, propertyEquality);
          }
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

  public String consumeFilter(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());
        Map<String, Method> queries = Utils.getUppercasedMap(informer.getClass().getMethods());
        found = false;
        for(Map.Entry<String, Method> methodEntry : queries.entrySet()) {
          if(consumableText.startsWith(methodEntry.getKey())) {
            consumableText = consumableText.substring(methodEntry.getKey().length());
            created.addQueryExpression(informer, methodEntry.getValue());
View Full Code Here

  public String consumeSort(Method method, String consumableText, Map<String, String> fieldNames,MethodResolver 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

  public String consumeFilter(Method method, String consumableText, Map<String, String> fieldNames,MethodResolver 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());
        Map<String, Method> queries = Utils.getUppercasedMap(informer.getClass().getMethods());
        found = false;
        for(Map.Entry<String, Method> methodEntry : queries.entrySet()) {
          if(consumableText.startsWith(methodEntry.getKey())) {
            consumableText = consumableText.substring(methodEntry.getKey().length());
            created.addQueryExpression(informer, methodEntry.getValue());
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.