📄 staxreturnaction.java
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF) *//* (C) Copyright IBM Corp. 2002 *//* *//* This software is licensed under the Common Public License (CPL) V1.0. *//*****************************************************************************/package com.ibm.staf.service.stax;import org.python.core.*;public class STAXReturnAction implements STAXAction{ public STAXReturnAction() { /* Do Nothing */ } public STAXReturnAction(String value) { fValue = value; } public String getValue() { return fValue; } public void setValue(String value) { fValue = value; } public String getXMLInfo() { return "<return>" + fValue + "</return>"; } public String getInfo() { int valueLength = fValue.length(); if (valueLength > 40) return fValue.substring(0, 40) + "..."; else return fValue; } public String getDetails() { return "Value:" + fValue; } public void execute(STAXThread thread) { if (fValue.equals(null)) { fValue = "None"; } thread.popAction(); PyObject result = null; try { result = thread.pyObjectEval(fValue); thread.addCondition(new STAXReturnCondition(result)); } catch (STAXPythonEvaluationException e) { thread.pySetVar("STAXResult", Py.None); thread.setSignalMsgVar("STAXPythonEvalMsg", getXMLInfo(), e); thread.raiseSignal("STAXPythonEvaluationError"); } } public void handleCondition(STAXThread thread, STAXCondition cond) { thread.popAction(); } public STAXAction cloneAction() { STAXReturnAction clone = new STAXReturnAction(fValue); return clone; } private String fValue = "None";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -