public CodeTreeBuilder instanceOf(TypeMirror type) { return string(" instanceof ").type(type); }
public static CodeTree singleType(TypeMirror s) { return createBuilder().type(s).build(); }
public CodeTreeBuilder cast(TypeMirror type) { string("(").type(type).string(") "); return this; }
public CodeTreeBuilder cast(TypeMirror type) { string("(").type(type).string(") "); return this; }
public CodeTreeBuilder instanceOf(CodeTree var, TypeMirror type) { return tree(var).string(" instanceof ").type(type); }
public CodeTreeBuilder instanceOf(CodeTree var, TypeMirror type) { return tree(var).string(" instanceof ").type(type); }
public CodeTreeBuilder typeLiteral(TypeMirror type) { return startGroup().type(ElementUtils.eraseGenericTypes(type)).string(".class").end(); }
public CodeTreeBuilder typeLiteral(TypeMirror type) { return startGroup().type(ElementUtils.eraseGenericTypes(type)).string(".class").end(); }
public CodeTreeBuilder startNew(TypeMirror uninializedNodeClass) { return startGroup().string("new ").type(uninializedNodeClass).startParanthesesCommaGroup().endAfter(); }
public CodeTreeBuilder startNew(TypeMirror uninializedNodeClass) { return startGroup().string("new ").type(uninializedNodeClass).startParanthesesCommaGroup().endAfter(); }
public CodeTreeBuilder cast(TypeMirror type, CodeTree content) { if (ElementUtils.isVoid(type)) { tree(content); return this; } else if (type.getKind() == TypeKind.DECLARED && ElementUtils.getQualifiedName(type).equals("java.lang.Object")) { tree(content); return this; } else { return startGroup().string("(").type(type).string(")").string(" ").tree(content).end(); } }
public CodeTreeBuilder startCatchBlock(TypeMirror exceptionType, String localVarName) { clearLast(CodeTreeKind.NEW_LINE); string(" catch (").type(exceptionType).string(" ").string(localVarName).string(") "); return startBlock(); }
public CodeTreeBuilder startCatchBlock(TypeMirror exceptionType, String localVarName) { clearLast(CodeTreeKind.NEW_LINE); string(" catch (").type(exceptionType).string(" ").string(localVarName).string(") "); return startBlock(); }
public CodeTreeBuilder defaultDeclaration(TypeMirror type, String name) { if (!ElementUtils.isVoid(type)) { startStatement(); type(type); string(" "); string(name); string(" = "); defaultValue(type); end(); // statement } return this; }
public CodeTreeBuilder startCatchBlock(TypeMirror[] exceptionTypes, String localVarName) { clearLast(CodeTreeKind.NEW_LINE); string(" catch ("); for (int i = 0; i < exceptionTypes.length; i++) { if (i != 0) { string(" | "); } type(exceptionTypes[i]); } string(" ").string(localVarName).string(") "); return startBlock(); }
public CodeTreeBuilder startCatchBlock(TypeMirror[] exceptionTypes, String localVarName) { clearLast(CodeTreeKind.NEW_LINE); string(" catch ("); for (int i = 0; i < exceptionTypes.length; i++) { if (i != 0) { string(" | "); } type(exceptionTypes[i]); } string(" ").string(localVarName).string(") "); return startBlock(); }
public CodeTreeBuilder defaultDeclaration(TypeMirror type, String name) { if (!ElementUtils.isVoid(type)) { startStatement(); type(type); string(" "); string(name); string(" = "); defaultValue(type); end(); // statement } return this; }
public CodeTreeBuilder cast(TypeMirror type, CodeTree content) { if (ElementUtils.isVoid(type)) { tree(content); return this; } else { return startGroup().string("(").type(type).string(")").string(" ").tree(content).end(); } }
public CodeTreeBuilder startNewArray(ArrayType arrayType, CodeTree size) { startGroup().string("new ").type(arrayType.getComponentType()).string("["); if (size != null) { tree(size); } string("]"); if (size == null) { string(" "); startCurlyBracesCommaGroup().endAfter(); } return this; }
public CodeTreeBuilder startNewArray(ArrayType arrayType, CodeTree size) { startGroup().string("new ").type(arrayType.getComponentType()).string("["); if (size != null) { tree(size); } string("]"); if (size == null) { string(" "); startCurlyBracesCommaGroup().endAfter(); } return this; }