Package com.orientechnologies.orient.core.processor

Examples of com.orientechnologies.orient.core.processor.OProcessException


  protected Object delegate(final String iElementName, final OComposableProcessor iManager, final Object iContent,
      final OCommandContext iContext, ODocument iOutput, final boolean iReadOnly) {
    try {
      return iManager.process(this, iContent, iContext, iOutput, iReadOnly);
    } catch (Exception e) {
      throw new OProcessException("Error on processing '" + iElementName + "' field of '" + getName() + "' block", e);
    }
  }
View Full Code Here


  protected Object delegate(final String iElementName, final OComposableProcessor iManager, final String iType,
      final ODocument iContent, final OCommandContext iContext, ODocument iOutput, final boolean iReadOnly) {
    try {
      return iManager.process(this, iType, iContent, iContext, iOutput, iReadOnly);
    } catch (Exception e) {
      throw new OProcessException("Error on processing '" + iElementName + "' field of '" + getName() + "' block", e);
    }
  }
View Full Code Here

    return true;
  }

  public Object evaluate(final OCommandContext iContext, final String iExpression) {
    if (iExpression == null)
      throw new OProcessException("Null expression");

    final OSQLPredicate predicate = new OSQLPredicate((String) resolveValue(iContext, iExpression, true));
    final Object result = predicate.evaluate(iContext);

    debug(iContext, "Evaluated expression '" + iExpression + "' = " + result);
View Full Code Here

  protected <T> T getFieldOfClass(final OCommandContext iContext, final ODocument iConfig, final String iFieldName,
      Class<? extends T> iExpectedClass, final boolean iCopy) {
    final Object f = resolveValue(iContext, iConfig.field(iFieldName), iCopy);
    if (f != null)
      if (!iExpectedClass.isAssignableFrom(f.getClass()))
        throw new OProcessException("Block '" + getName() + "' defines the field '" + iFieldName + "' of type '" + f.getClass()
            + "' that is not compatible with the expected type '" + iExpectedClass + "'");

    return (T) f;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected <T> T getRequiredField(final OCommandContext iContext, final ODocument iConfig, final String iFieldName) {
    final Object f = iConfig.field(iFieldName);
    if (f == null)
      throw new OProcessException("Block '" + getName() + "' must define the field '" + iFieldName + "'");
    return (T) resolveValue(iContext, f, true);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected <T> T getRequiredFieldOfClass(final OCommandContext iContext, final ODocument iConfig, final String iFieldName,
      Class<? extends T> iExpectedClass) {
    final Object f = getFieldOfClass(iContext, iConfig, iFieldName, iExpectedClass);
    if (f == null)
      throw new OProcessException("Block '" + getName() + "' must define the field '" + iFieldName + "'");
    return (T) resolveValue(iContext, f, true);
  }
View Full Code Here

    return (T) resolveValue(iContext, f, true);
  }

  public void checkForBlock(final Object iValue) {
    if (!isBlock(iValue))
      throw new OProcessException("Block '" + getName() + "' was expecting a block but found object of type " + iValue.getClass());
  }
View Full Code Here

      else if (iValue instanceof Set)
        return new HashSet<Object>((Collection<Object>) iValue);
      else if (iValue instanceof Map)
        return new LinkedHashMap<Object, Object>((Map<Object, Object>) iValue);
      else
        throw new OProcessException("Copy of value '" + iValue + "' of class '" + iValue.getClass() + "' is not supported");
    }
    return iValue;
  }
View Full Code Here

  @Override
  public Object processBlock(OComposableProcessor iManager, final OCommandContext iContext, final ODocument iConfig,
      ODocument iOutput, final boolean iReadOnly) {
    if (!(iConfig instanceof ODocument))
      throw new OProcessException("Content in not a JSON");

    final ODocument table = new ODocument();

    // HEADER
    header = getRequiredField(iContext, iConfig, "header");
View Full Code Here

        result = ((Map<?, ?>) foreach).values();
      else
        result = foreach;

      if (!OMultiValue.isIterable(result))
        throw new OProcessException("Result of 'foreach' block (" + foreach + ") must be iterable but found " + result.getClass());

      for (Object current : OMultiValue.getMultiValueIterable(result)) {
        if (current instanceof Map.Entry)
          current = ((Entry<?, ?>) current).getValue();
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.processor.OProcessException

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.