BowlerKernel
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
com.neuronrobotics.bowlerstudio.scripting.ClojureHelper Class Reference
Inheritance diagram for com.neuronrobotics.bowlerstudio.scripting.ClojureHelper:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.bowlerstudio.scripting.ClojureHelper:
Collaboration graph
[legend]

Public Member Functions

Object inlineScriptRun (File code, ArrayList< Object > args)
 
Object inlineScriptRun (String code, ArrayList< Object > args)
 
String getShellType ()
 
boolean getIsTextFile ()
 
String getDefaultContents ()
 
ArrayList< String > getFileExtenetion ()
 
- Public Member Functions inherited from com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage
default boolean isSupportedFileExtenetion (String filename)
 
default String getDefaultContents (String gitURL, String fileSlug)
 

Static Public Member Functions

static Object require (String nsName)
 
static Object readString (String s)
 
static Var var (String varName)
 
static Var var (String nsName, String varName)
 
static Object eval (String string)
 

Static Public Attributes

static Var REQUIRE = var("clojure.core", "require")
 
static Var META = var("clojure.core", "meta")
 
static Var EVAL = var("clojure.core", "eval")
 
static Var READ_STRING = var("clojure.core", "load-string")
 

Detailed Description

Class containing static utility methods for Java to Clojure interop

Author
Mike https://github.com/mikera/clojure-utils/blob/master/src/main/java/mikera/cljutils/Clojure.java

Definition at line 19 of file ClojureHelper.java.

Member Function Documentation

◆ eval()

static Object com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.eval ( String  string)
static

Evaluates a String, which should contain valid Clojure code.

Definition at line 60 of file ClojureHelper.java.

References com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.EVAL, and com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.readString().

Referenced by com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.inlineScriptRun().

Here is the call graph for this function:

◆ getDefaultContents()

String com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.getDefaultContents ( )

Get the contents of an empty file

Returns

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 101 of file ClojureHelper.java.

◆ getFileExtenetion()

ArrayList<String> com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.getFileExtenetion ( )

Returns the list of supported file extentions Convention is to provide just the leters that make up the file extention

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 106 of file ClojureHelper.java.

◆ getIsTextFile()

boolean com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.getIsTextFile ( )

This function returns if this is a binary file or a text file

Returns
true if the file is a text file.

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 91 of file ClojureHelper.java.

◆ getShellType()

String com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.getShellType ( )

Returns the HashMap key for this language

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 86 of file ClojureHelper.java.

◆ inlineScriptRun() [1/2]

Object com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.inlineScriptRun ( File  code,
ArrayList< Object >  args 
)

This interface is for adding additional language support.

Parameters
codefile content of the code to be executed
argsthe incoming arguments as a list of objects
Returns
the objects returned form the code that ran

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 65 of file ClojureHelper.java.

◆ inlineScriptRun() [2/2]

Object com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.inlineScriptRun ( String  code,
ArrayList< Object >  args 
)

This interface is for adding additional language support.

Parameters
codethe text content of the code to be executed
argsthe incoming arguments as a list of objects
Returns
the objects returned form the code that ran

Implements com.neuronrobotics.bowlerstudio.scripting.IScriptingLanguage.

Definition at line 80 of file ClojureHelper.java.

References com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.eval().

Here is the call graph for this function:

◆ readString()

static Object com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.readString ( String  s)
static

◆ require()

static Object com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.require ( String  nsName)
static

Require a namespace by name, loading it if necessary.

Calls clojure.core/require

Definition at line 31 of file ClojureHelper.java.

References com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.REQUIRE.

◆ var() [1/2]

static Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.var ( String  nsName,
String  varName 
)
static

Looks up a var by name in the given namespace.

The var can subsequently be invoked if it is a function.

Definition at line 53 of file ClojureHelper.java.

◆ var() [2/2]

static Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.var ( String  varName)
static

Looks up a var by name in the clojure.core namespace.

The var can subsequently be invoked if it is a function.

Definition at line 44 of file ClojureHelper.java.

Member Data Documentation

◆ EVAL

Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.EVAL = var("clojure.core", "eval")
static

◆ META

Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.META = var("clojure.core", "meta")
static

Definition at line 22 of file ClojureHelper.java.

◆ READ_STRING

Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.READ_STRING = var("clojure.core", "load-string")
static

◆ REQUIRE

Var com.neuronrobotics.bowlerstudio.scripting.ClojureHelper.REQUIRE = var("clojure.core", "require")
static

The documentation for this class was generated from the following file: