1 /** ------------------------------------
2 * SweetDEV RIA library
3 * Copyright [2006 - 2010] [Ideo Technologies]
4 * ------------------------------------
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 *
19 * For more information, please contact us at:
20 * Ideo Technologies S.A
21 * 124 rue de Verdun
22 * 92800 Puteaux - France
23 *
24 * France & Europe Phone : +33 1.46.25.09.60
25 *
26 *
27 * web : http://www.ideotechnologies.com
28 * email : SweetDEV-RIA@ideotechnologies.com
29 *
30 *
31 * @version ${pom.version}
32 * @author Ideo Technologies
33 */
34 package com.ideo.sweetdevria.config.factories;
35
36 import org.apache.commons.digester.AbstractObjectCreationFactory;
37 import org.xml.sax.Attributes;
38
39 import com.ideo.sweetdevria.util.ClassUtils;
40
41 /**
42 * Builder factory.
43 */
44 public final class BuilderMappingFactory extends AbstractObjectCreationFactory {
45
46 /**
47 * Class name to build.
48 */
49 private static final String className = "com.ideo.sweetdevria.config.elements.BuilderConfig";
50
51
52 /**
53 * Supply a new instance of a builder config object.
54 */
55 public Object createObject(Attributes attributes) {
56 Object builderMapping = null;
57 try {
58 builderMapping = ClassUtils.applicationInstance(className);
59 } catch (Exception e) {
60 super.digester.getLogger().error("BuilderMappingFactory.createObject: ", e);
61 }
62 return builderMapping;
63 }
64 }