Package com.inspiresoftware.lib.dto.geda.exception

Examples of com.inspiresoftware.lib.dto.geda.exception.GeDARuntimeException


        annotationClass = annotation.getClass().getSimpleName();
        for (final String property : availableProperties) {
            try {
                properties.put(property, annotation.getClass().getDeclaredMethod(property).invoke(annotation));
            } catch (Exception exp) {
                throw new GeDARuntimeException("Invalid @" + annotationClass
                        + " annotation proxy access via property: " + property);
            }
        }
    }
View Full Code Here


    /** {@inheritDoc} */
    public <T> T getValue(final String property) {
        if (properties.containsKey(property)) {
            return (T) properties.get(property);
        }
        throw new GeDARuntimeException("Invalid @" + annotationClass
                + " annotation proxy access via property: " + property);

    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContext alias(final String beanKey, final Class representative) {
        if (beanFactory == null) {
            throw new GeDARuntimeException("Alias for " + beanKey + " cannot be registered. Bean factory must be specified. Use constructor DefaultDSLRegistry(BeanFactory)");
        }
        if (entityClass.isInterface()) {
            throw new GeDARuntimeException("No alias for " + beanKey + " as it is mapped to entity interface");
        }
        if (representative == null) {
            this.beanFactory.registerEntity(beanKey, entityClass.getCanonicalName(), entityClass.getCanonicalName());
        } else if (representative.isInterface() && representative.isAssignableFrom(entityClass)) {
            this.beanFactory.registerEntity(beanKey, entityClass.getCanonicalName(), representative.getCanonicalName());
        } else {
            throw new GeDARuntimeException("Alias for " + beanKey + " has invalid interface for given entity class");
        }
        return this;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContextAppender withFieldsSameAsIn(final String beanKey, final String... excluding) {
        if (beanFactory == null) {
            throw new GeDARuntimeException("Bean for key " + beanKey + " cannot be looked up. Bean factory must be specified. Use constructor DefaultDSLRegistry(BeanFactory)");
        }
        final Class clazz = beanFactory.getClazz(beanKey);
        if (clazz == null) {
            throw new GeDARuntimeException("Bean for key " + beanKey + " is not in the bean factory");
        }
        return withFieldsSameAsIn(clazz, excluding);
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoContext alias(final String beanKey) {
        if (beanFactory == null) {
            throw new GeDARuntimeException("Alias for " + beanKey + " cannot be registered. Bean factory must be specified. Use constructor DefaultDSLRegistry(BeanFactory)");
        }
        this.beanFactory.registerDto(beanKey, dtoClass.getCanonicalName());
        return this;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContext forEntity(final Class entityClass) {
        if (entityClass == null) {
            throw new GeDARuntimeException("entityClass must not be null");
        }
        final int hash = entityClass.hashCode();
        if (contexts.containsKey(hash)) {
            return contexts.get(hash);
        }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContext forEntity(final Object entityInstance) {
        if (entityInstance == null) {
            throw new GeDARuntimeException("entityInstance must not be null");
        }
        return forEntity(entityInstance.getClass());
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContext forEntity(final String beanKey) {
        if (beanFactory == null) {
            throw new GeDARuntimeException("Bean factory must be specified. Use constructor DefaultDSLRegistry(BeanFactory)");
        }
        final Class representative = beanFactory.getClazz(beanKey);
        if (representative == null) {
            throw new BeanFactoryUnableToLocateRepresentationException(beanFactory.toString(), "top level", beanKey, false);
        }
View Full Code Here

    }

    /** {@inheritDoc} */
    public DtoEntityContext has(final Class entityClass) {
        if (entityClass == null) {
            throw new GeDARuntimeException("entityClass must not be null");
        }
        int hash = entityClass.hashCode();
        if (contexts.containsKey(hash)) {
            return contexts.get(hash);
        }
View Full Code Here

        if (!contexts.containsValue(ctx)) {
            throw new IllegalArgumentException("This dto does not have a mapping for context with entity: " + ctx.getEntityClass());
        }

        if (beanFactory == null) {
            throw new GeDARuntimeException("Bean factory must be specified. Use constructor DefaultDSLRegistry(BeanFactory)");
        }
        final Class representative = beanFactory.getClazz(beanKey);
        if (representative == null) {
            throw new BeanFactoryUnableToLocateRepresentationException(beanFactory.toString(), "top level", beanKey, false);
        }
View Full Code Here

TOP

Related Classes of com.inspiresoftware.lib.dto.geda.exception.GeDARuntimeException

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.