Package com.ardor3d.annotation

Examples of com.ardor3d.annotation.SavableFactory


            final Savable out;

            try {
                @SuppressWarnings("unchecked")
                final Class<? extends Savable> clazz = (Class<? extends Savable>) Class.forName(bco._className);
                final SavableFactory ann = clazz.getAnnotation(SavableFactory.class);
                if (ann == null) {
                    out = clazz.newInstance();
                } else {
                    out = (Savable) clazz.getMethod(ann.factoryMethod(), (Class<?>[]) null).invoke(null,
                            (Object[]) null);
                }
            } catch (final InstantiationException e) {
                logger.logp(Level.SEVERE, this.getClass().toString(), "readObject(int)",
                        "Could not access constructor of class '" + bco._className + "'! \n"
View Full Code Here


            }

            try {
                @SuppressWarnings("unchecked")
                final Class<? extends Savable> clazz = (Class<? extends Savable>) Class.forName(className);
                final SavableFactory ann = clazz.getAnnotation(SavableFactory.class);
                if (ann == null) {
                    tmp = clazz.newInstance();
                } else {
                    tmp = (Savable) clazz.getMethod(ann.factoryMethod(), (Class<?>[]) null).invoke(null,
                            (Object[]) null);
                }
            } catch (final InstantiationException e) {
                Logger.getLogger(getClass().getName()).logp(
                        Level.SEVERE,
View Full Code Here

    private Spatial duplicate() {
        Spatial spat = null;
        final Class<? extends Spatial> clazz = getClass();
        try {
            final SavableFactory ann = clazz.getAnnotation(SavableFactory.class);
            if (ann == null) {
                spat = clazz.newInstance();
            } else {
                spat = (Spatial) clazz.getMethod(ann.factoryMethod(), (Class<?>[]) null).invoke(null, (Object[]) null);
            }
        } catch (final InstantiationException e) {
            logger.log(Level.SEVERE, "Could not access final constructor of class " + clazz.getCanonicalName(), e);
            throw new RuntimeException(e);
        } catch (final IllegalAccessException e) {
View Full Code Here

TOP

Related Classes of com.ardor3d.annotation.SavableFactory

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.