Package org.dmd.dmc

Examples of org.dmd.dmc.DmcValueException


  }
 
  public ClassFilter(String cn) throws DmcValueException {
    ci = DmcOmni.instance().getClassInfo(cn);
    if (ci == null)
      throw(new DmcValueException("Unknown class passed to ClassFilter: " + cn));     
  }
View Full Code Here


      // TODO: implement DmcOmni for filter types
//      DmcTypeDmcObjectName<?> on = DmcOmni.instance().buildName((DmcObjectName)value);
//      return(new NameContainer(on));
      return(null);
    }
        throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with FilterContainer/DmcFilter expected."));
  }
View Full Code Here

      return((NameContainer)value);
    else if (value instanceof DmcObjectName){
      DmcTypeDmcObjectName<?> on = DmcOmni.instance().buildName((DmcObjectName)value);
      return(new NameContainer(on));
    }
        throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with NameContainer/DmcObjectName expected."));
  }
View Full Code Here

        else if (value instanceof CamelCaseName)
            rc = new FormImplementationConfigREF((CamelCaseName)value);
        else if (value instanceof String)
            rc = new FormImplementationConfigREF((String)value);
        else
            throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with FormImplementationConfigREF, FormImplementationConfigDMO or String expected."));

        return(rc);
    }
View Full Code Here

    if (getAttributeInfo().valueType == ValueTypeEnum.SINGLE){
      HELPER ref = getSV();
      if (ref.getObject() == null){
        DmcNamedObjectIF obj = (DmcNamedObjectIF) rx.findNamedDMO(ref.getObjectName());
        if (obj == null)
          throw(new DmcValueException("Could not resolve reference to: " + ref.getObjectName() + " via attribute: " + getName()));
         
        ref.setObject(obj);
      }
    }
    else{
      Iterator<HELPER> it = getMV();
      if (it != null){
        while(it.hasNext()){
          HELPER ref = it.next();
          if (ref.getObject() == null){
            DmcNamedObjectIF obj = (DmcNamedObjectIF) rx.findNamedDMO(ref.getObjectName());
            if (obj == null)
              throw(new DmcValueException("Could not resolve reference to: " + ref.getObjectName() + " via attribute: " + getName()));
             
            ref.setObject(obj);
          }
        }
      }
View Full Code Here

          String v = (String)value;
          try{
            rc = Byte.valueOf(v);
          }
          catch(NumberFormatException e){
            throw(new DmcValueException("Invalid Byte value: " + v));
          }
        }
        else{
            throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with Byte expected."));
        }
       
        return(rc);
  }
View Full Code Here

        else if (value instanceof String){
            rc = new TypeDefinitionREF();
            rc.setName(new StringName((String)value));
        }
        else
            throw(new DmcValueException("Object of class:" + value.getClass().getName() + " passed where a TypeDefinitionREF/DMO or DmcObjectName expected."));
        return(rc);
    }
View Full Code Here

        else if (value instanceof String){
            rc = new ActionDefinitionREF();
            rc.setName(new StringName((String)value));
        }
        else
            throw(new DmcValueException("Object of class:" + value.getClass().getName() + " passed where a ActionDefinitionREF/DMO or DmcObjectName expected."));
        return(rc);
    }
View Full Code Here

   * @throws ResultException If the specified string doesn't match the appropriate
   * value format.
   */
  public void set(String v) throws DmcValueException {
    if (v == null){
      throw(new DmcValueException("null value passed to EnumValue.set()"));
    }
   
    String value = v.replaceAll("\t", " ").trim();
   
    int space = value.indexOf(" ");
    if (space == -1)
      throw(new DmcValueException("Missing enum value name: " + value + " - value should be of the form: int enum_val_name [description] <: label>"));
   
    try {
      id = Integer.valueOf(value.substring(0,space));
    } catch (NumberFormatException e) {
      throw(new DmcValueException("Invalid enum integer value: " + value + "\n" + e));
    }
   
    String remainder = value.substring(space+1).trim();
    space = remainder.indexOf(" ");
   
    if (space == -1)
      throw(new DmcValueException("Missing enum description: " + value + " - value should be of the form: int enum_val_name [description] <: label>"));
   
    String tmp = remainder.substring(0,space);
    if (Character.isLetter(tmp.charAt(0))){
      name = tmp.toUpperCase();
    }
    else{
      throw(new DmcValueException("Enum value name must start with a character: " + tmp));
    }
   
    remainder = remainder.substring(space+1).trim();
    int colon = remainder.indexOf(":");
   
    if (colon == -1){
      description = remainder.trim();
    }
    else{
      description = remainder.substring(0,colon).trim();
     
      if ( (colon+1) == remainder.length()){
        throw(new DmcValueException("Missing label value: " + value + " - value should be of the form: int enum_val_name [description] <: label>"));
      }
     
      label = remainder.substring(colon+1).trim();
    }
   
View Full Code Here

        else if (value instanceof CamelCaseName)
            rc = new PresenterREF((CamelCaseName)value);
        else if (value instanceof String)
            rc = new PresenterREF((String)value);
        else
            throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with PresenterREF, PresenterDMO or String expected."));

        return(rc);
    }
View Full Code Here

TOP

Related Classes of org.dmd.dmc.DmcValueException

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.