Java Code Examples for com.sun.codemodel.JFormatter#p()
The following examples show how to use
com.sun.codemodel.JFormatter#p() .
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: KubernetesCoreTypeAnnotator.java From kubernetes-client with Apache License 2.0 | 5 votes |
private JExpressionImpl literalExpression(String literal) { return new JExpressionImpl() { @Override public void generate(JFormatter f) { f.p(literal); } }; }
Example 2
Source File: JTypedInvocation.java From jaxb2-rich-contract-plugin with MIT License | 5 votes |
@Override public void generate(JFormatter f) { if (this.lhs != null) { f = f.g(this.lhs).p('.'); } else if(this.type != null && !this.constructor) { f = f.g(this.type).p('.'); } if (this.type != null && this.constructor) { f = f.p("new").g(this.type).p('('); } else { if (!this.typeArguments.isEmpty()) { f = f.p("<"); boolean first = true; for (final JType typeArg : this.typeArguments) { if (!first) { f = f.p(", "); } else { first = false; } f = f.g(typeArg); } f = f.p(">"); } f = f.p(this.method).p('('); } f.g(this.args); f.p(')'); }
Example 3
Source File: NestedThisRef.java From jaxb2-rich-contract-plugin with MIT License | 4 votes |
@Override public void generate(final JFormatter f) { f.g(jClass); f.p(".this"); }