Package org.dmd.util.exceptions

Examples of org.dmd.util.exceptions.ResultException.addError()


          throw(ex);
        }
       
        if (checkAndAdd(cd.getObjectName(),cd,allDefs) == false){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(cd.getObjectName(),cd,allDefs,"definition names"));
          throw(ex);
        }
       
        if (cd.getAbbrev() != null){
            // We have an abbreviation - so it must also be unique and
View Full Code Here


            // We have an abbreviation - so it must also be unique and
            // added to the appropriate maps
          StringName abbrevName = new StringName(cd.getAbbrev());
            if (checkAndAdd(abbrevName,cd,classDefs) == false){
              ResultException ex = new ResultException();
              ex.addError(clashMsg(abbrevName,cd,classDefs,"class abbreviations"));
              throw(ex);
            }
            if (checkAndAdd(abbrevName,cd,allDefs) == false){
              ResultException ex = new ResultException();
              ex.addError(clashMsg(abbrevName,cd,allDefs,"definition names"));
View Full Code Here

              ex.addError(clashMsg(abbrevName,cd,classDefs,"class abbreviations"));
              throw(ex);
            }
            if (checkAndAdd(abbrevName,cd,allDefs) == false){
              ResultException ex = new ResultException();
              ex.addError(clashMsg(abbrevName,cd,allDefs,"definition names"));
              throw(ex);
            }
            classAbbrevs.put(abbrevName,cd);
        }
       
View Full Code Here

          cd.setDmdID(base + current);
        }
       
        if (classesByID.get(cd.getDmdID()) != null){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(cd.getDmdID(),cd,classesByID,"dmdID"));
          throw(ex);
        }
        classesByID.put(cd.getDmdID(), cd);
       
        ///////////////////////////////////////////////////////////////////////
View Full Code Here

        // that're loaded.
        try {
      cd.resolveReferences(this);
    } catch (DmcValueExceptionSet e) {     
      ResultException ex = new ResultException();
      ex.addError("Unresolved references in ClassDefinition: " + cd.getName());
//      ex.setLocationInfo(cd.getFile(), cd.getLineNumber());
     
      for(DmcValueException dve : e.getExceptions()){
        ex.moreMessages(dve.getMessage());
      }
View Full Code Here

            // can get by without this
            td.setHelperClassName(cd.getDefinedIn().getSchemaPackage() + ".generated.types." + cd.getName() + "REF");
           
            if (cd.getIsNamedBy().getValueType() != ValueTypeEnum.SINGLE){
              ResultException ex = new ResultException();
              ex.addError("The naming attribute: " + cd.getIsNamedBy().getName() + " for class: " + cd.getName() + " must be valueType SINGLE");
              ex.result.lastResult().fileName(cd.getIsNamedBy().getFile());
              ex.result.lastResult().lineNumber(cd.getIsNamedBy().getLineNumber());
              throw(ex);
            }
          }
View Full Code Here

     */
    void addAttribute(AttributeDefinition ad) throws ResultException, DmcValueException {
     
        if (checkAndAdd(ad.getObjectName(),ad,attrDefs) == false){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(ad.getObjectName(),ad,attrDefs,"attribute names"));
          throw(ex);
        }
        if (checkAndAdd(ad.getObjectName(),ad,allDefs) == false){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(ad.getObjectName(),ad,allDefs,"definition names"));
View Full Code Here

          ex.addError(clashMsg(ad.getObjectName(),ad,attrDefs,"attribute names"));
          throw(ex);
        }
        if (checkAndAdd(ad.getObjectName(),ad,allDefs) == false){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(ad.getObjectName(),ad,allDefs,"definition names"));
          throw(ex);
        }
       
        if (ad.getDmdID() == null){
          ResultException ex = new ResultException("Missing dmdID for attribute: " + ad.getName());
View Full Code Here

          ad.setDmdID(base + current);
        }
       
      if (attrByID.get(ad.getDmdID()) != null){
          ResultException ex = new ResultException();
          ex.addError(clashMsg(ad.getDmdID(),ad,attrByID,"dmdID"));
          throw(ex);
        }
        attrByID.put(ad.getDmdID(), ad);
       
        if (ad.getAbbrev() != null){
View Full Code Here

            // We have an abbreviation - so it must also be unique and
            // added to the appropriate maps
          StringName abbrevName = new StringName(ad.getAbbrev());
            if (checkAndAdd(abbrevName,ad,attrDefs) == false){
              ResultException ex = new ResultException();
              ex.addError(clashMsg(ad.getObjectName(),ad,attrDefs,"attribute abbreviation"));
              throw(ex);
            }
            if (checkAndAdd(abbrevName,ad,allDefs) == false){
              ResultException ex = new ResultException();
              ex.addError(clashMsg(ad.getObjectName(),ad,allDefs,"definition names"));
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.