我想在 Class中访问变量sTerminalId
&sTransactionId
ServerThread
public class ServerThread extends Thread {
/* Some Code Omitted Here */
public void run() {
String sDataFromPOS="";
//Get Some Value in sDataFromPOS
byte[] bSendToPOS = SAXHandler.ParseXMLToString(sDataFromPOS.toString().substring(2));
}
}
public class SAXHandler extends DefaultHandler {
static String sTerminalId = "";
static String sTransactionId = "";
public static byte[] ParseXMLToString(String sXMLData) throws Throwable {
/* Do Some Operation on String sXMLData & extarct value of sTerminalId & sTransactionId*/
}
}
我尝试的是
SAXHandler.sTerminalId
会给我带来价值,但如果再次运行它只会给我一次运行它给我以前的价值。有什么选择吗?我正在处理敏感数据,所以不想弄乱我的代码