Java 类com.sun.codemodel.internal.JCatchBlock 实例源码

项目:OpenJSharp    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:OpenJSharp    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:openjdk-jdk10    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:openjdk-jdk10    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:openjdk9    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:openjdk9    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:lookaside_java-1.8.0-openjdk    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:lookaside_java-1.8.0-openjdk    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:infobip-open-jdk-8    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:infobip-open-jdk-8    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:OLD-OpenJDK8    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:OLD-OpenJDK8    文件:ServiceGenerator.java   
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
项目:openjdk-icedtea7    文件:ServiceGenerator.java   
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}