Skip to content

Commit 0b9ddbe

Browse files
JihoonKim1004JihoonKim1004
authored andcommitted
With ComponentBuildException extending RuntimeException, have removed the throws statements from the code.
1 parent dd000f6 commit 0b9ddbe

29 files changed

Lines changed: 110 additions & 134 deletions

File tree

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/renderkit/annotationDocletParser/_AnnotationDocletParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public static String getErrorMessage(String caller, String parameter){
6868
}
6969

7070
public abstract void mapComponentFields(Class mapClass, Object _componentObj,
71-
String _replaceMappingXML) throws ComponentBuildException;
71+
String _replaceMappingXML);
7272

7373
abstract class _MXMLMapper {
7474

75-
abstract TokenValue mapField(String tokenName, Object componentObj) throws ComponentBuildException;
75+
abstract TokenValue mapField(String tokenName, Object componentObj);
7676

7777
}
7878

@@ -92,7 +92,7 @@ TokenValue mapField(String tokenName, Object componentObj) {
9292
};
9393

9494
final _MXMLMapper MXML_METHOD_MAPPER = new _MXMLMapper(){
95-
TokenValue mapField(String tokenName, Object componentObj) throws ComponentBuildException{
95+
TokenValue mapField(String tokenName, Object componentObj) {
9696

9797
try{
9898
String searchMethodName = "get" + String.valueOf(tokenName.charAt(0)).toUpperCase() + tokenName.substring(1);

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/TaskRunnerImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.util.LinkedList;
2424
import java.util.List;
2525

26-
import com.googlecode.jsfFlex.shared.exception.ComponentBuildException;
27-
2826
/**
2927
* Previously TaskRunnerImpl was designed to allow lazy execution<br>
3028
* of the _Tasks within the List; however due to separation of implementation<br>
@@ -47,17 +45,17 @@ class TaskRunnerImpl implements _TaskRunner {
4745
_tasks.addAll(tasks);
4846
}
4947

50-
public synchronized void addTask(_Task toAdd) throws ComponentBuildException {
48+
public synchronized void addTask(_Task toAdd) {
5149
_tasks.add(toAdd);
5250
execute();
5351
}
5452

55-
public synchronized void addTasks(Collection _tasksToAdd) throws ComponentBuildException {
53+
public synchronized void addTasks(Collection _tasksToAdd) {
5654
_tasks.addAll(_tasksToAdd);
5755
execute();
5856
}
5957

60-
public synchronized void execute() throws ComponentBuildException{
58+
public synchronized void execute() {
6159

6260
_Task current;
6361
for(Iterator iterate = _tasks.iterator(); iterate.hasNext();){

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_CommonTaskRunner.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
import java.io.File;
44
import java.io.InputStream;
55

6-
import com.googlecode.jsfFlex.shared.exception.ComponentBuildException;
7-
86
public interface _CommonTaskRunner extends _TaskRunner{
97

10-
void unZipArchiveRelative(String file, String dest) throws ComponentBuildException;
8+
void unZipArchiveRelative(String file, String dest);
119

12-
void unZipArchiveAbsolute(File file, String dest) throws ComponentBuildException;
10+
void unZipArchiveAbsolute(File file, String dest);
1311

14-
void unZipArchiveAbsolute(InputStream file, String dest) throws ComponentBuildException;
12+
void unZipArchiveAbsolute(InputStream file, String dest);
1513

1614
}

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_FileManipulatorTaskRunner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public abstract class _FileManipulatorTaskRunner extends TaskRunnerImpl {
4040
private final static Log _log = LogFactory.getLog(_FileManipulatorTaskRunner.class);
4141

4242
public abstract void createPreMxmlFile(String _preMxmlFilePath, Properties _initProperties, Set _tokenList, String _mxmlComponentName,
43-
String _bodyContent, String _childIdentifier, String _siblingIdentifier) throws ComponentBuildException;
43+
String _bodyContent, String _childIdentifier, String _siblingIdentifier);
4444

45-
public abstract String generateMXMLObjectBeanContent(Set _mxmlObjectBeanWrapperSet, String _fileOutPutPath) throws ComponentBuildException;
45+
public abstract String generateMXMLObjectBeanContent(Set _mxmlObjectBeanWrapperSet, String _fileOutPutPath);
4646

47-
public static synchronized String getComponentTemplate(ClassLoader _loader, String template) throws ComponentBuildException {
47+
public static synchronized String getComponentTemplate(ClassLoader _loader, String template) {
4848
StringBuffer fileContent = new StringBuffer();
4949
BufferedReader bufferRead = null;
5050

@@ -77,7 +77,7 @@ public static synchronized String getComponentTemplate(ClassLoader _loader, Stri
7777
return fileContent.toString();
7878
}
7979

80-
public static synchronized String readFileContent(String fileName) throws ComponentBuildException {
80+
public static synchronized String readFileContent(String fileName) {
8181
StringBuffer fileContent = new StringBuffer();
8282
BufferedReader bufferRead = null;
8383

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_FlexTaskRunner.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,34 @@
2222

2323
import com.googlecode.jsfFlex.shared.adapter._MXMLApplicationContract;
2424
import com.googlecode.jsfFlex.shared.adapter._MXMLContract;
25-
import com.googlecode.jsfFlex.shared.exception.ComponentBuildException;
2625

2726
/**
2827
* @author Ji Hoon Kim
2928
*/
3029
public interface _FlexTaskRunner extends _TaskRunner {
3130

32-
void makeDirectory(String directoryToCreate) throws ComponentBuildException;
31+
void makeDirectory(String directoryToCreate);
3332

34-
void deleteResources(String resourceToDelete, boolean isDirectory) throws ComponentBuildException;
33+
void deleteResources(String resourceToDelete, boolean isDirectory);
3534

36-
void writeBodyContent(_MXMLContract componentMXML) throws ComponentBuildException;
35+
void writeBodyContent(_MXMLContract componentMXML);
3736

38-
void replaceTokenWithValue(_MXMLContract applicationInstance, String valueToReplaceWith, String tokenReplace) throws ComponentBuildException;
37+
void replaceTokenWithValue(_MXMLContract applicationInstance, String valueToReplaceWith, String tokenReplace);
3938

40-
void copyFile(String fileToCopy, String fileToCopyTo) throws ComponentBuildException;
39+
void copyFile(String fileToCopy, String fileToCopyTo);
4140

42-
void copyFileSet(String copyDir, String copyInclude, String copyExclude, String copyTo) throws ComponentBuildException;
41+
void copyFileSet(String copyDir, String copyInclude, String copyExclude, String copyTo);
4342

44-
void createMXML(_MXMLContract applicationInstance, String copyTo) throws ComponentBuildException;
43+
void createMXML(_MXMLContract applicationInstance, String copyTo);
4544

46-
void createSwcSourceFiles(String _swcPath, List _systemSourceFiles, String jsfFlexMainSwcConfigFile) throws ComponentBuildException;
45+
void createSwcSourceFiles(String _swcPath, List _systemSourceFiles, String jsfFlexMainSwcConfigFile);
4746

48-
void createSystemSWCFile(String sourcePath, String outPut, String flexSDKRootPath, String loadConfigFilePath) throws ComponentBuildException;
47+
void createSystemSWCFile(String sourcePath, String outPut, String flexSDKRootPath, String loadConfigFilePath);
4948

50-
void createSWF(_MXMLApplicationContract componentMXML, String mxmlFile, String swfPath, String flexSDKRootPath) throws ComponentBuildException;
49+
void createSWF(_MXMLApplicationContract componentMXML, String mxmlFile, String swfPath, String flexSDKRootPath);
5150

52-
void createSwfSourceFiles(String _swfBasePath, List _systemSwfSourceFiles) throws ComponentBuildException;
51+
void createSwfSourceFiles(String _swfBasePath, List _systemSwfSourceFiles);
5352

54-
void renameFile(String sourceFile, String destFile, boolean overWrite) throws ComponentBuildException;
53+
void renameFile(String sourceFile, String destFile, boolean overWrite);
5554

5655
}

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_RunnerFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
import java.util.Properties;
2323

2424
import com.googlecode.jsfFlex.renderkit.annotationDocletParser._AnnotationDocletParser;
25-
import com.googlecode.jsfFlex.shared.tasks._CommonTaskRunner;
26-
import com.googlecode.jsfFlex.shared.tasks._FileManipulatorTaskRunner;
27-
import com.googlecode.jsfFlex.shared.tasks._FlexTaskRunner;
2825

2926
/**
3027
* Each implementation of _RunnerFactory should return a String specifying the package class<br>

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_Task.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
*/
1919
package com.googlecode.jsfFlex.shared.tasks;
2020

21-
import com.googlecode.jsfFlex.shared.exception.ComponentBuildException;
22-
2321
/**
2422
* @author Ji Hoon Kim
2523
*/
2624
public abstract class _Task {
2725

28-
protected abstract void performTask() throws ComponentBuildException;
26+
protected abstract void performTask();
2927

3028
}

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_TaskRunner.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020

2121
import java.util.Collection;
2222

23-
import com.googlecode.jsfFlex.shared.exception.ComponentBuildException;
24-
2523
/**
2624
* @author Ji Hoon Kim
2725
*/
2826
public interface _TaskRunner {
2927

30-
void addTask(_Task toAdd) throws ComponentBuildException;
28+
void addTask(_Task toAdd);
3129

32-
void addTasks(Collection _tasksToAdd) throws ComponentBuildException;
30+
void addTasks(Collection _tasksToAdd);
3331

34-
void execute() throws ComponentBuildException;
32+
void execute();
3533

3634
}

jsf-flex/core/src/main/java/com/googlecode/jsfFlex/component/MXMLUIButtonBase.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Map;
2222

2323
import javax.faces.context.FacesContext;
24+
import javax.faces.convert.BooleanConverter;
2425
import javax.faces.el.ValueBinding;
2526
import javax.servlet.http.HttpServletRequest;
2627

@@ -34,6 +35,8 @@
3435
public abstract class MXMLUIButtonBase
3536
extends MXMLUIInputBase {
3637

38+
private static final BooleanConverter BOOLEAN_CONVERTER = new BooleanConverter();
39+
3740
private static final String SELECTED_ID_APPENDED = "_selected";
3841
private static final String SELECTED_ATTR = "selected";
3942

@@ -53,7 +56,7 @@ public void decode(FacesContext context) {
5356

5457
if(selectedUpdateVal != null){
5558
setSelected(Boolean.valueOf(selectedUpdateVal));
56-
setSubmittedValue(Boolean.valueOf(selectedUpdateVal));
59+
setSubmittedValue(selectedUpdateVal);
5760
}
5861

5962
}
@@ -73,6 +76,14 @@ public void processUpdates(FacesContext context) {
7376

7477
}
7578

79+
protected Object getConvertedValue(FacesContext context, Object submittedValue) {
80+
if(!(submittedValue instanceof String)){
81+
return submittedValue;
82+
}
83+
84+
return BOOLEAN_CONVERTER.getAsObject(context, this, (String) submittedValue);
85+
}
86+
7687
public abstract Boolean getSelected();
7788

7889
public abstract void setSelected(Boolean selected);

jsf-flex/core/src/main/java/com/googlecode/jsfFlex/component/MXMLUISelectedIndexBase.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Map;
2222

2323
import javax.faces.context.FacesContext;
24+
import javax.faces.convert.IntegerConverter;
2425
import javax.faces.el.ValueBinding;
2526
import javax.servlet.http.HttpServletRequest;
2627

@@ -34,6 +35,8 @@
3435
public abstract class MXMLUISelectedIndexBase
3536
extends MXMLUIInputBase {
3637

38+
private static final IntegerConverter INTEGER_CONVERTER = new IntegerConverter();
39+
3740
private static final String SELECTED_INDEX_ID_APPENDED = "_selectedIndex";
3841
private static final String SELECTED_INDEX_ATTR = "selectedIndex";
3942

@@ -53,7 +56,7 @@ public void decode(FacesContext context) {
5356

5457
if(selectedIndexUpdateVal != null){
5558
setSelectedIndex(Integer.valueOf(selectedIndexUpdateVal));
56-
setSubmittedValue(Integer.valueOf(selectedIndexUpdateVal));
59+
setSubmittedValue(selectedIndexUpdateVal);
5760
}
5861

5962
}
@@ -73,6 +76,14 @@ public void processUpdates(FacesContext context) {
7376

7477
}
7578

79+
protected Object getConvertedValue(FacesContext context, Object submittedValue) {
80+
if(!(submittedValue instanceof String)){
81+
return submittedValue;
82+
}
83+
84+
return INTEGER_CONVERTER.getAsObject(context, this, (String) submittedValue);
85+
}
86+
7687
public abstract Integer getSelectedIndex();
7788

7889
public abstract void setSelectedIndex(Integer selectedIndex);

0 commit comments

Comments
 (0)