Package de.tuhrig.thofu.types

Examples of de.tuhrig.thofu.types.LException


   */
  @Override
  public void validate(final String expression) {

    if (!expression.trim().startsWith(LEFT_PARENTHESIS) && !expression.trim().startsWith(QUOTED_LEFT_PARENTHESIS))
      throw new LException(LException.MISSING_INITIAL_OPENING + expression);

    if (!expression.trim().endsWith(RIGHT_PARENTHESIS))
      throw new LException(LException.MISSING_FINAL_CLOSING + expression);

    int count = 0;

    char[] chars = expression.toCharArray();

    for (int i = 0; i < chars.length; i++) {

      char currentChar = chars[i];

      if (SINGLE_QUOTE.equals(String.valueOf(currentChar)) && i == 0)
        continue;

      if (LEFT_PARENTHESIS.equals(String.valueOf(currentChar)))
        count++;

      if (RIGHT_PARENTHESIS.equals(String.valueOf(currentChar)))
        count--;

      if (i == chars.length - 1 && count > 0)
        throw new LException(LException.MISSING_CLOSING);

      if (i != chars.length - 1 && count <= 0)
        throw new LException(LException.MISSING_OPENING_NEAR_INDEX + i);
    }
  }
View Full Code Here


   */
  @Override
  public void validate(String expression) {

    if(!(expression.endsWith(";") || expression.endsWith("}")))
      throw new LException("Missing termination character");
  }
View Full Code Here

      this.result = FieldUtils.readDeclaredStaticField(c, fieldName);
    }
    catch (Exception e) {

      throw new LException("[" + e.getClass() + "] - " + e.getMessage(), e);
    }
   
    return this;
  }
View Full Code Here

       
        result = LJava.getClass(className);
      }
      catch (Exception e) {

        throw new LException("[" + e.getClass() + "] - " + e.getMessage(), e);
      }
    }
  }
View Full Code Here

          this.result = ConstructorUtils.invokeConstructor(c, args, types);
        }
      }
      catch (Exception e) {
 
        throw new LException("[" + e.getClass() + "] - " + e.getMessage(), e);
      }
    }
   
    return this;
  }
View Full Code Here

TOP

Related Classes of de.tuhrig.thofu.types.LException

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.