Package net.datacrow.core.modules

Examples of net.datacrow.core.modules.InvalidValueException


    public static KeyStroke getKeyStroke(Element element, String tag) throws InvalidValueException {
        String s = getString(element, tag);
        try {
            return KeyStroke.getKeyStroke(s);
        } catch (Exception e) {
            throw new InvalidValueException(tag, s);
        }       
    } 
View Full Code Here


    public static ImageIcon getIcon(Element element, String tag) throws InvalidValueException {
        String s = getString(element, tag);
        try {
            return new ImageIcon(s);
        } catch (Exception e) {
            throw new InvalidValueException(tag, s);
        }       
    }    
View Full Code Here

    public static File getFile(Element element, String tag) throws InvalidValueException {
        String s = getString(element, tag);
        try {
            return new File(s);
        } catch (Exception e) {
            throw new InvalidValueException(tag, s);
        }       
    }   
View Full Code Here

    public static boolean getBoolean(Element element, String tag) throws InvalidValueException {
        String s = getString(element, tag);
        try {
            return Boolean.valueOf(s).booleanValue();
        } catch (NumberFormatException nfe) {
            throw new InvalidValueException(tag, s);
        }       
    }   
View Full Code Here

    public static int getInt(Element element, String tag) throws InvalidValueException {
        String s = getString(element, tag);
        try {
            return Integer.parseInt(s);
        } catch (NumberFormatException nfe) {
            throw new InvalidValueException(tag, s);
        }
    }
View Full Code Here

            Class cl = s != null && s.trim().length() > 0 ? Class.forName(s) : null;
            if (cl != null && !instantiationTest)
                cl.getConstructors()[0].newInstance(new Object[] {});
            return cl;
        } catch (ClassNotFoundException e) {
            throw new InvalidValueException(tag, s);
        } catch (InstantiationException e) {
            throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
        } catch (IllegalAccessException e) {
            throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
        } catch (IllegalArgumentException e) {
            throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);       
        } catch (SecurityException e) {
            throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
        } catch (InvocationTargetException e) {
            throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
        }
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.modules.InvalidValueException

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.