View Javadoc
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.module.ibeans.annotations;
8   
9   import org.ibeans.api.InvocationContext;
10  import org.ibeans.api.ParamFactory;
11  import org.ibeans.api.channel.HTTP;
12  
13  public class CheckHTTPPropertiesFactory implements ParamFactory
14  {
15      public String create(String paramName, boolean optional, InvocationContext invocationContext)
16      {
17          String method = (String) invocationContext.getIBeanConfig().getPropertyParams().get(HTTP.METHOD_KEY);
18          if (method == null)
19          {
20              throw new IllegalArgumentException("HTTP Method not set");
21          }
22          return method;
23      }
24  }