KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > logic > ControllerClassFactory


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ControllerClassFactory.java,v 1.4 2007/01/07 06:15:14 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.core.logic;
23
24 import java.util.List JavaDoc;
25
26 import org.opensubsystems.core.error.OSSException;
27 import org.opensubsystems.core.util.ClassFactory;
28
29 /**
30  * Class factory responsible for instantiation of controllers. The correct
31  * controller is instantiated based on the controller interface and currently
32  * active component model.
33  *
34  * @version $Id: ControllerClassFactory.java,v 1.4 2007/01/07 06:15:14 bastafidli Exp $
35  * @author Miro Halas
36  * @code.reviewer Miro Halas
37  * @code.reviewed 1.2 2004/12/18 06:18:39 bastafidli
38  */

39 public class ControllerClassFactory extends ClassFactory
40 {
41    /**
42     * {@inheritDoc}
43     */

44    protected void createDefaultClassNames(
45       String JavaDoc strClassIdentifier,
46       String JavaDoc strModifier,
47       List JavaDoc lstClassNames
48    ) throws OSSException
49    {
50       int iIndex;
51       StringBuffer JavaDoc sbClassName = new StringBuffer JavaDoc();
52       
53       // Assuming name of the class aaa.AAA
54

55       // Find package separator
56
iIndex = strClassIdentifier.lastIndexOf('.');
57       // Transform to the class aaa.impl.AAAImpl
58
sbClassName.append(strClassIdentifier.substring(0, iIndex + 1));
59       sbClassName.append("impl.");
60       sbClassName.append(strClassIdentifier.substring(iIndex + 1));
61       sbClassName.append("Impl");
62       lstClassNames.add(sbClassName.toString());
63    }
64 }
65
Popular Tags