JVMPlatformContext

com.ossuminc.riddl.utils.JVMPlatformContext

This is the JVM version of the Loader utility. It is used to load file content in UTF-8 via a URL as a String and returning the Future that will obtain it. Further processing can be chained onto the future. This handles the I/O part of parsing in a platform specific way.

Attributes

Source
JVMPlatformContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def dump(url: URL, content: String): Future[Unit]

Asynchronously dump the provided content string into a file

Asynchronously dump the provided content string into a file

Value parameters

content

The string content of the file.

url

The URL to specify the file to dump the string into. This should specify the file:// protocol.

Attributes

Returns
Definition Classes
Source
JVMPlatformContext.scala
override def ec: ExecutionContext

The ExecutionContext that will be used for Futures and Promises

The ExecutionContext that will be used for Futures and Promises

Attributes

Definition Classes
Source
JVMPlatformContext.scala
override def load(url: URL): Future[String]

Load the content of a text file asynchronously and return it as a string.

Load the content of a text file asynchronously and return it as a string. THe content, typically a RIDDL or Markdown file, is expected to be encoded in UTF-8

Value parameters

url

The URL to specify the file to load. This should specify the file:// protocol.

Attributes

Returns

The content of the file as a String, asynchronously in a Future

Definition Classes
Source
JVMPlatformContext.scala
override def newline: String

The newline character for this platform

The newline character for this platform

Attributes

Definition Classes
Source
JVMPlatformContext.scala
override def read(file: URL): String

Read the entire contents of a file and return it, synchronously

Read the entire contents of a file and return it, synchronously

Value parameters

file

The file to read.

Attributes

Returns
Definition Classes
Source
JVMPlatformContext.scala
override def stdout(message: String): Unit

Write a message to the standard output or equivalent for this platform

Write a message to the standard output or equivalent for this platform

Value parameters

message

The message to write to the standard output

Attributes

Definition Classes
Source
JVMPlatformContext.scala
override def stdoutln(message: String): Unit

Write a newline appended message to the stnadard output or equivalent for this platform

Write a newline appended message to the stnadard output or equivalent for this platform

Value parameters

message

The message to write to the standard output

Attributes

Definition Classes
Source
JVMPlatformContext.scala
override def write(file: URL, content: String): Unit

Write the provided content to a file

Write the provided content to a file

Value parameters

content

The content to write

file

The file to be written.

Attributes

Definition Classes
Source
JVMPlatformContext.scala

Inherited methods

def log: Logger

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala

The public accessor to get the current options

The public accessor to get the current options

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala
def withLogger[T, L <: Logger](newLogger: L)(doIt: L => T): T

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala

Do a task with a different set of options and then return to what they were

Do a task with a different set of options and then return to what they were

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala

Inherited fields

protected var logger: Logger

The Logger instance to use on this platform.

The Logger instance to use on this platform.

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala
protected var options_: CommonOptions

The default CommonOptions to use on this platform but not publicly available

The default CommonOptions to use on this platform but not publicly available

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala

Givens

Inherited givens

Attributes

Inherited from:
PlatformContext
Source
PlatformContext.scala