Examples of InvalidAnnotationException


Examples of com.codiform.moo.annotation.InvalidAnnotationException

    return null;
  }

  private static void validateNoPropertyAnnotation( com.codiform.moo.annotation.Property annotation, String propertyName, Class<?> declaringClass ) {
    if ( annotation != null ) {
      throw new InvalidAnnotationException(
          "The property %s on class %s is a map or collection and should not be annotated with @Property; use @CollectionProperty or @MapProperty instead.",
          propertyName, declaringClass );
    }
  }
View Full Code Here

Examples of com.codiform.moo.annotation.InvalidAnnotationException

  }

  private static void validateNoCollectionPropertyAnnotation( com.codiform.moo.annotation.CollectionProperty annotation, String propertyName,
      Class<?> declaringClass ) {
    if ( annotation != null ) {
      throw new InvalidAnnotationException(
          "The property %s on class %s is not a collection and should not be annotated with @CollectionProperty.", propertyName,
          declaringClass );
    }
  }
View Full Code Here

Examples of com.codiform.moo.annotation.InvalidAnnotationException

  }

  private static void validateNoMapPropertyAnnotation( com.codiform.moo.annotation.MapProperty annotation, String propertyName,
      Class<?> declaringClass ) {
    if ( annotation != null ) {
      throw new InvalidAnnotationException( "The property %s on class %s is not a map and should not be annotated with @MapProperty.",
          propertyName, declaringClass );
    }
  }
View Full Code Here

Examples of com.codiform.moo.annotation.InvalidAnnotationException

  private static void validateNoPropertyAnnotation(
      com.codiform.moo.annotation.Property annotation,
      String propertyName, Class<?> declaringClass) {
    if( annotation != null ) {
      throw new InvalidAnnotationException(
          "The property %s on class %s is a collection and should not be annotated with @Property; use @CollectionProperty instead.",
          propertyName, declaringClass );
    }
  }
View Full Code Here

Examples of com.codiform.moo.annotation.InvalidAnnotationException

  private static void validateNoCollectionPropertyAnnotation(
      com.codiform.moo.annotation.CollectionProperty annotation,
      String propertyName, Class<?> declaringClass) {
    if( annotation != null ) {
      throw new InvalidAnnotationException(
          "The property %s on class %s is not a collection and should not be annotated with @CollectionProperty; use @Property instead.",
          propertyName, declaringClass );
    }
  }
View Full Code Here

Examples of net.nelz.simplesm.exceptions.InvalidAnnotationException

        final Method[] methods = keyObject.getClass().getDeclaredMethods();
        Method targetMethod = null;
        for (final Method method : methods) {
            if (method != null && method.getAnnotation(CacheKeyMethod.class) != null) {
                if (method.getParameterTypes().length > 0) {
                    throw new InvalidAnnotationException(String.format(
                            "Method [%s] must have 0 arguments to be annotated with [%s]",
                            method.toString(),
                            CacheKeyMethod.class.getName()));
                }
                if (!String.class.equals(method.getReturnType())) {
                    throw new InvalidAnnotationException(String.format(
                            "Method [%s] must return a String to be annotated with [%s]",
                            method.toString(),
                            CacheKeyMethod.class.getName()));
                }
                if (targetMethod != null) {
                    throw new InvalidAnnotationException(String.format(
                            "Class [%s] should have only one method annotated with [%s]. See [%s] and [%s]",
                            keyObject.getClass().getName(),
                            CacheKeyMethod.class.getName(),
                            targetMethod.getName(),
                            method.getName()));
View Full Code Here

Examples of net.nelz.simplesm.exceptions.InvalidAnnotationException

                                               final int keyIndex,
                                               final String methodDescription) throws Exception {
        if (verifyTypeIsList(keyObject.getClass())) {
            return (List<Object>) keyObject;
        }
        throw new InvalidAnnotationException(String.format(
                "The parameter object found at dataIndex [%s] is not a [%s]. " +
                "[%s] does not fulfill the requirements.",
                keyIndex,
                List.class.getName(),
                methodDescription
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.InvalidAnnotationException

            }
        }

        if (remotable) {
            if (javaInterface.isRemotableSet() && javaInterface.isRemotable() == false) {
                throw new InvalidAnnotationException("[JCA30005] @Remotable annotation present in a interface marked as not remotable in the SCDL", Remotable.class);
            }
        } else {
            if (javaInterface.isRemotableSet()) {
                remotable = javaInterface.isRemotable();
            }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.InvalidAnnotationException

    private void checkMethodAnnotations(Method method, JavaInterface javaInterface) throws InvalidAnnotationException {
        for ( Annotation a : method.getAnnotations() ) {
            if( a instanceof Remotable ) {
                // [JCA90053] @Remotable annotation cannot be on a method that is not a setter method
                if( !JavaIntrospectionHelper.isSetter(method) ) {
                    throw new InvalidAnnotationException("[JCA90053] @Remotable annotation present on an interface method" +
                                                         " which is not a Setter method: " + javaInterface.getName() + "/" + method.getName(), Remotable.class);
                } // end if
            } // end if   
        } // end for

        // Parameter annotations
        for (Annotation[] parmAnnotations : method.getParameterAnnotations()) {
            for (Annotation annotation : parmAnnotations) {
                if (annotation instanceof Remotable ) {
                    throw new InvalidAnnotationException("[JCA90053] @Remotable annotation present on an interface method" +
                                                         " parameter: " + javaInterface.getName() + "/" + method.getName(), Remotable.class);
                } // end if
            } // end for   
        } // end for
        method.getParameterAnnotations();
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.InvalidAnnotationException

            }
        }

        if (remotable) {
            if (javaInterface.isRemotableSet() && javaInterface.isRemotable() == false) {
                throw new InvalidAnnotationException("[JCA30005] @Remotable annotation present in a interface marked as not remotable in the SCDL", Remotable.class);
            }
        } else {
            if (javaInterface.isRemotableSet()) {
                remotable = javaInterface.isRemotable();
            }
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.