Skip to content

Commit 25dd01b

Browse files
JihoonKim1004JihoonKim1004
authored andcommitted
Made changes to interface, also cleaned up some code [TODO: clean up better later + implement better later {this will be an ongoing TODO}]
1 parent 137ce70 commit 25dd01b

200 files changed

Lines changed: 728 additions & 728 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

jsf-flex-build-plugIn/jsf-flex-plugIn/src/main/java/com/googlecode/jsfFlexPlugIn/inspector/_JsfFlexInspectListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
public interface _JsfFlexInspectListener {
2828

29-
void inspectFileFinished(List<Map<String, ? extends Object>> _inspectedList, String _sourceInspected, String _package);
29+
void inspectFileFinished(List<Map<String, ? extends Object>> inspectedList, String sourceInspected, String packageName);
3030

3131
void inspectionCompleted();
3232

jsf-flex-build-plugIn/jsf-flex-plugIn/src/main/java/com/googlecode/jsfFlexPlugIn/inspector/_JsfFlexInspectorBase.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ protected String getDirPath(){
4848
return _dirPath;
4949
}
5050

51-
public synchronized void addInspectListener(_JsfFlexInspectListener _callBack){
52-
_jsfFlexInspectListeners.add(_callBack);
51+
public synchronized void addInspectListener(_JsfFlexInspectListener callBack){
52+
_jsfFlexInspectListeners.add(callBack);
5353
}
5454

55-
protected synchronized void inspectFileFinished(List<Map<String, ? extends Object>> _inspectedList, String _inspectedFileName, String _inspectedPackage){
56-
for(_JsfFlexInspectListener _inspectedCallBack : _jsfFlexInspectListeners){
57-
_inspectedCallBack.inspectFileFinished(_inspectedList, _inspectedFileName, _inspectedPackage);
55+
protected synchronized void inspectFileFinished(List<Map<String, ? extends Object>> inspectedList, String inspectedFileName, String inspectedPackage){
56+
for(_JsfFlexInspectListener inspectedCallBack : _jsfFlexInspectListeners){
57+
inspectedCallBack.inspectFileFinished(inspectedList, inspectedFileName, inspectedPackage);
5858
}
5959
}
6060

6161
protected synchronized void inspectionCompleted(){
62-
for(_JsfFlexInspectListener _inspectedCallBack : _jsfFlexInspectListeners){
63-
_inspectedCallBack.inspectionCompleted();
62+
for(_JsfFlexInspectListener inspectedCallBack : _jsfFlexInspectListeners){
63+
inspectedCallBack.inspectionCompleted();
6464
}
6565
}
6666

jsf-flex-build-plugIn/jsf-flex-plugIn/src/main/java/com/googlecode/jsfFlexPlugIn/inspector/qdox/JsfFlexQdoxInspector.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@ public synchronized void inspectFiles(){
5151

5252
JavaDocBuilder builder = new JavaDocBuilder();
5353
builder.addSourceTree(new File(getDirPath()));
54-
JavaClass[] _inspectableFiles = builder.getClasses();
54+
JavaClass[] inspectableFiles = builder.getClasses();
5555

56-
for(JavaClass _currClass : _inspectableFiles){
56+
for(JavaClass currClass : inspectableFiles){
5757
//TODO implement it better later, but since it's a plug-in does it have to be???
58-
List<Map<String, ? extends Object>> _inspectedList = new LinkedList<Map<String, ? extends Object>>();
58+
List<Map<String, ? extends Object>> inspectedList = new LinkedList<Map<String, ? extends Object>>();
5959

6060
for(String _currPattern : _patternList){
61-
DocletTag[] _inspectedDocletTag = _currClass.getTagsByName(_currPattern);
61+
DocletTag[] inspectedDocletTag = currClass.getTagsByName(_currPattern);
6262

63-
for(DocletTag _currDocletTag : _inspectedDocletTag){
64-
Map<String, Object> _inspectedMap = new LinkedHashMap<String, Object>();
65-
_inspectedMap.putAll(_currDocletTag.getNamedParameterMap());
66-
_inspectedList.add(_inspectedMap);
63+
for(DocletTag currDocletTag : inspectedDocletTag){
64+
Map<String, Object> inspectedMap = new LinkedHashMap<String, Object>();
65+
inspectedMap.putAll(currDocletTag.getNamedParameterMap());
66+
inspectedList.add(inspectedMap);
6767
}
6868

6969
}
7070

71-
inspectFileFinished(_inspectedList, _currClass.getName(), _currClass.getPackage());
71+
inspectFileFinished(inspectedList, currClass.getName(), currClass.getPackage());
7272
}
7373

7474
inspectionCompleted();

jsf-flex-build-plugIn/jsf-flex-plugIn/src/main/java/com/googlecode/jsfFlexPlugIn/mojo/CreateComponentValueMapperXMLMojo.java

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ public final class CreateComponentValueMapperXMLMojo extends AbstractMojo
9191
/**
9292
* @parameter expression="${project}"
9393
*/
94-
private MavenProject project;
94+
private MavenProject _project;
9595

9696
/**
9797
* @parameter expression="${targetComponentProject}"
9898
*/
99-
private String targetComponentProject;
99+
private String _targetComponentProject;
100100

101101
/**
102102
* @parameter expression="${basedir}/target/classes/com/googlecode/jsfFlex/shared/swfSourceFiles"
103103
*/
104-
private File toCreateComponentValueMapperXMLPath;
104+
private File _toCreateComponentValueMapperXMLPath;
105105

106106
/**
107107
* @parameter expression="src/main/resources/META-INF"
108108
*/
109-
private File templateSourceDirectory;
109+
private File _templateSourceDirectory;
110110

111111
private final Set<ClassInfo> _classInfoSet;
112112

@@ -144,13 +144,13 @@ public List<NodeInfo> getNodeList() {
144144
}
145145

146146
@Override
147-
public boolean equals(Object _instance) {
148-
if(!(_instance instanceof ClassInfo)){
147+
public boolean equals(Object instance) {
148+
if(!(instance instanceof ClassInfo)){
149149
return false;
150150
}
151151

152-
ClassInfo _classInfoInstance = (ClassInfo) _instance;
153-
return this._fullClassName.equals(_classInfoInstance.getFullClassName());
152+
ClassInfo classInfoInstance = (ClassInfo) instance;
153+
return this._fullClassName.equals(classInfoInstance._fullClassName);
154154
}
155155

156156
@Override
@@ -243,27 +243,27 @@ public Boolean isValueNested() {
243243
public void execute() throws MojoExecutionException, MojoFailureException {
244244

245245
//HACK for now, since QDOX seems to have issues reading Java files with annotations
246-
targetComponentProject = RENDERKIT_14_PROJECT_NAME;
246+
_targetComponentProject = RENDERKIT_14_PROJECT_NAME;
247247

248-
String _currDirPath = (String) project.getCompileSourceRoots().get(0);
249-
_currDirPath = _currDirPath.replace(JSF_FLEX_SHARED_PROJECT, JSF_FLEX_PROJECT);
250-
_currDirPath = (targetComponentProject.equals(RENDERKIT_14_PROJECT_NAME)) ?
251-
_currDirPath.replace(CORE_PROJECT_NAME, RENDERKIT_14_PROJECT_NAME) :
252-
_currDirPath.replace(CORE_PROJECT_NAME, RENDERKIT_15_PROJECT_NAME);
248+
String currDirPath = (String) _project.getCompileSourceRoots().get(0);
249+
currDirPath = currDirPath.replace(JSF_FLEX_SHARED_PROJECT, JSF_FLEX_PROJECT);
250+
currDirPath = (_targetComponentProject.equals(RENDERKIT_14_PROJECT_NAME)) ?
251+
currDirPath.replace(CORE_PROJECT_NAME, RENDERKIT_14_PROJECT_NAME) :
252+
currDirPath.replace(CORE_PROJECT_NAME, RENDERKIT_15_PROJECT_NAME);
253253

254-
Properties _velocityParserProperties = new Properties();
255-
_velocityParserProperties.put(FILE_RESOURCE_LOADER_PATH_KEY, templateSourceDirectory.getPath());
254+
Properties velocityParserProperties = new Properties();
255+
velocityParserProperties.put(FILE_RESOURCE_LOADER_PATH_KEY, _templateSourceDirectory.getPath());
256256

257-
_jsfFlexVelocityParser = new JsfFlexVelocityParser(_velocityParserProperties);
257+
_jsfFlexVelocityParser = new JsfFlexVelocityParser(velocityParserProperties);
258258
_jsfFlexVelocityParser.init();
259259
_jsfFlexVelocityParser.addParserListener(this);
260260

261-
if(targetComponentProject.equals(RENDERKIT_14_PROJECT_NAME)){
262-
_jsfFlexInspector = new JsfFlexQdoxInspector(_currDirPath, FLEX_COMPONENT_VALUE_CLASS_INFO_ATTRIBUTE,
261+
if(_targetComponentProject.equals(RENDERKIT_14_PROJECT_NAME)){
262+
_jsfFlexInspector = new JsfFlexQdoxInspector(currDirPath, FLEX_COMPONENT_VALUE_CLASS_INFO_ATTRIBUTE,
263263
FLEX_COMPONENT_NODE_ATTRIBUTE);
264264
}else{
265265

266-
_jsfFlexInspector = new _JsfFlexInspectorBase(_currDirPath){
266+
_jsfFlexInspector = new _JsfFlexInspectorBase(currDirPath){
267267
public void inspectFiles(){
268268
/*
269269
* In order to keep in synch with the QDox parsing, following is the
@@ -286,59 +286,59 @@ public void inspectFiles(){
286286
*/
287287
JavaDocBuilder builder = new JavaDocBuilder();
288288
builder.addSourceTree(new File(getDirPath()));
289-
JavaClass[] _inspectableFiles = builder.getClasses();
289+
JavaClass[] inspectableFiles = builder.getClasses();
290290

291-
for(JavaClass _currClass : _inspectableFiles){
292-
JsfFlexAttributeProperties _jsfFlexAttributeList = _currClass.getClass().getAnnotation(JsfFlexAttributeProperties.class);
293-
List<Map<String, ? extends Object>> _inspectedList = new LinkedList<Map<String, ? extends Object>>();
294-
Map<String, String> _inspectedMap = new LinkedHashMap<String, String>();
291+
for(JavaClass currClass : inspectableFiles){
292+
JsfFlexAttributeProperties jsfFlexAttributeList = currClass.getClass().getAnnotation(JsfFlexAttributeProperties.class);
293+
List<Map<String, ? extends Object>> inspectedList = new LinkedList<Map<String, ? extends Object>>();
294+
Map<String, String> inspectedMap = new LinkedHashMap<String, String>();
295295

296-
if(_jsfFlexAttributeList == null || _jsfFlexAttributeList.mxmlComponentPackage() == null ||
297-
_jsfFlexAttributeList.mxmlComponentName().length() == 0){
296+
if(jsfFlexAttributeList == null || jsfFlexAttributeList.mxmlComponentPackage() == null ||
297+
jsfFlexAttributeList.mxmlComponentName().length() == 0){
298298
continue;
299299
}
300300

301-
_inspectedMap.put(MXML_COMPONENT_PACKAGE_KEY, _jsfFlexAttributeList.mxmlComponentPackage());
302-
_inspectedMap.put(MXML_COMPONENT_NAME_KEY, _jsfFlexAttributeList.mxmlComponentName());
301+
inspectedMap.put(MXML_COMPONENT_PACKAGE_KEY, jsfFlexAttributeList.mxmlComponentPackage());
302+
inspectedMap.put(MXML_COMPONENT_NAME_KEY, jsfFlexAttributeList.mxmlComponentName());
303303

304-
_inspectedList.add(_inspectedMap);
304+
inspectedList.add(inspectedMap);
305305
//have added Map info containing CLASS_* info
306306

307-
for(FlexComponentNodeAttribute _currComponentNodeInfo : _jsfFlexAttributeList.mxmlComponentNodeAttributes()){
308-
_inspectedMap = new LinkedHashMap<String, String>();
307+
for(FlexComponentNodeAttribute currComponentNodeInfo : jsfFlexAttributeList.mxmlComponentNodeAttributes()){
308+
inspectedMap = new LinkedHashMap<String, String>();
309309

310-
_inspectedMap.put(HTML_TYPE_KEY, _currComponentNodeInfo.htmlType());
311-
_inspectedMap.put(TYPE_ATTRIBUTE_VALUE_KEY, _currComponentNodeInfo.typeAttributeValue());
310+
inspectedMap.put(HTML_TYPE_KEY, currComponentNodeInfo.htmlType());
311+
inspectedMap.put(TYPE_ATTRIBUTE_VALUE_KEY, currComponentNodeInfo.typeAttributeValue());
312312

313-
_inspectedMap.put(VALUE_ATTRIBUTE_VALUE_KEY, _currComponentNodeInfo.valueAttributeValue());
314-
_inspectedMap.put(VALUE_DYNAMIC_KEY, String.valueOf(_currComponentNodeInfo.isValueDynamic()));
315-
_inspectedMap.put(VALUE_NESTED_KEY, String.valueOf(_currComponentNodeInfo.isValueNested()));
313+
inspectedMap.put(VALUE_ATTRIBUTE_VALUE_KEY, currComponentNodeInfo.valueAttributeValue());
314+
inspectedMap.put(VALUE_DYNAMIC_KEY, String.valueOf(currComponentNodeInfo.isValueDynamic()));
315+
inspectedMap.put(VALUE_NESTED_KEY, String.valueOf(currComponentNodeInfo.isValueNested()));
316316

317-
String _builtString;
318-
if(_currComponentNodeInfo.isValueNested()){
319-
StringBuilder _toBuildString = new StringBuilder();
317+
String builtString;
318+
if(currComponentNodeInfo.isValueNested()){
319+
StringBuilder toBuildString = new StringBuilder();
320320

321-
for(String _buildInto : _currComponentNodeInfo.valueNestedValues()){
322-
_toBuildString.append(_buildInto);
323-
_toBuildString.append("_");
321+
for(String buildInto : currComponentNodeInfo.valueNestedValues()){
322+
toBuildString.append(buildInto);
323+
toBuildString.append("_");
324324
}
325325

326-
_toBuildString.deleteCharAt(_toBuildString.length()-1);
327-
_builtString = _toBuildString.toString();
326+
toBuildString.deleteCharAt(toBuildString.length()-1);
327+
builtString = toBuildString.toString();
328328
}else{
329-
_builtString = "";
329+
builtString = "";
330330
}
331331

332-
_inspectedMap.put(VALUE_NESTED_VALUES_KEY, _builtString);
332+
inspectedMap.put(VALUE_NESTED_VALUES_KEY, builtString);
333333

334-
_inspectedMap.put(NAME_ATTRIBUTE_VALUE_KEY, _currComponentNodeInfo.nameAttributeValue());
335-
_inspectedMap.put(NAME_DYNAMIC_KEY, String.valueOf(_currComponentNodeInfo.isNameDynamic()));
336-
_inspectedMap.put(NAME_APPEND_KEY, _currComponentNodeInfo.nameAppend());
334+
inspectedMap.put(NAME_ATTRIBUTE_VALUE_KEY, currComponentNodeInfo.nameAttributeValue());
335+
inspectedMap.put(NAME_DYNAMIC_KEY, String.valueOf(currComponentNodeInfo.isNameDynamic()));
336+
inspectedMap.put(NAME_APPEND_KEY, currComponentNodeInfo.nameAppend());
337337

338-
_inspectedList.add(_inspectedMap);
338+
inspectedList.add(inspectedMap);
339339
}
340340

341-
inspectFileFinished(_inspectedList, _currClass.getName(), _currClass.getPackage());
341+
inspectFileFinished(inspectedList, currClass.getName(), currClass.getPackage());
342342
}
343343

344344
inspectionCompleted();
@@ -353,45 +353,45 @@ public void inspectFiles(){
353353

354354
}
355355

356-
public void inspectFileFinished(List<Map<String, ? extends Object>> _inspectedList, String _sourceInspected, String _package) {
356+
public void inspectFileFinished(List<Map<String, ? extends Object>> inspectedList, String sourceInspected, String packageName) {
357357

358-
ClassInfo _currClassInfo = null;
358+
ClassInfo currClassInfo = null;
359359

360-
for(Map<String, ? extends Object> _inspected : _inspectedList){
360+
for(Map<String, ? extends Object> inspected : inspectedList){
361361

362-
if(_inspected != null && _inspected.size() > 0){
362+
if(inspected != null && inspected.size() > 0){
363363

364-
if(_currClassInfo == null){
365-
String _classPackage = (String) _inspected.get(MXML_COMPONENT_PACKAGE_KEY);
366-
String _className = (String) _inspected.get(MXML_COMPONENT_NAME_KEY);
364+
if(currClassInfo == null){
365+
String classPackage = (String) inspected.get(MXML_COMPONENT_PACKAGE_KEY);
366+
String className = (String) inspected.get(MXML_COMPONENT_NAME_KEY);
367367

368-
String _fullClassName = _classPackage + "::" + _className;
368+
String fullClassName = classPackage + "::" + className;
369369

370-
_currClassInfo = new ClassInfo(_fullClassName);
371-
_classInfoSet.add(_currClassInfo);
370+
currClassInfo = new ClassInfo(fullClassName);
371+
_classInfoSet.add(currClassInfo);
372372
continue;
373373
}
374374
//created the ClassInfo instance and now created the NodeInfo to add
375375

376-
Object htmlType = _inspected.get(HTML_TYPE_KEY);
377-
Object typeAttributeValue = _inspected.get(TYPE_ATTRIBUTE_VALUE_KEY);
376+
Object htmlType = inspected.get(HTML_TYPE_KEY);
377+
Object typeAttributeValue = inspected.get(TYPE_ATTRIBUTE_VALUE_KEY);
378378

379-
Object valueAttributeValue = _inspected.get(VALUE_ATTRIBUTE_VALUE_KEY);
380-
Boolean isValueDynamic = _inspected.get(VALUE_DYNAMIC_KEY) != null && _inspected.get(VALUE_DYNAMIC_KEY).equals("true");
381-
Boolean isValueNested = _inspected.get(VALUE_NESTED_KEY) != null && _inspected.get(VALUE_NESTED_KEY).equals("true");
382-
Object valueNestedValues = _inspected.get(VALUE_NESTED_VALUES_KEY);
379+
Object valueAttributeValue = inspected.get(VALUE_ATTRIBUTE_VALUE_KEY);
380+
Boolean isValueDynamic = inspected.get(VALUE_DYNAMIC_KEY) != null && inspected.get(VALUE_DYNAMIC_KEY).equals("true");
381+
Boolean isValueNested = inspected.get(VALUE_NESTED_KEY) != null && inspected.get(VALUE_NESTED_KEY).equals("true");
382+
Object valueNestedValues = inspected.get(VALUE_NESTED_VALUES_KEY);
383383
List<String> valueNestedList;
384384
if(valueNestedValues != null){
385385
valueNestedList = Arrays.asList( ((String) valueNestedValues).split("_") );
386386
}else{
387387
valueNestedList = new LinkedList<String>();
388388
}
389389

390-
Object nameAttributeValue = _inspected.get(NAME_ATTRIBUTE_VALUE_KEY);
391-
Boolean isNameDynamic = _inspected.get(NAME_DYNAMIC_KEY) != null && _inspected.get(NAME_DYNAMIC_KEY).equals("true");
392-
Object nameAppend = _inspected.get(NAME_APPEND_KEY);
390+
Object nameAttributeValue = inspected.get(NAME_ATTRIBUTE_VALUE_KEY);
391+
Boolean isNameDynamic = inspected.get(NAME_DYNAMIC_KEY) != null && inspected.get(NAME_DYNAMIC_KEY).equals("true");
392+
Object nameAppend = inspected.get(NAME_APPEND_KEY);
393393

394-
_currClassInfo.addNodeInfo(new NodeInfo(returnEmptyStringForNull(htmlType), returnEmptyStringForNull(typeAttributeValue), isValueNested,
394+
currClassInfo.addNodeInfo(new NodeInfo(returnEmptyStringForNull(htmlType), returnEmptyStringForNull(typeAttributeValue), isValueNested,
395395
isValueDynamic, returnEmptyStringForNull(valueAttributeValue), valueNestedList, isNameDynamic,
396396
returnEmptyStringForNull(nameAppend), returnEmptyStringForNull(nameAttributeValue)));
397397

@@ -407,30 +407,30 @@ private String returnEmptyStringForNull(Object checkForNull){
407407

408408
public void inspectionCompleted() {
409409

410-
String _toCreateComponentValueMapperXMLPath = toCreateComponentValueMapperXMLPath.getPath();
410+
String toCreateComponentValueMapperXMLPath = _toCreateComponentValueMapperXMLPath.getPath();
411411

412412
try{
413-
File _toCreateComponentValueMapperXMLFilePath = new File(_toCreateComponentValueMapperXMLPath);
414-
if(!_toCreateComponentValueMapperXMLFilePath.exists()){
415-
_toCreateComponentValueMapperXMLFilePath.mkdirs();
413+
File toCreateComponentValueMapperXMLFilePath = new File(toCreateComponentValueMapperXMLPath);
414+
if(!toCreateComponentValueMapperXMLFilePath.exists()){
415+
toCreateComponentValueMapperXMLFilePath.mkdirs();
416416
}
417-
_toCreateComponentValueMapperXMLPath += File.separatorChar + TO_CREATE_COMPONENT_VALUE_MAPPER_XML_FILE_NAME;
418-
FileWriter _writer = new FileWriter(new File(_toCreateComponentValueMapperXMLPath));
419-
Map<String, Object> _contextInfoMap = new HashMap<String, Object>();
417+
toCreateComponentValueMapperXMLPath += File.separatorChar + TO_CREATE_COMPONENT_VALUE_MAPPER_XML_FILE_NAME;
418+
FileWriter writer = new FileWriter(new File(toCreateComponentValueMapperXMLPath));
419+
Map<String, Object> contextInfoMap = new HashMap<String, Object>();
420420

421-
_contextInfoMap.put(JSF_FLEX_CLASS_SET_ATTRIBUTE, _classInfoSet);
422-
_jsfFlexVelocityParser.mergeCollectionToTemplate(JSF_FLEX_COMPONENT_VALUE_MAPPER_TEMPLATE, _contextInfoMap,
423-
_writer, _toCreateComponentValueMapperXMLPath);
421+
contextInfoMap.put(JSF_FLEX_CLASS_SET_ATTRIBUTE, _classInfoSet);
422+
_jsfFlexVelocityParser.mergeCollectionToTemplate(JSF_FLEX_COMPONENT_VALUE_MAPPER_TEMPLATE, contextInfoMap,
423+
writer, toCreateComponentValueMapperXMLPath);
424424

425-
}catch(IOException _ioException){
425+
}catch(IOException ioException){
426426

427427
}
428428

429429
}
430430

431-
public void mergeCollectionToTemplateFinished(String _fileMerged) {
431+
public void mergeCollectionToTemplateFinished(String fileMerged) {
432432

433-
ReplaceText removeEmptySpace = new ReplaceText(_fileMerged);
433+
ReplaceText removeEmptySpace = new ReplaceText(fileMerged);
434434
removeEmptySpace.replaceRegExp(true);
435435
removeEmptySpace.regMatch(ReplaceText.CLEAN_REG_EXP_MATCH);
436436
removeEmptySpace.regReplace(ReplaceText.CLEAN_REG_EXP_REPLACE_WITH);

0 commit comments

Comments
 (0)