Package org.dmd.util.exceptions

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


         
                if (d.getAllowedParentsSize() > 0){
                  // The name must be hierarchic
                  if (d.getIsNamedBy() == null){
                  ResultException ex = new ResultException();
                  ex.addError("The following class indicates that it has allowed parents, but isn't a named object: " + d.getName());
                    throw(ex);
                  }
                  if (!d.getIsNamedBy().getType().getIsHierarchicName()){
                  ResultException ex = new ResultException();
                  ex.addError("The following class indicates that it has allowed parents, but its naming attribute isn't heirarchic: " + d.getName());
View Full Code Here


                  ex.addError("The following class indicates that it has allowed parents, but isn't a named object: " + d.getName());
                    throw(ex);
                  }
                  if (!d.getIsNamedBy().getType().getIsHierarchicName()){
                  ResultException ex = new ResultException();
                  ex.addError("The following class indicates that it has allowed parents, but its naming attribute isn't heirarchic: " + d.getName());
                  ex.result.lastResult().moreMessages("isNamedBy: " + d.getIsNamedBy().getName());
                    throw(ex);
                  }
                }
View Full Code Here

                  }
                }

        } catch (DmcValueExceptionSet e) {
          ResultException ex = new ResultException();
          ex.addError("Unresolved references in ClassDefinition: " + d.getName());
          ex.setLocationInfo(d.getFile(), d.getLineNumber());
         
          for(DmcValueException dve : e.getExceptions()){
            ex.moreMessages(dve.getMessage());
          }
View Full Code Here

          EnumDefinition d = edl.next();
          try {
          d.resolveReferences(this);
        } catch (DmcValueExceptionSet e) {
          ResultException ex = new ResultException();
          ex.addError("Unresolved references in EnumDefinition: " + d.getName());
          ex.setLocationInfo(d.getFile(), d.getLineNumber());
         
          for(DmcValueException dve : e.getExceptions()){
            ex.moreMessages(dve.getMessage());
          }
View Full Code Here

          TypeDefinition d = tdl.next();
          try {
          d.resolveReferences(this);
        } catch (DmcValueExceptionSet e) {
          ResultException ex = new ResultException();
          ex.addError("Unresolved references in TypeDefinition: " + d.getName());
          ex.setLocationInfo(d.getFile(), d.getLineNumber());
         
          for(DmcValueException dve : e.getExceptions()){
            ex.moreMessages(dve.getMessage());
          }
View Full Code Here

          SliceDefinition s = sdl.next();
          try {
          s.resolveReferences(this);
        } catch (DmcValueExceptionSet e) {
          ResultException ex = new ResultException();
          ex.addError("Unresolved references in SliceDefinition: " + s.getName());
          ex.setLocationInfo(s.getFile(), s.getLineNumber());
         
          for(DmcValueException dve : e.getExceptions()){
            ex.moreMessages(dve.getMessage());
          }
View Full Code Here

                  continue;
               
                AttributeDefinition nd = ad.getType().getNameAttributeDef();
                String sn = ad.getDefinedIn().getName().getNameString();
                  ResultException ex = new ResultException();
                  ex.addError("Only one attribute may be defined of type: " + ad.getType().getName());
                  ex.result.lastResult().moreMessages("You must use the \"" + nd.getName() + "\" attribute from the " + sn + " schema.");
                  ex.result.lastResult().moreMessages("This error was caused by the " + ad.getName() + " attribute definition.");
                  throw(ex);
              }
             
View Full Code Here

  @Override
  public void resetParent(HierarchicObject newParent) throws ResultException, DmcValueException {

        if (getName() == null){
          ResultException ex = new ResultException();
          ex.addError("Missing value for dotName. You must set dotName on this object.");
          throw(ex);
        }

        if (newParent == null){
        this.setFQN(getName());
View Full Code Here

      if (!buildFQN)
        return;

        if (getName() == null){
          ResultException ex = new ResultException();
          ex.addError("Missing value for dotName. You must set dotName on this object.");
          throw(ex);
        }
       
      if (parent == null){
        this.setFQN(getName());
View Full Code Here

     * @throws ResultException if there's no value for the naming attribute.
     * @throws DmcValueException
     */
  public void setParentObject(HierarchicObject p, boolean buildFQN) throws ResultException, DmcValueException {
    ResultException ex = new ResultException();
    ex.addError("Cannot set the parent of a root HierarchicObject.");
    throw(ex);
  }
 
    /**
     * This method rehomes a branch of hierarchic objects to sit beneath the specified parent. The method
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.