View Javadoc

1   /*
2    * Copyright 2004-2005 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.composite;
17  
18  import net.sf.composite.extract.ComponentAccessor;
19  import net.sf.composite.extract.extractors.ContainerPropertyComponentAccessor;
20  import net.sf.composite.specialize.Specializer;
21  import net.sf.composite.specialize.specializers.CachingSpecializerProxy;
22  import net.sf.composite.specialize.specializers.Jdk13ProxySpecializer;
23  import net.sf.composite.validate.ComponentValidator;
24  import net.sf.composite.validate.validators.SimpleComponentValidator;
25  
26  /***
27   * Creates default instances of the main objects that are used repeatedly in the
28   * framework.
29   * 
30   * @author Matt Sgarlata
31   * @since Mar 11, 2005
32   */
33  public class Defaults {
34  	
35  	public static final ComponentValidator createComponentValidator() {
36  		return new SimpleComponentValidator();
37  	}
38  	public static final ComponentAccessor createComponentAccessor() {
39  		return new ContainerPropertyComponentAccessor();
40  	}
41  	public static final Specializer createSpecializer() {
42  		return new CachingSpecializerProxy(new Jdk13ProxySpecializer());
43  	}
44  	
45  }