Java Code Examples for com.sun.codemodel.internal.JBlock#_if
The following examples show how to use
com.sun.codemodel.internal.JBlock#_if .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 2
Source File: ServiceGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 3
Source File: ServiceGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 4
Source File: ElementSingleAdapter.java From hottub with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 5
Source File: ServiceGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 6
Source File: ServiceGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 7
Source File: ServiceGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 8
Source File: ServiceGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 9
Source File: ElementSingleAdapter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 10
Source File: ElementSingleAdapter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 11
Source File: ElementSingleAdapter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 12
Source File: ServiceGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 13
Source File: ElementSingleAdapter.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 14
Source File: ServiceGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 15
Source File: ElementSingleAdapter.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 16
Source File: ElementSingleAdapter.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 17
Source File: ServiceGenerator.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 18
Source File: ServiceGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }
Example 19
Source File: ElementSingleAdapter.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
Example 20
Source File: ServiceGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) { JBlock staticBlock = cls.init(); staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation)); JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null()); JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null())); ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg( "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath.")); staticBlock.assign(exField, exVar); }