public SoyValue applyForJava()

in java/com/google/cloud/deploymentmanager/autogen/soy/SoyDirectives.java [405:432]


    public SoyValue applyForJava(SoyValue value, List<SoyValue> args) {
      Preconditions.checkArgument(
          value instanceof PrimitiveData || value instanceof SanitizedContent,
          "|yamlprimitive directive only supports primitive types");
      Node node;
      if (value instanceof BooleanData) {
        node = representer.represent(value.booleanValue());
      } else if (value instanceof FloatData) {
        node = representer.represent(value.floatValue());
      } else if (value instanceof IntegerData) {
        node = representer.represent(value.integerValue());
      } else {
        node = representer.represent(value.coerceToString());
      }
      int indent = args.get(0).integerValue();
      StringWriter writer = new StringWriter();
      Serializer serializer = new Serializer(
          new Emitter(writer, dumperOptions), resolver, dumperOptions, null);
      try {
        serializer.open();
        serializer.serialize(node);
        serializer.close();
        return StringData.forValue(indentLines(writer.toString().trim(), indent));
      } catch (IOException e) {
        // Should not happen.
        throw new RuntimeException(e);
      }
    }