|
|
|
@ -42,8 +42,8 @@ public class TaskList extends Node {
|
|
|
|
|
mChildren = new ArrayList<Task>();
|
|
|
|
|
mIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
// 创建操作的方法,返回一个JSONObject对象
|
|
|
|
|
public JSONObject getCreateAction(int actionId) {
|
|
|
|
|
|
|
|
|
|
public JSONObject getCreateAction(int actionId) {// 创建操作的方法,返回一个JSONObject对象
|
|
|
|
|
JSONObject js = new JSONObject();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -68,8 +68,8 @@ public class TaskList extends Node {
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
Log.e(TAG, e.toString());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
// 如果生成JSONObject失败,则抛出ActionFailureException异常
|
|
|
|
|
throw new ActionFailureException("fail to generate tasklist-create jsonobject");
|
|
|
|
|
|
|
|
|
|
throw new ActionFailureException("fail to generate tasklist-create jsonobject");// 如果生成JSONObject失败,则抛出ActionFailureException异常
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return js;
|
|
|
|
@ -125,8 +125,8 @@ public class TaskList extends Node {
|
|
|
|
|
} catch (JSONException e) {// 当出现JSON解析异常时,捕获该异常
|
|
|
|
|
Log.e(TAG, e.toString());
|
|
|
|
|
e.printStackTrace(); // 打印异常的堆栈跟踪信息,有助于开发人员定位问题
|
|
|
|
|
// 抛出一个新的ActionFailureException异常,并附带错误信息
|
|
|
|
|
throw new ActionFailureException("fail to get tasklist content from jsonobject");
|
|
|
|
|
|
|
|
|
|
throw new ActionFailureException("fail to get tasklist content from jsonobject");// 抛出一个新的ActionFailureException异常,并附带错误信息
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|