Package org.yaac.server.egql.evaluator

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()


              KeyFactory.stringToKey((String) r.getPayload()), r)
        } catch (IllegalArgumentException e) {  // invalid input key string
          return r.withWarning(ErrorCode.W129);
        }
      } else {
        return r.withWarning(ErrorCode.W125);
      }
    } else if (this.ops.size() % 2 == 0) { //TODO KEY('kind', 'name'/ID [, 'kind', 'name'/ID...])
      Key key = null;
     
      // evaluation results, used at last to construct all previous results
View Full Code Here


   
    if (r.getPayload() instanceof String) {
      ShortBlob val = new ShortBlob(((String) r.getPayload()).getBytes());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W131);
    }
  }
}
View Full Code Here

            }
          }
        }
       
        // non of them are successful, return error message
        return r.withWarning(ErrorCode.W116);
      } else {
        return r.withWarning(ErrorCode.W117);
      }
    } else if (this.ops.size() == 2) {
      EvaluationResult r = ops.get(0).evaluate(record);
View Full Code Here

        }
       
        // non of them are successful, return error message
        return r.withWarning(ErrorCode.W116);
      } else {
        return r.withWarning(ErrorCode.W117);
      }
    } else if (this.ops.size() == 2) {
      EvaluationResult r = ops.get(0).evaluate(record);
      EvaluationResult formatR = ops.get(1).evaluate(record);
     
View Full Code Here

      } else if (payload instanceof Blob) {
        len = ((Blob) payload).getBytes().length;
      } else if (payload instanceof List<?>) {
        len = ((List<?>) payload).size();
      } else {
        return r.withWarning(ErrorCode.W108);
      }
     
      // only long / double / bigdecimal is supported
      return new EvaluationResult(new Long(len), r);
    } else {
View Full Code Here

    } else if (this.ops.size() == 1) {
      EvaluationResult r = ops.get(0).evaluate(record);
      if (r.getPayload() instanceof String) {
        return new EvaluationResult(((String)r.getPayload()).toLowerCase(), r);
      } else {
        return r.withWarning(ErrorCode.W104);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W102);
    }
  }
View Full Code Here

        return new EvaluationResult(new BlobFileRefWrapper(record.lookupFileReference(index)))
      } catch (IndexOutOfBoundsException e) {
        throw new YaacException(ErrorCode.E303, null);
      }
    } else {
      return r.withWarning(ErrorCode.W137);
    }
  }
}
View Full Code Here

   
    if (r.getPayload() instanceof String) {
      Category val = new Category((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W134);
    }
  }
}
View Full Code Here

   
    if (r.getPayload() instanceof String) {
      Link val = new Link((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W135);
    }
  }
}
View Full Code Here

   
    if (r.getPayload() instanceof Number) {
      Number val = (Number) r.getPayload();
      return new EvaluationResult(val.longValue(), r)
    } else {
      return r.withWarning(ErrorCode.W138);
    }
  }
}
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.