1 15 package org.apache.tapestry.annotations; 16 17 import java.lang.annotation.Annotation ; 18 import java.lang.reflect.Method ; 19 20 import org.apache.hivemind.impl.MessageFormatter; 21 import org.apache.hivemind.service.ClassFabUtils; 22 23 27 28 class AnnotationMessages 29 { 30 private static final MessageFormatter _formatter = new MessageFormatter( 31 AnnotationMessages.class, "AnnotationStrings"); 32 33 public static String noParametersExpected(Method m) 34 { 35 return _formatter.format("no-parameters-expected", m); 36 } 37 38 public static String notAccessor(Method method) 39 { 40 return _formatter.format("no-accessor", method); 41 } 42 43 public static String voidAccessor(Method method) 44 { 45 return _formatter.format("void-accessor", method); 46 } 47 48 public static String nonVoidMutator(Method method) 49 { 50 return _formatter.format("non-void-mutator", method); 51 } 52 53 public static String wrongParameterCount(Method method) 54 { 55 return _formatter.format("wrong-parameter-count", method); 56 } 57 58 public static String failureProcessingAnnotation(Annotation annotation, Method method, 59 Throwable cause) 60 { 61 return _formatter.format("failure-processing-annotation", annotation, method, cause); 62 } 63 64 public static String failureProcessingClassAnnotation(Annotation annotation, Class clazz, 65 Throwable cause) 66 { 67 return _formatter.format( 68 "failure-processing-class-annotation", 69 annotation, 70 clazz.getName(), 71 cause); 72 } 73 74 public static String returnStringOnly(Class returnType) 75 { 76 return _formatter.format("return-string-only", ClassFabUtils.getJavaClassName(returnType)); 77 } 78 79 public static String bindingWrongFormat(String binding) 80 { 81 return _formatter.format("binding-wrong-format", binding); 82 } 83 84 public static String methodAnnotation(Annotation annotation, Method method) 85 { 86 return _formatter.format("method-annotation", annotation, method); 87 } 88 89 public static String classAnnotation(Annotation annotation, Class clazz) 90 { 91 return _formatter.format("class-annotation", annotation, clazz.getName()); 92 } 93 94 } 95 | Popular Tags |