Examples of returnAs()


Examples of net.sf.autodao.Finder.returnAs()

  private static boolean validateReturnType(@NotNull final Method method) {
    final Finder f = AnnotationUtils.findAnnotation(method, Finder.class);
    final boolean singleFind = !Collection.class.isAssignableFrom(method.getReturnType());
    if (!singleFind) {
      final Class<?> returnType = method.getReturnType();
      if (!returnType.isAssignableFrom(f.returnAs())) {
        throw new SpecificationViolationException(
            "@Finder.returnAs value (" + f.returnAs().getName()
                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

    final boolean singleFind = !Collection.class.isAssignableFrom(method.getReturnType());
    if (!singleFind) {
      final Class<?> returnType = method.getReturnType();
      if (!returnType.isAssignableFrom(f.returnAs())) {
        throw new SpecificationViolationException(
            "@Finder.returnAs value (" + f.returnAs().getName()
                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
        if (f.returnAs().isInterface()) {
          throw new SpecificationViolationException(
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

      if (!returnType.isAssignableFrom(f.returnAs())) {
        throw new SpecificationViolationException(
            "@Finder.returnAs value (" + f.returnAs().getName()
                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
        if (f.returnAs().isInterface()) {
          throw new SpecificationViolationException(
              "@Finder.returnAs value (" + f.returnAs().getName() + ") cannot be an interface", method
          );
        } else {
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

        throw new SpecificationViolationException(
            "@Finder.returnAs value (" + f.returnAs().getName()
                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
        if (f.returnAs().isInterface()) {
          throw new SpecificationViolationException(
              "@Finder.returnAs value (" + f.returnAs().getName() + ") cannot be an interface", method
          );
        } else {
          try {
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
        if (f.returnAs().isInterface()) {
          throw new SpecificationViolationException(
              "@Finder.returnAs value (" + f.returnAs().getName() + ") cannot be an interface", method
          );
        } else {
          try {
            f.returnAs().getConstructor();
          } catch (NoSuchMethodException e) {
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

          throw new SpecificationViolationException(
              "@Finder.returnAs value (" + f.returnAs().getName() + ") cannot be an interface", method
          );
        } else {
          try {
            f.returnAs().getConstructor();
          } catch (NoSuchMethodException e) {
            throw new SpecificationViolationException(
                "@Finder.returnAs value (" + f.returnAs().getName() + ") doesn't have no-arg constructor.", method
            );
          }
View Full Code Here

Examples of net.sf.autodao.Finder.returnAs()

        } else {
          try {
            f.returnAs().getConstructor();
          } catch (NoSuchMethodException e) {
            throw new SpecificationViolationException(
                "@Finder.returnAs value (" + f.returnAs().getName() + ") doesn't have no-arg constructor.", method
            );
          }
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.