Package org.apache.isis.core.metamodel.spec

Examples of org.apache.isis.core.metamodel.spec.ObjectInstantiationException


     * way.
     */
    @Override
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException e) {
            throw new ObjectInstantiationException(e);
        } catch (final InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here


     * way.
     */
    @Override
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException e) {
            throw new ObjectInstantiationException(e);
        } catch (final InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here

        if (mode == Mode.STRICT && getServicesInjector() == null) {
            throw new IllegalStateException("ServicesInjector has not been injected into ObjectFactory");
        }
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        final T newInstance = doInstantiate(cls);

        if (getServicesInjector() != null) {
            getServicesInjector().injectServicesInto(newInstance);
View Full Code Here

        if (mode == Mode.STRICT && getServicesInjector() == null) {
            throw new IllegalStateException("ServicesInjector is not available (no open session)");
        }
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        final T newInstance = doInstantiate(cls);

        if (getServicesInjector() != null) {
            getServicesInjector().injectServicesInto(newInstance);
View Full Code Here

    /**
     * Simply instantiates reflectively.
     */
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException | InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here

        if (mode == Mode.STRICT && getServicesInjector() == null) {
            throw new IllegalStateException("ServicesInjector has not been injected into ObjectFactory");
        }
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        final T newInstance = doInstantiate(cls);

        if (getServicesInjector() != null) {
            getServicesInjector().injectDependencies(newInstance);
View Full Code Here

     * way.
     */
    @Override
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException e) {
            throw new ObjectInstantiationException(e);
        } catch (final InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here

     * way.
     */
    @Override
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException e) {
            throw new ObjectInstantiationException(e);
        } catch (final InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here

        if (mode == Mode.STRICT && getServicesInjector() == null) {
            throw new IllegalStateException("ServicesInjector has not been injected into ObjectFactory");
        }
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        final T newInstance = doInstantiate(cls);

        if (getServicesInjector() != null) {
            getServicesInjector().injectDependencies(newInstance);
View Full Code Here

     * Simply instantiates reflectively, does not enhance bytecode etc in any way.
     */
    @Override
    protected <T> T doInstantiate(final Class<T> cls) throws ObjectInstantiationException {
        if (Modifier.isAbstract(cls.getModifiers())) {
            throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
        }
        try {
            return cls.newInstance();
        } catch (final IllegalAccessException e) {
            throw new ObjectInstantiationException(e);
        } catch (final InstantiationException e) {
            throw new ObjectInstantiationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.spec.ObjectInstantiationException

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.