Home
last modified time | relevance | path

Searched refs:codeBlock (Results 1 – 25 of 52) sorted by relevance

123

/external/aws-sdk-java-v2/codegen/src/main/java/software/amazon/awssdk/codegen/poet/waiters/
DJmesPathAcceptorGenerator.java71 CodeBlock.Builder codeBlock = CodeBlock.builder(); in interpret() local
72 Visitor visitor = new Visitor(codeBlock, inputValue); in interpret()
74 return visitor.codeBlock.build(); in interpret()
81 private final CodeBlock.Builder codeBlock; field in JmesPathAcceptorGenerator.Visitor
85 private Visitor(CodeBlock.Builder codeBlock, String inputValue) { in Visitor() argument
86 this.codeBlock = codeBlock; in Visitor()
87 this.codeBlock.add(inputValue); in Visitor()
121 codeBlock.add(".index(" + input.asNumber() + ")"); in visitBracketSpecifierWithContents()
129 codeBlock.add(".flatten()"); in visitBracketSpecifierWithoutContents()
135 codeBlock.add(".filter($1N -> $1N", currentVariable()); in visitBracketSpecifierWithQuestionMark()
[all …]
/external/dagger2/java/dagger/internal/codegen/javapoet/
DExpression.java41 private final CodeBlock codeBlock; field in Expression
43 private Expression(ExpressionType type, CodeBlock codeBlock) { in Expression() argument
45 this.codeBlock = codeBlock; in Expression()
68 return create(newType, CodeBlock.of("($T) $L", newType.getTypeName(), codeBlock)); in castTo()
75 CodeBlock.of("($T) $L", newRawType.getTypeName(), codeBlock)); in castTo()
94 public CodeBlock codeBlock() { in codeBlock() method in Expression
95 return codeBlock; in codeBlock()
100 return String.format("[%s] %s", type.getTypeName(), codeBlock); in toString()
/external/dagger2/java/dagger/internal/codegen/binding/
DFrameworkType.java89 CodeBlock codeBlock = to( in to() local
91 from.codeBlock()); in to()
94 return Expression.create(from.type().unwrapType(), codeBlock); in to()
102 codeBlock); in to()
105 return Expression.create(from.type().rewrapType(TypeNames.LISTENABLE_FUTURE), codeBlock); in to()
109 from.type().rewrapType(RequestKinds.frameworkClassName(requestKind)), codeBlock); in to()
144 from.codeBlock())); in to()
/external/javapoet/src/main/java/com/squareup/javapoet/
DCodeWriter.java140 public void emitComment(CodeBlock codeBlock) throws IOException { in emitComment() argument
144 emit(codeBlock); in emitComment()
226 public CodeWriter emit(CodeBlock codeBlock) throws IOException { in emit() argument
227 return emit(codeBlock, false); in emit()
230 public CodeWriter emit(CodeBlock codeBlock, boolean ensureTrailingNewline) throws IOException { in emit() argument
233 ListIterator<String> partIterator = codeBlock.formatParts.listIterator(); in emit()
238 emitLiteral(codeBlock.args.get(a++)); in emit()
242 emitAndIndent((String) codeBlock.args.get(a++)); in emit()
246 String string = (String) codeBlock.args.get(a++); in emit()
254 TypeName typeName = (TypeName) codeBlock.args.get(a++); in emit()
[all …]
DMethodSpec.java448 public Builder addCode(CodeBlock codeBlock) { in addCode() argument
449 code.add(codeBlock); in addCode()
462 public Builder defaultValue(CodeBlock codeBlock) { in defaultValue() argument
464 this.defaultValue = checkNotNull(codeBlock, "codeBlock == null"); in defaultValue()
481 public Builder beginControlFlow(CodeBlock codeBlock) { in beginControlFlow() argument
482 return beginControlFlow("$L", codeBlock); in beginControlFlow()
498 public Builder nextControlFlow(CodeBlock codeBlock) { in nextControlFlow() argument
499 return nextControlFlow("$L", codeBlock); in nextControlFlow()
520 public Builder endControlFlow(CodeBlock codeBlock) { in endControlFlow() argument
521 return endControlFlow("$L", codeBlock); in endControlFlow()
[all …]
DCodeBlock.java407 public Builder addStatement(CodeBlock codeBlock) {
408 return addStatement("$L", codeBlock);
411 public Builder add(CodeBlock codeBlock) {
412 formatParts.addAll(codeBlock.formatParts);
413 args.addAll(codeBlock.args);
448 CodeBlockJoiner add(CodeBlock codeBlock) {
454 builder.add(codeBlock);
DAnnotationSpec.java99 for (CodeBlock codeBlock : values) { in emitAnnotationValues()
101 codeWriter.emit(codeBlock); in emitAnnotationValues()
206 public Builder addMember(String name, CodeBlock codeBlock) { in addMember() argument
208 values.add(codeBlock); in addMember()
DFieldSpec.java165 public Builder initializer(CodeBlock codeBlock) { in initializer() argument
167 this.initializer = checkNotNull(codeBlock, "codeBlock == null"); in initializer()
/external/kotlinpoet/kotlinpoet/src/commonMain/kotlin/com/squareup/kotlinpoet/
DCodeWriter.kt121 fun emitComment(codeBlock: CodeBlock) { in emitComment()
125 emitCode(codeBlock) in emitComment()
238 codeBlock: CodeBlock, in emitCode()
245 val partIterator = codeBlock.formatParts.listIterator() in emitCode()
248 "%L" -> emitLiteral(codeBlock.args[a++], isConstantContext, omitImplicitModifiers) in emitCode()
250 "%N" -> emit(codeBlock.args[a++] as String) in emitCode()
253 val string = codeBlock.args[a++] as String? in emitCode()
268 val string = codeBlock.args[a++]?.let { arg -> in emitCode()
289 var typeName = codeBlock.args[a++] as TypeName in emitCode()
297 if (!codeBlock.formatParts[partIterator.nextIndex()].startsWith("%")) { in emitCode()
[all …]
DPropertySpec.kt103 codeBlock = CodeBlock.of(initializerFormat, initializer.trimTrailingNewLine()), in emit()
222 public fun initializer(codeBlock: CodeBlock?): Builder = apply { in initializer()
223 this.initializer = codeBlock in initializer()
230 public fun delegate(codeBlock: CodeBlock): Builder = apply { in delegate()
231 this.initializer = codeBlock in delegate()
DFunSpec.kt237 val codeBlock = this.trim() in <lambda>() constant
238 val asReturnExpressionBody = codeBlock.withoutPrefix(RETURN_EXPRESSION_BODY_PREFIX_SPACE) in <lambda>()
239 ?: codeBlock.withoutPrefix(RETURN_EXPRESSION_BODY_PREFIX_NBSP) in <lambda>()
243 if (codeBlock.withoutPrefix(THROW_EXPRESSION_BODY_PREFIX_SPACE) != null || in <lambda>()
244 codeBlock.withoutPrefix(THROW_EXPRESSION_BODY_PREFIX_NBSP) != null in <lambda>()
246 return codeBlock in <lambda>()
503 public fun addCode(codeBlock: CodeBlock): Builder = apply { in <lambda>()
504 body.add(codeBlock) in <lambda>()
DAnnotationSpec.kt81 codeBlock = members in <lambda>()
132 public fun addMember(codeBlock: CodeBlock): Builder = apply { in <lambda>()
133 members += codeBlock in <lambda>()
/external/aws-sdk-java-v2/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/
DXmlProtocolSpec.java127 CodeBlock.Builder codeBlock = CodeBlock.builder() in executionHandler() local
143 codeBlock.add(NoneAuthTypeRequestTrait.create(opModel)); in executionHandler()
146 codeBlock.add(RequestCompressionTrait.create(opModel, model)); in executionHandler()
148 s3ArnableFields(opModel, model).ifPresent(codeBlock::add); in executionHandler()
151 return codeBlock.add(".withRequestBody(requestBody)") in executionHandler()
155 return codeBlock.add(".withMarshaller(new $T(protocolFactory)) $L);", marshaller, in executionHandler()
160 CodeBlock.Builder codeBlock = CodeBlock.builder(); in s3ArnableFields() local
165 codeBlock.add(".putExecutionAttribute($T.$N, $T.builder().arn(arn).build())", in s3ArnableFields()
170 return Optional.of(codeBlock.build()); in s3ArnableFields()
DQueryProtocolSpec.java109 CodeBlock.Builder codeBlock = in executionHandler() local
127 codeBlock.add(NoneAuthTypeRequestTrait.create(opModel)); in executionHandler()
130 codeBlock.add(RequestCompressionTrait.create(opModel, intermediateModel)); in executionHandler()
133 return codeBlock.add(".withRequestBody(requestBody)") in executionHandler()
137 return codeBlock.add(".withMarshaller(new $T(protocolFactory)) $L);", marshaller, in executionHandler()
DJsonProtocolSpec.java180 CodeBlock.Builder codeBlock = in executionHandler() local
198 codeBlock.add(NoneAuthTypeRequestTrait.create(opModel)); in executionHandler()
201 codeBlock.add(RequestCompressionTrait.create(opModel, model)); in executionHandler()
204 codeBlock.add(".withRequestBody(requestBody)") in executionHandler()
207 codeBlock.add(".withMarshaller(new $T(protocolFactory))", marshaller); in executionHandler()
210 return codeBlock.add("$L);", opModel.hasStreamingOutput() ? ", responseTransformer" : "") in executionHandler()
/external/kotlinpoet/kotlinpoet/src/commonTest/kotlin/com/squareup/kotlinpoet/
DCodeBlockTest.kt229 val codeBlock = CodeBlock.builder() in tooManyStatementEnters() constant
234 codeBlock.toString() in tooManyStatementEnters()
248 val codeBlock = CodeBlock.builder() in statementExitWithoutStatementEnter() constant
253 codeBlock.toString() in statementExitWithoutStatementEnter()
531 val codeBlock = buildCodeBlock { in buildCodeBlock() constant
538 assertThat(codeBlock.toString()).isEqualTo( in buildCodeBlock()
577 val codeBlock = CodeBlock.builder() in ensureEndsWithNewLineWithNoArgs() constant
583 assertThat(codeBlock.ensureEndsWithNewLine().toString()).isEqualTo( in ensureEndsWithNewLineWithNoArgs()
612 val codeBlock = CodeBlock.Builder() in withIndent() constant
628 assertThat(codeBlock.toString()).isEqualTo( in withIndent()
/external/dagger2/java/dagger/internal/codegen/writing/
DComponentRequestRepresentations.java142 .map(Expression::codeBlock) in getCreateMethodArgumentsCodeBlocks()
193 return expression.codeBlock().isEmpty() in getComponentMethodCodeBlock()
194 ? expression.codeBlock() in getComponentMethodCodeBlock()
195 : CodeBlock.of("$L;", expression.codeBlock()); in getComponentMethodCodeBlock()
197 return CodeBlock.of("return $L;", expression.codeBlock()); in getComponentMethodCodeBlock()
DImmediateFutureRequestRepresentation.java69 expression.codeBlock()); in instanceExpression()
72 return expression.codeBlock(); in instanceExpression()
DMembersInjectionMethods.java86 ? CodeBlock.of("$L($L)", expression.codeBlock(), instance) in getInjectExpression()
90 expression.codeBlock(), in getInjectExpression()
138 .codeBlock())); in injectMethodExpression()
/external/dagger2/javatests/dagger/internal/codegen/
DExpressionTest.java65 assertThat(castTo.codeBlock().toString()) in castTo()
78 assertThat(boxedExpression.codeBlock().toString()).isEqualTo("(java.lang.Integer) 5"); in box()
/external/aws-sdk-java-v2/codegen/src/main/java/software/amazon/awssdk/codegen/poet/common/
DUserAgentUtilsSpec.java78 CodeBlock codeBlock = CodeBlock.builder() in applyUserAgentInfoMethod() local
95 .addCode(codeBlock) in applyUserAgentInfoMethod()
/external/javapoet/src/test/java/com/squareup/javapoet/
DCodeBlockTest.java284 CodeBlock codeBlock = CodeBlock.builder().add("$[$[").build(); in tooManyStatementEnters() local
287 codeBlock.toString(); in tooManyStatementEnters()
295 CodeBlock codeBlock = CodeBlock.builder().add("$]").build(); in statementExitWithoutStatementEnter() local
298 codeBlock.toString(); in statementExitWithoutStatementEnter()
/external/aws-sdk-java-v2/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/
DJsonMarshallerSpec.java113 CodeBlock codeBlock = initializationCodeBlockBuilder.add(".build()").build(); in operationInfoField() local
117 .initializer(codeBlock) in operationInfoField()
DQueryMarshallerSpec.java116 CodeBlock codeBlock = initializationCodeBlockBuilder.add(".build()").build(); in memberVariables() local
120 .initializer(codeBlock); in memberVariables()
/external/aws-sdk-java-v2/codegen-lite/src/main/java/software/amazon/awssdk/codegen/lite/defaultsmode/
DDefaultsModeConfigurationGenerator.java138 …private void putItemsToEnumMap(CodeBlock.Builder codeBlock, Set<String> modes, String suffix, Stri… in putItemsToEnumMap() argument
141 codeBlock.addStatement("$N.put(DefaultsMode.$N, $N)", mapName, mode, mode + suffix); in putItemsToEnumMap()
145 codeBlock.addStatement("$N.put(DefaultsMode.LEGACY, LEGACY$N)", mapName, suffix); in putItemsToEnumMap()

123