Package org.dmd.util.exceptions

Examples of org.dmd.util.exceptions.ResultException


  void addRequest(RequestTypeWithOptions rtwo) throws ResultException{
    CommsHandler ch = new CommsHandler(methodID++, rtwo);
    CommsHandler existing = commsHandlers.get(ch.key);
   
    if (existing != null){
      ResultException ex = new ResultException();
      ex.addError("Duplicate function names for sendRequest attributes in a component: " + rtwo.getFunctionName());
      ex.result.lastResult().moreMessages("Existing request: sends" + existing.requestType + "Request");
      ex.result.lastResult().moreMessages(" Another request: sends" + rtwo.getRequestType() + "Request");     
      ex.setLocationInfo(getFile(), getLineNumber());
      throw(ex);
    }
   
    commsHandlers.put(ch.key, ch);
   
View Full Code Here


  }
 
  public void initLabelInfo(RunContextItemCollection context) throws ResultException {
    if (getDisplayLabel() == null){
      if (getDisplayLabelI18N() == null){
        ResultException errors  = new ResultException();
        errors.addError("The " + getElementName() + " MenuItem must have either a displayLabel or a displayLabelI18N defined.");
        errors.result.lastResult().fileName(getFile());
        errors.result.lastResult().lineNumber(getLineNumber());     
        throw(errors);
      }
      int period = getDisplayLabelI18N().indexOf(".");
      if (period == -1){
        ResultException errors  = new ResultException();
        errors.addError("The " + getElementName() + " MenuItem has a malformed displayLabelI18N: " + getDisplayLabelI18N());
        errors.result.lastResult().fileName(getFile());
        errors.result.lastResult().lineNumber(getLineNumber());     
        throw(errors);
      }
      String rciString = getDisplayLabelI18N().substring(0, period).trim();
     
      RunContextItem rci = context.getItem(rciString);
     
      if (rci == null){
        ResultException errors  = new ResultException();
        errors.addError("The " + getElementName() + " MenuItem refers to an unknown RunContextItem in its displayLabelI18N: " + rciString);
        errors.result.lastResult().fileName(getFile());
        errors.result.lastResult().lineNumber(getLineNumber());     
        throw(errors);
      }
      I18NRCI = rci;
View Full Code Here

  }
 
  public void validateImplementations(TreeMap<CamelCaseName, MenuElementDefinitionDMW> menuElements) throws ResultException {
    initialize();
   
    ResultException errors = null;
   
    for(MenuElementDefinitionDMW def: menuElements.values()){
      if (def instanceof MenuBar){
        if (def.getUseImpl() == null)
          def.setUseImpl(getDefaultMenuBar().getType());
        else if (menubarTypes.get(def.getUseImpl()) == null){
          if (errors == null)
            errors = new ResultException();
          errors.addError("Invalid implementation (useImpl) for MenuBar: " + def.getUseImpl());
          errors.result.lastResult().fileName(def.getFile());
          errors.result.lastResult().lineNumber(def.getLineNumber());
        }
      }
      else if (def instanceof MenuItem){
        if (def.getUseImpl() == null)
          def.setUseImpl(getDefaultMenuItem().getType());
        else if (menuItemTypes.get(def.getUseImpl()) == null){
          if (errors == null)
            errors = new ResultException();
          errors.addError("Invalid implementation (useImpl) for MenuItem: " + def.getUseImpl());
          errors.result.lastResult().fileName(def.getFile());
          errors.result.lastResult().lineNumber(def.getLineNumber());
        }
      }
      else if (def instanceof SubMenu){
        if (def.getUseImpl() == null)
          def.setUseImpl(getDefaultSubMenu().getType());
        else if (submenuTypes.get(def.getUseImpl()) == null){
          if (errors == null)
            errors = new ResultException();
          errors.addError("Invalid implementation (useImpl) for SubMenu: " + def.getUseImpl());
          errors.result.lastResult().fileName(def.getFile());
          errors.result.lastResult().lineNumber(def.getLineNumber());
        }
      }
      else if (def instanceof Separator){
        if (def.getUseImpl() == null)
          def.setUseImpl(getDefaultSeparator().getType());
        else if (separatorTypes.get(def.getUseImpl()) == null){
          if (errors == null)
            errors = new ResultException();
          errors.addError("Invalid implementation (useImpl) for Separator: " + def.getUseImpl());
          errors.result.lastResult().fileName(def.getFile());
          errors.result.lastResult().lineNumber(def.getLineNumber());
        }
      }
     
View Full Code Here

  }
 
  DisplayDataSpec checkVarName(String varname, String attribute) throws ResultException{
    DisplayDataSpec spec = displayData.get(varname);
    if (spec == null){
      ResultException ex = new ResultException();
      ex.addError("Unknown varname for " + attribute + ": " + varname);
      ex.result.lastResult().lineNumber(getLineNumber());
      ex.result.lastResult().fileName(getFile());
      throw(ex);
    }
    return(spec);
View Full Code Here

TOP

Related Classes of org.dmd.util.exceptions.ResultException

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.