• Home
  • Raw
  • Download

Lines Matching refs:writer

155 void WriteJavaAnnotation(CodeWriter& writer, sysprop::Scope scope);
276 void WriteJavaAnnotation(CodeWriter& writer, sysprop::Scope scope) { in WriteJavaAnnotation() argument
279 writer.Write("/** @hide */\n"); in WriteJavaAnnotation()
280 writer.Write("@SystemApi\n"); in WriteJavaAnnotation()
283 writer.Write("/** @hide */\n"); in WriteJavaAnnotation()
305 CodeWriter writer(kIndent); in GenerateJavaClass() local
306 writer.Write("%s", kGeneratedFileFooterComments); in GenerateJavaClass()
307 writer.Write("package %s;\n\n", package_name.c_str()); in GenerateJavaClass()
308 writer.Write("%s", kJavaFileImports); in GenerateJavaClass()
309 WriteJavaAnnotation(writer, classScope); in GenerateJavaClass()
310 writer.Write("public final class %s {\n", class_name.c_str()); in GenerateJavaClass()
311 writer.Indent(); in GenerateJavaClass()
312 writer.Write("private %s () {}\n\n", class_name.c_str()); in GenerateJavaClass()
313 writer.Write("%s", kJavaParsersAndFormatters); in GenerateJavaClass()
316 writer.Write("\n"); in GenerateJavaClass()
325 WriteJavaAnnotation(writer, prop.scope()); in GenerateJavaClass()
327 writer.Write("public static enum %s {\n", in GenerateJavaClass()
329 writer.Indent(); in GenerateJavaClass()
334 writer.Write("%s(\"%s\")", ToUpper(name).c_str(), name.c_str()); in GenerateJavaClass()
336 writer.Write(",\n"); in GenerateJavaClass()
338 writer.Write(";\n"); in GenerateJavaClass()
341 writer.Write( in GenerateJavaClass()
345 writer.Indent(); in GenerateJavaClass()
346 writer.Write("this.propValue = propValue;\n"); in GenerateJavaClass()
347 writer.Dedent(); in GenerateJavaClass()
348 writer.Write( in GenerateJavaClass()
351 writer.Indent(); in GenerateJavaClass()
352 writer.Write("return propValue;\n"); in GenerateJavaClass()
353 writer.Dedent(); in GenerateJavaClass()
354 writer.Write("}\n"); in GenerateJavaClass()
355 writer.Dedent(); in GenerateJavaClass()
356 writer.Write("}\n\n"); in GenerateJavaClass()
360 WriteJavaAnnotation(writer, prop.scope()); in GenerateJavaClass()
364 writer.Write("public static %s %s() {\n", prop_type.c_str(), in GenerateJavaClass()
366 writer.Indent(); in GenerateJavaClass()
367 writer.Write("String value = SystemProperties.get(\"%s\");\n", in GenerateJavaClass()
369 writer.Write("return %s;\n", GetParsingExpression(prop).c_str()); in GenerateJavaClass()
370 writer.Dedent(); in GenerateJavaClass()
371 writer.Write("}\n"); in GenerateJavaClass()
373 writer.Write("public static Optional<%s> %s() {\n", prop_type.c_str(), in GenerateJavaClass()
375 writer.Indent(); in GenerateJavaClass()
376 writer.Write("String value = SystemProperties.get(\"%s\");\n", in GenerateJavaClass()
378 writer.Write("return Optional.ofNullable(%s);\n", in GenerateJavaClass()
380 writer.Dedent(); in GenerateJavaClass()
381 writer.Write("}\n"); in GenerateJavaClass()
385 writer.Write("\n"); in GenerateJavaClass()
387 WriteJavaAnnotation(writer, sysprop::Internal); in GenerateJavaClass()
389 writer.Write("public static void %s(%s value) {\n", prop_id.c_str(), in GenerateJavaClass()
391 writer.Indent(); in GenerateJavaClass()
392 writer.Write("SystemProperties.set(\"%s\", value == null ? \"\" : %s);\n", in GenerateJavaClass()
395 writer.Dedent(); in GenerateJavaClass()
396 writer.Write("}\n"); in GenerateJavaClass()
400 writer.Dedent(); in GenerateJavaClass()
401 writer.Write("}\n"); in GenerateJavaClass()
403 *java_result = writer.Code(); in GenerateJavaClass()