Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.ValidityException


     *      value is not a valid date pattern.
     */   
    public void setConfiguration(Properties config) throws ValidityException {
      String pattern = config.getProperty("date-format");
      if (pattern == null) {
        throw new ValidityException("Required parameter \"date-format\" is missing for CustomDateFieldHandler.");
      }
      try {
        formatter = new SimpleDateFormat(pattern);
      } catch (IllegalArgumentException e) {
        throw new ValidityException("Pattern \""+pattern+"\" is not a valid date format.");
      }
    }
View Full Code Here


    }

    public void setConfiguration(Properties config) throws ValidityException {
      String pattern = config.getProperty("date-format");
      if (pattern == null) {
        throw new ValidityException("Required parameter \"date-format\" is missing for CustomDateFieldHandler.");
      }
      try {
        formatter = new SimpleDateFormat(pattern);
      } catch (IllegalArgumentException e) {
        throw new ValidityException("Pattern \""+pattern+"\" is not a valid date format.");
      }
    }
View Full Code Here

        throws ValidityException, IllegalStateException
    {
        // Object cannot be saved if one of the required fields is null
        for ( int i = 0 ; i < _fields.length ; ++i ) {
            if ( _fields[ i ].isRequired() && _fields[ i ].getHandler().getValue( object ) == null )
                throw new ValidityException( "mapping.requiredField",
                                             object.getClass().getName(), _fields[ i ].getFieldName() );
        }
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.ValidityException

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.