Package it.halfone.exception

Examples of it.halfone.exception.InvalidDocumentException


      token = token.replaceFirst("([a-zA-Z]\\w*)", TokenParser.ID + index);
      if (matcher.group(1).equals(ruleName)) {
        regexList.add(Regex.self());
      } else {
        if (existingRuleMap.get(matcher.group(1)) == null) {
          throw new InvalidDocumentException("No rule with id " + matcher.group(1));
        }
        regexList.add(existingRuleMap.get(matcher.group(1)));
      }
      ctx.setValue("token", token);
      ctx.setValue("index", ++index);
View Full Code Here


        }
        matcher = DEF_PATTERN.matcher(definition);
        if (matcher.find()) {
          retVal = matcher.group(2);
          if(ruleMap.get(retVal) != null){
            throw new InvalidDocumentException("Duplicated rule name :: " + retVal);
          }
          validRule = true;
          String value = matcher.group(3);
          Regex rule;
          validRule = ((rule = parseToken(retVal, value, ruleMap)) != null);
          rule = rule.close();
          retVal = matcher.group(2);
          if (matcher.group(1) != null) {
            rule = rule.mark(retVal);
          }
          ruleMap.put(retVal, rule);
        }
      }
      if (validRule == false) {
        throw new InvalidDocumentException("Not a valid line :: " + definition);
      }
    }
    in.close();
   
    return retVal;
View Full Code Here

     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
      throw new InvalidDocumentException("Invalid token::" + unmodifiedToken);
    }
  }
View Full Code Here

        }
        matcher = DEF_PATTERN.matcher(definition);
        if (matcher.find()) {
          retVal = matcher.group(2);
          if(ruleMap.get(retVal) != null){
            throw new InvalidDocumentException("Duplicated rule name :: " + retVal);
          }
          validRule = true;
          String value = matcher.group(3);
          Regex rule;
          validRule = ((rule = parseToken(retVal, value, ruleMap)) != null);
          rule = rule.close();
          retVal = matcher.group(2);
          if (matcher.group(1) != null) {
            rule = rule.mark(retVal);
          }
          ruleMap.put(retVal, rule);
        }
      }
      if (validRule == false) {
        throw new InvalidDocumentException("Not a valid line :: " + definition);
      }
    }
    in.close();
   
    return retVal;
View Full Code Here

     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
      throw new InvalidDocumentException("Invalid token");
    }
  }
View Full Code Here

       
        Pair<String> parsingResult = null;
        try {
          parsingResult = parseLiteral(token, replacement);
        }catch(Exception e){
          throw new InvalidDocumentException("Invalid literal value");
        }
       
      if(parsingResult.getFirst().length() == 0){
        throw new InvalidDocumentException("Invalid literal value :: a literal value can't be the empty string");
      }
     
      regexList.add(Regex.literal(parsingResult.getFirst()));
     
      token = parsingResult.getSecond();
View Full Code Here

        }
        matcher = DEF_PATTERN.matcher(definition);
        if (matcher.find()) {
          retVal = matcher.group(2);
          if(ruleMap.get(retVal) != null){
            throw new InvalidDocumentException("Duplicated rule name :: " + retVal);
          }
          validRule = true;
          String value = matcher.group(3);
          Regex rule;
          validRule = ((rule = parseToken(retVal, value, ruleMap)) != null);
          rule = rule.close();
          retVal = matcher.group(2);
          if (matcher.group(1) != null) {
            rule = rule.mark(retVal);
          }
          ruleMap.put(retVal, rule);
        }
      }
      if (validRule == false) {
        throw new InvalidDocumentException("Not a valid line :: " + definition);
      }
    }
    in.close();
   
    return retVal;
View Full Code Here

     
    if (Pattern.matches(TokenParser.ID + "[\\d]+", token)) {
      Regex retVal = regexList.get(index - 1);
      return retVal;
    } else {
      throw new InvalidDocumentException("Invalid token::" + unmodifiedToken);
    }
  }
View Full Code Here

TOP

Related Classes of it.halfone.exception.InvalidDocumentException

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.