Package smilehouse.gui.html.fieldbased

Examples of smilehouse.gui.html.fieldbased.GUIException


        PropertyDescriptor descript = getDescriptor(property);
        checkModel(model, property);

        Method write = descript.getWriteMethod();
        if(write == null)
            throw new GUIException("propertysetter_cannot_write_property");

        Object[] args = new Object[1];
        args[0] = value;
       
        //System.out.println("calling runMethod("+write+","+model+","+args+")");
View Full Code Here


        PropertyDescriptor descript = getDescriptor(property);
        checkModel(model, property);

        Method read = descript.getReadMethod();
        if(read == null)
            throw new GUIException("propertysetter_cannot_read_property");

        return runMethod(
            read,
            model,
            null,
View Full Code Here

    /** Helper method to get the Descriptor and to the required classcast. */
    private PropertyDescriptor getDescriptor(String property) throws GUIException {
        PropertyDescriptor descript = (PropertyDescriptor) properties.get(property);
        if(descript == null)
            throw new GUIException("property '"+property+"'_not_found_in_propertysetter");
        return descript;
    }
View Full Code Here

     * Helper method check that the given model isn't null and is the same type of bean that this
     * propertysetter can modify..
     */
    private void checkModel(Object model, String property) throws GUIException {
        if(model == null)
            throw new GUIException("field_model_for_propertysetter_cannot_be_null");
        if(model.getClass() != beanClass)
            throw new GUIException("Wrong model type on property '"+property+"', expected '"+beanClass+"' got '"+model.getClass()+"'.");
    }
View Full Code Here

                             String invocationErrorCode) throws GUIException {

        try {
            return method.invoke(model, args);
        } catch(IllegalAccessException iae) {
            GUIException e = new GUIException(illegalAccessErrorCode);
            e.initCause(iae);
            throw e;
        } catch(InvocationTargetException ite) {
            throw new GUIException("cannot run method", ite);
        } catch(IllegalArgumentException iae) {
            throw new GUIException("cannot set '"+method.getName()+"' with type '"+args[0]+"'",iae);
        }
    }
View Full Code Here

TOP

Related Classes of smilehouse.gui.html.fieldbased.GUIException

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.