public class YamlMethods extends Object
Constructor and Description |
---|
YamlMethods() |
Modifier and Type | Method and Description |
---|---|
static String |
asYaml(io.toro.gloop.object.property.GloopObject gloopObject,
boolean includeRoot,
boolean includeNulls) |
static io.toro.gloop.object.cursor.GloopCursor |
getInputCursorFromFile(String filename,
List<String> yamlNodeNames,
io.toro.gloop.engine.GloopExecutionContext context) |
static io.toro.gloop.object.cursor.GloopCursor |
getInputCursorFromInputStream(InputStream inputStream,
List<String> yamlNodeNames,
io.toro.gloop.engine.GloopExecutionContext context) |
static String |
gloopModelToYamlString(io.toro.gloop.object.property.GloopObject gloopObject) |
static io.toro.gloop.object.property.GloopObject |
inputStreamToGloopObject(InputStream yamlStream) |
static io.toro.gloop.object.property.GloopModel |
openYamlOutputCursor(boolean printStartDocument,
String name,
String indent,
boolean closeDestination,
Object destination,
io.toro.gloop.engine.GloopExecutionContext context) |
static void |
printYaml(IndentPrinter printer,
io.toro.gloop.object.property.GloopObject gloopObject,
boolean includeNulls) |
static io.toro.gloop.object.property.GloopObject |
readerToGloopObject(Reader yamlString) |
static void |
writeYaml(Writer writer,
io.toro.gloop.object.property.GloopObject gloopObject,
boolean includeNulls) |
static io.toro.gloop.object.property.GloopObject |
yamlStringToGloopObject(String yamlString) |
@GloopComment(value="Convert a gloop object to YAML") @GloopParameter(value="Yaml string", name="gloopYaml") public static String gloopModelToYamlString(io.toro.gloop.object.property.GloopObject gloopObject)
public static io.toro.gloop.object.property.GloopObject yamlStringToGloopObject(String yamlString)
public static io.toro.gloop.object.property.GloopObject inputStreamToGloopObject(InputStream yamlStream)
public static io.toro.gloop.object.property.GloopObject readerToGloopObject(Reader yamlString)
@GloopComment(value="Marshalls the given gloop object as a yaml string") public static String asYaml(@GloopParameter(allowNull=false) io.toro.gloop.object.property.GloopObject gloopObject, @GloopParameter(defaultValue="false") boolean includeRoot, @GloopParameter(defaultValue="false") boolean includeNulls)
@GloopComment(value="Marshalls the given gloop object to a writer") public static void writeYaml(@GloopParameter(allowNull=false) Writer writer, @GloopParameter(allowNull=false) io.toro.gloop.object.property.GloopObject gloopObject, @GloopParameter(defaultValue="false") boolean includeNulls)
@GloopComment(value="Marshalls the given gloop object to an indent printer") public static void printYaml(@GloopParameter(allowNull=false) IndentPrinter printer, @GloopParameter(allowNull=false) io.toro.gloop.object.property.GloopObject gloopObject, @GloopParameter(defaultValue="false") boolean includeNulls)
@GloopComment(value="Parses a large YAML file. Use the yamlNodeNames property to tell it which nodes you want toextract from the YAML file.Use $yamlRoot for root arrays") @GloopObjectParameter(value="gloopYamlCursor{\n gloopYamlCursor[]{\n nodeName\n cursorRecord:object\n }\n}") public static io.toro.gloop.object.cursor.GloopCursor getInputCursorFromFile(String filename, List<String> yamlNodeNames, io.toro.gloop.engine.GloopExecutionContext context) throws FileNotFoundException
FileNotFoundException
@GloopComment(value="Parses a large YAML file. Use the yamlNodeNames property to tell it which nodes you want to extract from the YAML file.Use $yamlRoot for root arrays") @GloopObjectParameter(value="gloopYamlCursor{\n gloopYamlCursor[]{\n nodeName\n cursorRecord:object\n }\n}") public static io.toro.gloop.object.cursor.GloopCursor getInputCursorFromInputStream(InputStream inputStream, List<String> yamlNodeNames, io.toro.gloop.engine.GloopExecutionContext context)
@GloopObjectParameter(value="output{\nyamlCursorOutput{\nindentPrinter:object:printer used to write the yaml out to::::groovy.util.IndentPrinter\nyamlOutputCursor[]*{\n}\n}\n}") public static io.toro.gloop.object.property.GloopModel openYamlOutputCursor(@GloopParameter(defaultValue="true",value="True if the cursor will print a `---` at the start of document") boolean printStartDocument, @GloopParameter(value="The name to print before declaring the array (null if there is no name)") String name, @GloopParameter(allowNull=false,defaultValue=" ",value="The indent to use for printing. Default is 2 spaces") String indent, @GloopParameter(defaultValue="true",value="True if the cursor will close ethe underlying destination after printing closing text") boolean closeDestination, @GloopParameter(value="Must be a StringBuffer, Writer, OutputStream or File") Object destination, io.toro.gloop.engine.GloopExecutionContext context) throws IOException
IOException
Copyright © 2019. All rights reserved.