Package com.pugh.sockso

Examples of com.pugh.sockso.ValidationException


    private void validateInputFields() throws ValidationException {
   
        final Validater v = new Validater( db );
       
        if ( !v.checkRequiredFields( new JTextComponent[] { txtName, txtPass1, txtEmail }) )
            throw new ValidationException( locale.getString("gui.error.missingField") );
       
        if ( !v.isValidEmail(txtEmail.getText()) )
            throw new ValidationException( locale.getString("gui.error.invalidEmail") );

        String pass1 = new String( txtPass1.getPassword() );
        String pass2 = new String( txtPass2.getPassword() );
        if ( !pass1.equals(pass2) )
            throw new ValidationException( locale.getString("gui.error.passwordsDontMatch") );

        if ( v.usernameExists(txtName.getText()) )
            throw new ValidationException( locale.getString("gui.error.duplicateUsername") );

        if ( v.emailExists(txtEmail.getText()) )
            throw new ValidationException( locale.getString("gui.error.duplicateEmail") );

    }
View Full Code Here


            final String pass = args[ 2 ];
            final String email = args[ 3 ];
            final String isAdmin = args[ 4 ];

            if ( v.usernameExists(name) ) {
                throw new ValidationException( locale.getString("con.err.usernameExists") );
            }

            if ( v.emailExists(email) ) {
                throw new ValidationException( locale.getString("con.err.emailExists") );
            }

            final User newUser = new User(
                name,
                pass,
View Full Code Here

TOP

Related Classes of com.pugh.sockso.ValidationException

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.