修改 builder
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package racal.sunyard.main;
|
||||
|
||||
import com.sun.xml.internal.fastinfoset.Encoder;
|
||||
import com.sunyard.SydApi;
|
||||
import com.sunyard.SydApiException;
|
||||
|
||||
@@ -10,21 +11,12 @@ public class SydApiBuilder {
|
||||
private String pwd;
|
||||
private int timeout = 3000;
|
||||
private boolean debug = false;
|
||||
private String encode = Encoder.UTF_8;
|
||||
private boolean useEBCDMode = false;
|
||||
private boolean useETEncrypt = false;
|
||||
private ClassLoader classLoader;
|
||||
private String encode="UTF-8";
|
||||
|
||||
public String getEncode() {
|
||||
return encode;
|
||||
}
|
||||
|
||||
public void setEncode(String encode) {
|
||||
this.encode = encode;
|
||||
}
|
||||
|
||||
|
||||
public SydApi build() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
|
||||
public SydApi build(){
|
||||
|
||||
if ( null == ip || "".equals(ip) ){
|
||||
throw new SydApiException("ip 配置不正确", 40000);
|
||||
@@ -34,23 +26,19 @@ public class SydApiBuilder {
|
||||
System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
}
|
||||
|
||||
Class clazz = classLoader.loadClass("racal.sunyard.main.SydApi4j");
|
||||
Object api = clazz.newInstance();
|
||||
|
||||
|
||||
// SydApi4j api = new SydApi4j();
|
||||
// api.keepBuilder(this);
|
||||
// api.connect( ip , port, pwd, timeout);
|
||||
return (SydApi) api;
|
||||
SydApi4j api = new SydApi4j();
|
||||
api.keepBuilder(this);
|
||||
api.connect( ip , port, pwd, timeout);
|
||||
return api;
|
||||
}
|
||||
|
||||
|
||||
public ClassLoader getClassLoader() {
|
||||
return classLoader;
|
||||
public String getEncode() {
|
||||
return encode;
|
||||
}
|
||||
|
||||
public void setClassLoader(ClassLoader classLoader) {
|
||||
this.classLoader = classLoader;
|
||||
public void setEncode(String encode) {
|
||||
this.encode = encode;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
|
||||
Reference in New Issue
Block a user