Examples of ResultException


Examples of org.dmd.util.exceptions.ResultException

          index.set(index.intValue()-1);
          break;
        }
        else{
          // ERROR Expecting }
          ResultException ex = new ResultException();
          ex.addError("Expecting closing bracket for object.");
          throw(ex);
        }
      }
     
    }
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

        else if (input.charAt(index.intValue()) == ','){
          // Go around for another attribute
        }
        else{
          // Don't know what the heck this is
          ResultException ex = new ResultException();
          ex.addError("Malformed array - value followed by unrecognized character: " + input.charAt(index.intValue()));
          throw(ex);
        }
      }
    }
  }
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

        break;
      }
    }
   
    if (index.intValue() == input.length()){
      ResultException ex = new ResultException();
      ex.addError("Ran out of characters while expecting to find: " + message);
      throw(ex);
    }
  }
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

    // Grab the string between the quotes
    rc = input.substring(quote1+1,quote2);
   
    // If it's empty, pitch a fit
    if (rc.length() == 0){
      ResultException ex = new ResultException();
      ex.addError("Empty string while trying to parse " + message + " at index: " + index.intValue() + " in input string: " + input);
      throw(ex);
    }
   
    index.set(colon + 1);
   
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

    // Grab the string between the quotes
    rc = input.substring(quote1+1,quote2);
   
    // If it's empty, pitch a fit
    if (rc.length() == 0){
      ResultException ex = new ResultException();
      ex.addError("Empty string while trying to parse " + message + " at index: " + index.intValue() + " in input string: " + input);
      throw(ex);
    }
   
    index.set(quote2 + 1);
   
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

   * @param message
   * @return
   */
  private int indexOf(String instr, String substr, int after, String message) throws ResultException {
    if (after >= instr.length()){
      ResultException ex = new ResultException();
      ex.addError("Ran out of input while trying to find: " + substr + "  at offset: " + after + "  in input string: " + instr );
      throw(ex);
    }
   
    int rc = instr.indexOf(substr,after);
   
    if (rc == -1){
      ResultException ex = new ResultException();
      ex.addError(message + instr);
      throw(ex);
    }
   
    return(rc);
  }
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

   */
  public void findConfigs() throws ResultException, IOException {
    debugMessage("Finding configs:\n\n" + getSearchInfo() + "\n");
   
    if (suffixes.size() == 0){
      ResultException ex = new ResultException("You must specify at least one suffix to hunt for using the addSuffix() method");
      throw(ex);
    }
   
    for(String d : sourceDirs)
      findConfigsRecursive(new File(d));
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

          }
        }
      }
    }
    else{
      ResultException ex = new ResultException();
      ex.addError("Specified source directory doesn't exist: " + dir.getCanonicalPath());
      throw(ex);
    }
  }
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

 
  public void addVersion(ConfigLocation newVersion) throws ResultException {
    if (name == null)
      name = newVersion.getConfigName();
    else if (!name.equals(newVersion.getConfigName())){
      ResultException ex = new ResultException("Name mismatch for ConfigVersion.");
      ex.result.lastResult().moreMessages(DebugInfo.getCurrentStack());
      throw(ex);
    }
   
    ConfigLocation existing = versions.get(newVersion.getVersion());
     
    if (existing == null){
      versions.put(newVersion.getVersion(),newVersion);
    }
    else{
      if ( (existing.getJarFilename() != null) && (newVersion.getJarFilename() != null)){
        // Some trickiness here. If we're grabbing stuff from jars, we might have jars
        // where one jar prefix is a substring of another jar e.g. dark-matter-mvw and
        // dark-matter-mvwgxt. We'll wind up parsing dark-matter-mvwgxt twice, so we
        // what to be able to ignore cases where the jar names are equal
        if (existing.getJarFilename().equals(newVersion.getJarFilename()))
          return;
       
        // We may include the same jar from two different paths, so if the jar file names
        // match, we ignore the new one.
        if (existing.getJustJarFilename().equals(newVersion.getJustJarFilename()))
          return;
      }
     
      // We have a clashing version
      ResultException ex = new ResultException("Clashing versions for the " + name + " configuration file.");
      ex.result.lastResult().moreMessages("Originally from: " + existing.getFileName());
      if (existing.getJarFilename() != null)
        ex.result.lastResult().moreMessages("              in .jar: " + existing.getJarFilename());
      ex.result.lastResult().moreMessages("Clashing version from: " + newVersion.getFileName());
      if (newVersion.getJarFilename() != null)
View Full Code Here

Examples of org.dmd.util.exceptions.ResultException

    if (refs != null){
      while(refs.hasNext()){
        String ref = refs.next();
        ConfigVersion cv = finder.getConfig(ref);
        if (cv == null){
          ResultException ex = new ResultException();
          ex.addError("MVW config not found: " + ref);
          ex.setLocationInfo(currentModule.getFile(), currentModule.getLineNumber());
          throw(ex);
        }
       
//        DebugInfo.debug("parseConfigInternal()\n\n" + cv.getLatestVersion().toString());
       
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.