MCPcopy Index your code
hub / github.com/apache/groovy / writeValue

Method writeValue

src/main/java/groovy/util/ConfigObject.java:281–289  ·  view source on GitHub ↗
(String key, String space, String prefix, Object value, BufferedWriter out)

Source from the content-addressed store, hash-verified

279 }
280
281 private static void writeValue(String key, String space, String prefix, Object value, BufferedWriter out) throws IOException {
282// key = key.indexOf('.') > -1 ? InvokerHelper.inspect(key) : key;
283 boolean isKeyword = KEYWORDS.contains(key);
284 key = isKeyword ? FormatHelper.inspect(key) : key;
285
286 if (!StringGroovyMethods.asBoolean(prefix) && isKeyword) prefix = "this.";
287 out.append(space).append(prefix).append(key).append('=').append(FormatHelper.inspect(value));
288 out.newLine();
289 }
290
291 private void writeNode(String key, String space, int tab, ConfigObject value, BufferedWriter out) throws IOException {
292 key = KEYWORDS.contains(key) ? FormatHelper.inspect(key) : key;

Callers 1

writeConfigMethod · 0.95

Calls 5

inspectMethod · 0.95
asBooleanMethod · 0.95
newLineMethod · 0.80
containsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected