Package it.halfone.hava.container

Examples of it.halfone.hava.container.Context


   * @param token
   * @return
   */
  private static Regex parseToken(String ruleName, String token, Map<String, Regex> existingRule) throws InvalidDocumentException {
    String unmodifiedToken = token;
    Context ctx = new Context();
    ctx.setValue("index", 0);
      ctx.setValue("token", token);
      ctx.setValue("regexList", new ArrayList<Regex>());
      ctx.setValue("existingRule", existingRule);
      ctx.setValue("ruleName", ruleName);
   
      boolean modified = true;
      while(modified){
        for(TokenParser parser : parsers){
          if(modified = parser.parseToken(ctx)){
            break;
          }
        }
      }

      int index = ctx.getValue("index");
      token = ctx.getValue("token");
      List<Regex> regexList = ctx.getValue("regexList");
     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
View Full Code Here


  /**
   * @param token
   * @return
   */
  private static Regex parseToken(String ruleName, String token, Map<String, Regex> existingRule) throws InvalidDocumentException {
    Context ctx = new Context();
    ctx.setValue("index", 0);
      ctx.setValue("token", token);
      ctx.setValue("regexList", new ArrayList<Regex>());
      ctx.setValue("existingRule", existingRule);
      ctx.setValue("ruleName", ruleName);
   
      boolean modified = true;
      while(modified){
        for(TokenParser parser : parsers){
          if(modified = parser.parseToken(ctx)){
            break;
          }
        }
      }

      int index = ctx.getValue("index");
      token = ctx.getValue("token");
      List<Regex> regexList = ctx.getValue("regexList");
     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
View Full Code Here

   * @param token
   * @return
   */
  private static Regex parseToken(String ruleName, String token, Map<String, Regex> existingRule) throws InvalidDocumentException {
    String unmodifiedToken = token;
    Context ctx = new Context();
    ctx.setValue("index", 0);
      ctx.setValue("token", token);
      ctx.setValue("regexList", new ArrayList<Regex>());
      ctx.setValue("existingRule", existingRule);
      ctx.setValue("ruleName", ruleName);
   
      boolean modified = true;
      while(modified){
        for(TokenParser parser : parsers){
          if(modified = parser.parseToken(ctx)){
            break;
          }
        }
      }

      int index = ctx.getValue("index");
      token = ctx.getValue("token");
      List<Regex> regexList = ctx.getValue("regexList");
     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
View Full Code Here

TOP

Related Classes of it.halfone.hava.container.Context

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.