View Javadoc

1   package org.tinyjee.maven.dim.utils;
2   
3   import org.tinyjee.maven.dim.spi.Globals;
4   import org.tinyjee.maven.dim.extensions.JavaSourceLoader;
5   
6   import java.io.File;
7   import java.util.Map;
8   
9   /**
10   * Provided for backwards compatibility, extensions have been moved to an own package "org.tinyjee.maven.dim.extensions".
11   *
12   * @author Juergen_Kellerer, 2011-09-30
13   */
14  @Deprecated
15  public class InterfaceScanner extends JavaSourceLoader {
16  
17  	private static final long serialVersionUID = -6521845671951229575L;
18  
19  	/**
20  	 * Implements the "{@link #LEGACY_PARAM_ALIAS}" alias functionality.
21  	 */
22  	public static class AliasHandler extends AbstractAliasHandler {
23  		/**
24  		 * Constructs the handler (Note: Is called by
25  		 * {@link org.tinyjee.maven.dim.spi.RequestParameterTransformer#TRANSFORMERS}).
26  		 */
27  		public AliasHandler() {
28  			super(LEGACY_PARAM_ALIAS, PARAM_JAVA_SOURCE, InterfaceScanner.class.getName());
29  		}
30  
31  		@Override
32  		public void transformParameters(Map<String, Object> requestParams) {
33  			super.transformParameters(requestParams);
34  			if (requestParams.containsKey(LEGACY_PARAM_INTERFACE))
35  				requestParams.put(PARAM_JAVA_SOURCE, requestParams.get("interface"));
36  		}
37  	}
38  
39  	public static final String LEGACY_PARAM_ALIAS = "source-interface-api-scan";
40  	public static final String LEGACY_PARAM_INTERFACE = "interface";
41  	public static final String LEGACY_PARAM_TYPE = "type";
42  
43  	public InterfaceScanner(File baseDir, Map<String, Object> requestParams) {
44  		super(baseDir, requestParams);
45  		put(LEGACY_PARAM_TYPE, OUT_PARAM_JAVA_CLASS);
46  		Globals.getLog().warn("Deprecated source-class '" + getClass().getName() + "' is used. " +
47  				"Consider using 'org.tinyjee.maven.dim.extensions.JavaSourceLoader' instead. " +
48  				"(please replace '" + LEGACY_PARAM_ALIAS + "' with '" + PARAM_ALIAS + "')");
49  	}
50  }