Constructor and Description |
---|
_Rythm() |
Modifier and Type | Method and Description |
---|---|
static String |
commonsToString(Object obj,
ToStringOption option,
org.apache.commons.lang3.builder.ToStringStyle style) |
static RythmEngine |
engine()
Return the default engine.
|
static Object |
eval(String s) |
static void |
init()
Initialize default engine instance with default configuration.
|
static void |
init(File file)
Initialize default engine instance with specified configuration file
|
static void |
init(Map<String,?> conf)
Initialize default engine instance with specified configuration
|
static void |
init(RythmEngine engine)
Use an pre-initialized engine as the default engine.
|
static boolean |
insideSandbox() |
boolean |
isProdMode()
Check if default engine is running in
production mode |
static String |
render(File file,
Object... args) |
static String |
render(String template,
Object... args) |
static String |
renderIfTemplateExists(String template,
Object... args) |
static String |
renderStr(String template,
Object... args)
Alias of
renderString(String, Object...) |
static String |
renderString(String template,
Object... args) |
static Sandbox |
sandbox() |
static void |
shutdown() |
static String |
substitute(File template,
Object... args) |
static String |
substitute(String template,
Object... args) |
static String |
toString(Object obj) |
static String |
toString(Object obj,
ToStringOption option,
ToStringStyle style) |
static String |
toString(String template,
Object obj) |
public static void init(Map<String,?> conf)
Note this method can not be called more than once during a JVM lifecycle.
if the default engine instance is created already then
an IllegalStateException
will be thrown out
When the default engine's shutdown
method get called
the default engine instance will be discard. Calling any servicing method of
Rythm
will cause an new RythmEngine
initialized as
the new default engine
conf
- the configurationspublic static void init(File file)
Note this method can not be called more than once during a JVM lifecycle.
if the default engine instance is created already then
an IllegalStateException
will be thrown out
When the default engine's shutdown
method get called
the default engine instance will be discard. Calling any servicing method of
Rythm
will cause an new RythmEngine
initialized as
the new default engine
file
- the configuration filepublic static void init()
Just like init(java.util.Map)
method, this method cannot be called
more than once
Note this default engine instance will be implicitly initialized with
the default configuration if render
or the lazy load engine()
methods are called before calling any init
methods
public static void init(RythmEngine engine)
IllegalStateException
When the default engine's shutdown
method get called
the default engine instance will be discard. Calling any servicing method of
Rythm
will cause an new RythmEngine
initialized as
the new default engine
engine
- public static RythmEngine engine()
public static boolean insideSandbox()
RythmEngine.insideSandbox()
public static Sandbox sandbox()
RythmEngine.sandbox()
public boolean isProdMode()
production
modepublic static String render(String template, Object... args)
template
- args
- RythmEngine.render(String, Object...)
public static String render(File file, Object... args)
file
- args
- RythmEngine.render(java.io.File, Object...)
public static String substitute(String template, Object... args)
template
- args
- RythmEngine.substitute(String, Object...)
public static String substitute(File template, Object... args)
template
- args
- RythmEngine.substitute(java.io.File, Object...)
public static String toString(String template, Object obj)
template
- obj
- RythmEngine.toString(String, Object)
public static String toString(Object obj)
obj
- RythmEngine.toString(Object)
public static String toString(Object obj, ToStringOption option, ToStringStyle style)
obj
- option
- style
- RythmEngine.toString(Object, org.rythmengine.toString.ToStringOption, org.rythmengine.toString.ToStringStyle)
public static String commonsToString(Object obj, ToStringOption option, org.apache.commons.lang3.builder.ToStringStyle style)
obj
- option
- style
- RythmEngine.commonsToString(Object, org.rythmengine.toString.ToStringOption, org.apache.commons.lang3.builder.ToStringStyle)
public static String renderStr(String template, Object... args)
renderString(String, Object...)
template
- args
- RythmEngine.renderString(String, Object...)
public static String renderString(String template, Object... args)
template
- args
- RythmEngine.renderString(String, Object...)
public static String renderIfTemplateExists(String template, Object... args)
template
- args
- RythmEngine.renderIfTemplateExists(String, Object...)
public static void shutdown()
RythmEngine.shutdown()
Copyright © 2015. All Rights Reserved.