Source Code Cross Referenced for RefactoringFactory.java in  » UML » jrefactory » org » acm » seguin » refactor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » jrefactory » org.acm.seguin.refactor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Author:  Chris Seguin
003:         *
004:         *  This software has been developed under the copyleft
005:         *  rules of the GNU General Public License.  Please
006:         *  consult the GNU General Public License for more
007:         *  details about use and distribution of this software.
008:         */
009:        package org.acm.seguin.refactor;
010:
011:        import org.acm.seguin.refactor.field.FieldRefactoringFactory;
012:        import org.acm.seguin.refactor.field.PushDownFieldRefactoring;
013:        import org.acm.seguin.refactor.field.PushUpFieldRefactoring;
014:        import org.acm.seguin.refactor.field.RenameFieldRefactoring;
015:        import org.acm.seguin.refactor.method.ExtractMethodRefactoring;
016:        import org.acm.seguin.refactor.method.MethodRefactoringFactory;
017:        import org.acm.seguin.refactor.method.MoveMethodRefactoring;
018:        import org.acm.seguin.refactor.method.RenameMethodRefactoring;
019:        import org.acm.seguin.refactor.method.PushDownMethodRefactoring;
020:        import org.acm.seguin.refactor.method.PushUpAbstractMethodRefactoring;
021:        import org.acm.seguin.refactor.method.PushUpMethodRefactoring;
022:        import org.acm.seguin.refactor.method.RenameParameterRefactoring;
023:        import org.acm.seguin.refactor.type.AddAbstractParent;
024:        import org.acm.seguin.refactor.type.AddChildRefactoring;
025:        import org.acm.seguin.refactor.type.ExtractInterfaceRefactoring;
026:        import org.acm.seguin.refactor.type.MoveClass;
027:        import org.acm.seguin.refactor.type.RemoveEmptyClassRefactoring;
028:        import org.acm.seguin.refactor.type.RenameClassRefactoring;
029:        import org.acm.seguin.refactor.type.TypeRefactoringFactory;
030:
031:        /**
032:         *  Factory for all refactorings
033:         *
034:         *@author    Chris Seguin
035:         */
036:        public class RefactoringFactory {
037:            /**
038:             *  Generates the type refactorings
039:             */
040:            private TypeRefactoringFactory typeFactory;
041:
042:            /**
043:             *  Generates the field refactorings
044:             */
045:            private FieldRefactoringFactory fieldFactory;
046:
047:            /**
048:             *  Generates the method refactorings
049:             */
050:            private MethodRefactoringFactory methodFactory;
051:
052:            /**
053:             *  Stores the singleton
054:             */
055:            private static RefactoringFactory singleton;
056:
057:            /**
058:             *  Constructor for the RefactoringFactory object
059:             */
060:            protected RefactoringFactory() {
061:                typeFactory = new TypeRefactoringFactory();
062:                fieldFactory = new FieldRefactoringFactory();
063:                methodFactory = new MethodRefactoringFactory();
064:            }
065:
066:            /**
067:             *  Adds a feature to the Child attribute of the TypeRefactoringFactory
068:             *  object
069:             *
070:             *@return    Description of the Returned Value
071:             */
072:            public AddChildRefactoring addChild() {
073:                prepare();
074:                return typeFactory.addChild();
075:            }
076:
077:            /**
078:             *  Adds a feature to the Parent attribute of the TypeRefactoringFactory
079:             *  object
080:             *
081:             *@return    Description of the Returned Value
082:             */
083:            public AddAbstractParent addParent() {
084:                prepare();
085:                return typeFactory.addParent();
086:            }
087:
088:            /**
089:             *  Creates a move class refactoring object
090:             *
091:             *@return    the move class refactoring object
092:             */
093:            public MoveClass moveClass() {
094:                prepare();
095:                return typeFactory.moveClass();
096:            }
097:
098:            /**
099:             *  Description of the Method
100:             *
101:             *@return    Description of the Returned Value
102:             */
103:            public RenameClassRefactoring renameClass() {
104:                prepare();
105:                return typeFactory.renameClass();
106:            }
107:
108:            /**
109:             *  Description of the Method
110:             *
111:             *@return    Description of the Returned Value
112:             */
113:            public RemoveEmptyClassRefactoring removeEmptyClass() {
114:                prepare();
115:                return typeFactory.removeEmptyClass();
116:            }
117:
118:            /**
119:             *  Extracts the interface of a class into a new interface object
120:             *
121:             *@return    Description of the Returned Value
122:             */
123:            public ExtractInterfaceRefactoring extractInterface() {
124:                prepare();
125:                return typeFactory.extractInterface();
126:            }
127:
128:            /**
129:             *  Moves the field into the parent class
130:             *
131:             *@return    Description of the Returned Value
132:             */
133:            public PushDownFieldRefactoring pushDownField() {
134:                prepare();
135:                return fieldFactory.pushDownField();
136:            }
137:
138:            /**
139:             *  Renames a field
140:             *
141:             *@return    The refactoring
142:             */
143:            public RenameFieldRefactoring renameField() {
144:                prepare();
145:                return fieldFactory.renameField();
146:            }
147:
148:            /**
149:             *  Moves the field into the child class
150:             *
151:             *@return    Description of the Returned Value
152:             */
153:            public PushUpFieldRefactoring pushUpField() {
154:                prepare();
155:                return fieldFactory.pushUpField();
156:            }
157:
158:            /**
159:             *  Moves the method into the parent class
160:             *
161:             *@return    Description of the Returned Value
162:             */
163:            public PushUpMethodRefactoring pushUpMethod() {
164:                prepare();
165:                return methodFactory.pushUpMethod();
166:            }
167:
168:            /**
169:             *  Moves the method signature into the parent class
170:             *
171:             *@return    Description of the Returned Value
172:             */
173:            public PushUpAbstractMethodRefactoring pushUpAbstractMethod() {
174:                prepare();
175:                return methodFactory.pushUpAbstractMethod();
176:            }
177:
178:            /**
179:             *  Moves the method into a child class
180:             *
181:             *@return    Description of the Returned Value
182:             */
183:            public PushDownMethodRefactoring pushDownMethod() {
184:                prepare();
185:                return methodFactory.pushDownMethod();
186:            }
187:
188:            /**
189:             *  Moves the method into another class
190:             *
191:             *@return    Description of the Returned Value
192:             */
193:            public MoveMethodRefactoring moveMethod() {
194:                prepare();
195:                return methodFactory.moveMethod();
196:            }
197:
198:            /**
199:             *  Moves the method into another class
200:             *
201:             *@return    Description of the Returned Value
202:             */
203:            public RenameMethodRefactoring renameMethod() {
204:                prepare();
205:                return methodFactory.renameMethod();
206:            }
207:
208:            /**
209:             *  Renames a parameter
210:             *
211:             *@return    Description of the Returned Value
212:             */
213:            public RenameParameterRefactoring renameParameter() {
214:                prepare();
215:                return methodFactory.renameParameter();
216:            }
217:
218:            /**
219:             *  Extracts code from one method to create a new method
220:             *
221:             *@return    Description of the Returned Value
222:             */
223:            public ExtractMethodRefactoring extractMethod() {
224:                return methodFactory.extractMethod();
225:            }
226:
227:            /**
228:             *  Prepare to create a refactoring that operates on files on the disk. This
229:             *  is an IDE's last opportunity to save files before the refactoring is
230:             *  performed. This is not used for ExtractMethod which works on code that is
231:             *  in memory (rather than on the disk)
232:             */
233:            protected void prepare() {
234:            }
235:
236:            /**
237:             *  This allows someone to replace this factory
238:             *
239:             *@param  value  The new Singleton value
240:             */
241:            public static void setSingleton(RefactoringFactory value) {
242:                singleton = value;
243:            }
244:
245:            /**
246:             *  A standard method to get the factory
247:             *
248:             *@return    Description of the Returned Value
249:             */
250:            public static RefactoringFactory get() {
251:                if (singleton == null) {
252:                    init();
253:                }
254:                return singleton;
255:            }
256:
257:            /**
258:             *  Initializes the singleton
259:             */
260:            private static synchronized void init() {
261:                if (singleton == null) {
262:                    singleton = new RefactoringFactory();
263:                }
264:            }
265:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.