public static Message lookupFailedSeePreviousException(Object object) { return factory.createMessage(BUNDLE_PATH, 8, object); } }
throw new RequiredValueException(AnnotationsMessages.lookupNotFoundInRegistry(field.getType(), name, object.getClass())); throw new RequiredValueException(AnnotationsMessages.lookupFailedSeePreviousException(object), e);
protected InboundEndpoint tryInboundEndpointAnnotation(AnnotationMetaData metaData, ChannelType channelType) throws MuleException { Channel channelAnno = metaData.getAnnotation().annotationType().getAnnotation(Channel.class); if (channelAnno != null && channelAnno.type() == channelType) { EndpointAnnotationParser parser = parserFactory.getEndpointParser(metaData.getAnnotation(), metaData.getClazz(), metaData.getMember()); if (parser == null) { //TODO i18n throw new AnnotationException(AnnotationsMessages.createStaticMessage("No parser found for annotation: " + metaData)); } else { return parser.parseInboundEndpoint(metaData.getAnnotation(), Collections.EMPTY_MAP); } } return null; }
protected void validateMethod(Method method, Class[] sourceTypes) throws IllegalArgumentException { int mods = method.getModifiers(); if(Modifier.isAbstract(mods) || Modifier.isInterface(mods) || !Modifier.isPublic(mods) || method.getReturnType().equals(Void.TYPE) || method.getParameterTypes().length==0 || method.getReturnType().equals(Object.class) || Arrays.asList(method.getParameterTypes()).contains(Object.class) || Arrays.asList(sourceTypes).contains(Object.class)) { //May lift the ban on Object return and source types //The details as to why the method is invalid are in the message throw new IllegalArgumentException(AnnotationsMessages.transformerMethodNotValid(method).getMessage()); } }
public Object convertProperty(Class type, String property) { String prop = parsePlaceholderValues(property); Collection c = muleContext.getRegistry().lookupObjects(PropertyConverter.class); for (Iterator iterator = c.iterator(); iterator.hasNext();) { PropertyConverter converter = (PropertyConverter) iterator.next(); if (converter.getType().equals(type)) { return converter.convert(prop, muleContext); } } throw new IllegalArgumentException(AnnotationsMessages.noPropertyConverterForType(type).getMessage()); }
static synchronized ExpressionArgument parseAnnotation(Annotation annotation, Class<?> paramType, MuleContext muleContext) { AnnotationsParserFactory factory; try { factory = muleContext.getRegistry().lookupObject(AnnotationsParserFactory.class); } catch (RegistrationException e) { //TODO better exception message throw new IllegalArgumentException(AnnotationsMessages.noParserFoundForAnnotation(annotation).getMessage()); } ExpressionAnnotationParser parser = factory.getExpressionParser(annotation); if (parser == null) { if (logger.isDebugEnabled()) { logger.debug(AnnotationsMessages.noParserFoundForAnnotation(annotation).getMessage()); } return null; } return parser.parse(annotation, paramType); } }
protected OutboundEndpoint tryOutboundEndpointAnnotation(AnnotationMetaData metaData, ChannelType channelType) throws MuleException { Channel channelAnno = metaData.getAnnotation().annotationType().getAnnotation(Channel.class); if (channelAnno != null && channelAnno.type() == channelType) { EndpointAnnotationParser parser = parserFactory.getEndpointParser(metaData.getAnnotation(), metaData.getClazz(), metaData.getMember()); if (parser == null) { //TODO i18n throw new AnnotationException(AnnotationsMessages.createStaticMessage("No parser found for annotation: " + metaData)); } else { return parser.parseOutboundEndpoint(metaData.getAnnotation(), Collections.EMPTY_MAP); } } return null; }
public static Message noParserFoundForAnnotation(Annotation annotation) { return factory.createMessage(BUNDLE_PATH, 3, annotation); }
public static Message noPropertyConverterForType(Class type) { return factory.createMessage(BUNDLE_PATH, 4, type); }
public static Message failedToInvokeReplyMethod(String method) { return factory.createMessage(BUNDLE_PATH, 5, method); }
public static Message transformerMethodNotValid(Method method) { return factory.createMessage(BUNDLE_PATH, 6, method); }
public static Message serviceDoesNotHaveAnnotation(Class serviceClass, String annotationName) { return factory.createMessage(BUNDLE_PATH, 1, serviceClass.getName(), annotationName); }
public static Message serviceHasNoEntrypoint(Class serviceClass) { return factory.createMessage(BUNDLE_PATH, 2, serviceClass.getName()); }
public static Message lookupNotFoundInRegistry(Class type, String name, Class object) { return factory.createMessage(BUNDLE_PATH, 7, type, (StringUtils.isBlank(name) ? "[no name]" : name), object); }