Coverage Report - org.mule.config.parsers.OutboundAttachmentsAnnotationParser
 
Classes in this File Line Coverage Branch Coverage Complexity
OutboundAttachmentsAnnotationParser
0%
0/6
0%
0/2
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.config.parsers;
 8  
 
 9  
 import org.mule.api.annotations.meta.Evaluator;
 10  
 import org.mule.api.annotations.param.OutboundAttachments;
 11  
 import org.mule.api.expression.ExpressionAnnotationParser;
 12  
 import org.mule.expression.ExpressionConfig;
 13  
 import org.mule.expression.transformers.ExpressionArgument;
 14  
 
 15  
 import java.lang.annotation.Annotation;
 16  
 
 17  
 /**
 18  
  * Responsible for parsing the {@link org.mule.api.annotations.param.OutboundAttachments} annotation.  This is an iBeans
 19  
  * framework class and cannot be used in any other context.
 20  
  */
 21  0
 public class OutboundAttachmentsAnnotationParser implements ExpressionAnnotationParser
 22  
 {
 23  
     public ExpressionArgument parse(Annotation annotation, Class<?> parameterType)
 24  
     {
 25  0
         Evaluator evaluator = annotation.annotationType().getAnnotation(Evaluator.class);
 26  0
         if (evaluator != null)
 27  
         {
 28  0
             return new ExpressionArgument(null, new ExpressionConfig("", evaluator.value(), null), false);
 29  
         }
 30  
         else
 31  
         {
 32  0
             throw new IllegalArgumentException("The @Evaluator annotation must be set on an Expression Annotation");
 33  
         }
 34  
     }
 35  
 
 36  
     public boolean supports(Annotation annotation)
 37  
     {
 38  0
         return annotation instanceof OutboundAttachments;
 39  
     }
 40  
 }