Package org.codehaus.groovy.runtime.typehandling

Examples of org.codehaus.groovy.runtime.typehandling.GroovyCastException


            return asType((Object) cl, clazz);
        } catch (GroovyCastException ce) {
            try {
                return ProxyGenerator.INSTANCE.instantiateAggregateFromBaseClass(cl, clazz);
            } catch (GroovyRuntimeException cause) {
                throw new GroovyCastException("Error casting closure to " + clazz.getName() +
                        ", Reason: " + cause.getMessage());
            }
        }
    }
View Full Code Here


            return asType((Object) map, clazz);
        } catch (GroovyCastException ce) {
            try {
                return ProxyGenerator.INSTANCE.instantiateAggregateFromBaseClass(map, clazz);
            } catch (GroovyRuntimeException cause) {
                throw new GroovyCastException("Error casting map to " + clazz.getName() +
                        ", Reason: " + cause.getMessage());
            }
        }
    }
View Full Code Here

  public static <T> T coerce(Object obj, Class<? extends T>... types) {
    if (types.length == 0) {
      throw new IllegalArgumentException("caller must provide at least one target type");
    }

    GroovyCastException lastException = null;

    for (Class<? extends T> type : types) {
      try {
        return GroovyRuntimeUtil.coerce(obj, type);
      } catch (GroovyCastException e) {
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.runtime.typehandling.GroovyCastException

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.