Examples of InvalidDocumentException


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

Examples of it.halfone.exception.InvalidDocumentException

        }
        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

Examples of it.halfone.exception.InvalidDocumentException

     
    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

Examples of it.halfone.exception.InvalidDocumentException

        }
        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

Examples of it.halfone.exception.InvalidDocumentException

     
    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

Examples of it.halfone.exception.InvalidDocumentException

       
        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

Examples of it.halfone.exception.InvalidDocumentException

        }
        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

Examples of it.halfone.exception.InvalidDocumentException

     
    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

Examples of org.pentaho.platform.plugin.action.mondrian.InvalidDocumentException

  }

  public void testInvalidDocumentException1() {
    startTest();
    info( "Expected: Exception will be caught and thrown as a Invalid Document Exception" ); //$NON-NLS-1$
    InvalidDocumentException ide1 = new InvalidDocumentException( "A test Invalid Document Exception has been thrown" ); //$NON-NLS-1$
    System.out.println( "Invalid Document Exception :" + ide1 ); //$NON-NLS-1$   
    assertTrue( true );
    finishTest();
  }
View Full Code Here

Examples of org.pentaho.platform.plugin.action.mondrian.InvalidDocumentException

  }

  public void testInvalidDocumentException2() {
    startTest();
    info( "Expected: A Invalid Document Exception will be created with Throwable as a parameter" ); //$NON-NLS-1$
    InvalidDocumentException ide2 = new InvalidDocumentException( new Throwable( "This is a throwable exception" ) ); //$NON-NLS-1$
    System.out.println( "Invalid Document Exception :" + ide2 ); //$NON-NLS-1$   
    assertTrue( true );
    finishTest();

  }
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.