Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7c511879f0a0c71fa6c3be28f0fd212ed5cb134c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.eclipse.jst.jsf.core.jsfappconfig.internal;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.eclipse.core.resources.IProject;
import org.eclipse.jst.jsf.core.jsfappconfig.AnnotationJSFAppConfigLocator;
import org.eclipse.jst.jsf.core.jsfappconfig.ContextParamSpecifiedJSFAppConfigLocater;
import org.eclipse.jst.jsf.core.jsfappconfig.DefaultJSFAppConfigLocater;
import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater;
import org.eclipse.jst.jsf.core.jsfappconfig.ImplicitRuntimeJSFAppConfigLocater;
import org.eclipse.jst.jsf.core.jsfappconfig.RuntimeClasspathJSFAppConfigLocater;

/**
 * The platform's default JSFAppConfigLocatorProviderStrategy.
 * <p>
 * Will return:
 * <ol>
 * <li>ImplicitRuntimeJSFAppConfigLocater</li>
 * <li>DefaultJSFAppConfigLocater</li>
 * <li>ContextParamSpecifiedJSFAppConfigLocater</li>
 * <li>RuntimeClasspathJSFAppConfigLocater</li>
 * <li>AnnotationJSFAppConfigLocator</li>
 * <ol>
 *
 */
public class DefaultJSFAppConfigLocatorProviderStrategy 
		extends 	JSFAppConfigLocatorProviderStrategy 
		implements 	IJSFAppConfigLocatorProvider {
	
	public IJSFAppConfigLocatorProvider perform(IProject project)  {
		return this;
	}

	public List<IJSFAppConfigLocater> getLocators() {
		List<IJSFAppConfigLocater> ret = new ArrayList<IJSFAppConfigLocater>();
		
		// implicit runtime-provided configuration
		IJSFAppConfigLocater implicitRuntimeConfigLocater = new ImplicitRuntimeJSFAppConfigLocater();
		ret.add(implicitRuntimeConfigLocater);
		
		// default ("/WEB-INF/faces-config.xml") locater
		IJSFAppConfigLocater defaultConfigLocater = new DefaultJSFAppConfigLocater();
		ret.add(defaultConfigLocater);
		
		// web.xml context-parameter specified locater
		IJSFAppConfigLocater contextParamConfigLocater = new ContextParamSpecifiedJSFAppConfigLocater();
		ret.add(contextParamConfigLocater);
		
		// runtime classpath locater
		IJSFAppConfigLocater classpathConfigLocater = new RuntimeClasspathJSFAppConfigLocater();
		ret.add(classpathConfigLocater);

		// annotation config locator
		IJSFAppConfigLocater annotationConfigLocator = new AnnotationJSFAppConfigLocator();
		ret.add(annotationConfigLocator);

		return Collections.unmodifiableList(ret);
	}

}

Back to the top