Package org.springmodules.xt.model.introductor.support

Examples of org.springmodules.xt.model.introductor.support.IllegalReturnTypeException


    private Object readProperty(final Object[] args, final Method method) {
        if (args != null && args.length != 0) {
            throw new IllegalStateException("The getter method " + method.getName() + " must have no arguments!");
        }
        if (method.getReturnType().isPrimitive()) {
            throw new IllegalReturnTypeException("Return types cannot be primitives.");
        } else {
            String name = null;
            if (method.getName().startsWith("get")) {
                name = StringUtils.uncapitalize(method.getName().substring(3));
            } else {
View Full Code Here


        logger.debug("Introducing method: " + method.getName());
        Object result = null;
        try {
            if (method.getName().startsWith("get")) {
                if (method.getReturnType().isPrimitive()) {
                    throw new IllegalReturnTypeException("Return types of your introduced interfaces cannot be primitives.");
                }
                result = this.fields.get(method.getName().substring(3));
            }
            else if (method.getName().startsWith("is")) {
                if (method.getReturnType().isPrimitive()) {
                    throw new IllegalReturnTypeException("Return types of your introduced interfaces cannot be primitives.");
                }
                result = this.fields.get(method.getName().substring(2));
            }
            else if (method.getName().startsWith("set")) {
                if (methodInvocation.getArguments().length != 1) {
View Full Code Here

TOP

Related Classes of org.springmodules.xt.model.introductor.support.IllegalReturnTypeException

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.