public class URIInvoker extends InvokerMXBean.Invoker
InvokerMXBean.Invoker| Modifier and Type | Field and Description |
|---|---|
static String[] |
SIZE_STEPS
The size step suffixes
|
| Constructor and Description |
|---|
URIInvoker(Map<String,Object> targetMap) |
URIInvoker(Object... targets) |
URIInvoker(Object target) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTarget(String targetName,
Object targetObject)
Add one target
|
void |
addTargets(Map<String,Object> targetMap)
Add more targets.
|
void |
addTargets(Object... targets)
Add more targets.
|
void |
appendError(Appendable value,
Throwable th)
Builds error message from given exception.
|
void |
appendRunLink(Appendable value,
String runLink)
Appends the run value of the given input.
|
void |
appendRunValue(Appendable value,
String runThis)
Appends the run value of the given input.
|
void |
appendValue(Appendable value,
Object obj)
Append the objects string representation to the given appendable.
|
void |
appendValue(Appendable value,
String keys,
boolean isProperty)
Appends the json object value of the supplied comma separated keys.
|
void |
appendValue(Appendable value,
String targetName,
String keys,
boolean isProperty)
Appends the json object value of the supplied comma separated keys.
|
String |
convert(Object obj)
Convert an object to string.
|
Method |
findMethod(Class<?> classz,
String methodName,
int totalArguments)
Find first method matching name and no.
|
org.apache.commons.beanutils.ConvertUtilsBean |
getConvertUtil() |
ScriptEngine |
getJsEngine() |
Map<String,Object> |
getTargetMap() |
Object |
invokeNestedMethod(Object targetObj,
String nestedMethod)
Invoke a nested method/property on target object.
|
Object |
invokeNestedMethod(String targetName,
String nestedMethod)
Invoke a nested method/property on target object.
|
static String |
readableSize(long size)
Returns a readable size representation of the given bytes size.
|
void |
resetJsEngine()
Reset the JS Engine.
|
void |
resetJsEngine(String engineName)
Reset the JS Engine with given one.
|
Object |
run(String script)
Evaluates the given script.
|
Object |
runLink(String link)
Evaluates the content of the js from given link.
|
Object |
runThis(String name,
String... args)
Run any on this.
|
void |
setTarget(Object target)
Set the target.
|
void |
setTarget(String name,
Object target)
Set the target with name.
|
static long |
sizeof(Object obj)
Calculates the size of the the given object.
|
long |
sizeofProperty(String targetName,
String propertyName)
Calculates the size of the object represented by the property over the target.
|
String |
toSize(String targetName,
String propertyName)
Gives the string representation of the size of the object represented by the property over
the target.
|
printThispublic static final String[] SIZE_STEPS
public URIInvoker(Object target)
target - the target objectpublic URIInvoker(Object... targets)
targets - the targets objectspublic void resetJsEngine()
public void resetJsEngine(String engineName)
engineName - the engine namepublic void setTarget(String name, Object target)
name - the taget nametarget - the target objectpublic void setTarget(Object target)
target - the target objectpublic void addTargets(Map<String,Object> targetMap)
targetMap - the targets mappublic void addTargets(Object... targets)
targets - the target objectspublic void addTarget(String targetName, Object targetObject)
targetName - the nametargetObject - the objectpublic org.apache.commons.beanutils.ConvertUtilsBean getConvertUtil()
public ScriptEngine getJsEngine()
public Object runLink(String link) throws ScriptException, IOException
link - the linkIOException - implicitScriptException - implicitpublic Object run(String script) throws ScriptException
script - the scriptScriptException - implicitpublic void appendRunLink(Appendable value, String runLink)
value - the valuerunLink - the run linkpublic void appendRunValue(Appendable value, String runThis)
value - the valuerunThis - the run stringpublic void appendValue(Appendable value, String keys, boolean isProperty)
value - the valuekeys - the keysisProperty - true if propertypublic void appendValue(Appendable value, String targetName, String keys, boolean isProperty)
value - the valuetargetName - the target namekeys - the keysisProperty - true if propertypublic String convert(Object obj) throws IOException
obj - the object to convertIOException - implicitpublic void appendValue(Appendable value, Object obj) throws IOException
value - the valueobj - the objectIOException - implicitpublic Object runThis(String name, String... args) throws Exception
InvokerMXBean.InvokerrunThis in class InvokerMXBean.Invokername - the nameargs - the argumentsException - any problempublic Object invokeNestedMethod(String targetName, String nestedMethod) throws ReflectiveOperationException, ScriptException
targetName - the target namenestedMethod - the nested methodReflectiveOperationException - implicitScriptException - rare casepublic Object invokeNestedMethod(Object targetObj, String nestedMethod) throws ReflectiveOperationException, ScriptException
targetObj - the target objectnestedMethod - the nested methodReflectiveOperationException - implicitScriptException - rare casepublic Method findMethod(Class<?> classz, String methodName, int totalArguments)
classz - the classmethodName - the method nametotalArguments - the total no. of argumentspublic void appendError(Appendable value, Throwable th)
value - the valueth - the throwablepublic String toSize(String targetName, String propertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
targetName - the target namepropertyName - the property nameNoSuchMethodException - implicitInvocationTargetException - implicitIllegalAccessException - implicitpublic long sizeofProperty(String targetName, String propertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
targetName - the target namepropertyName - the property nameNoSuchMethodException - implicitInvocationTargetException - implicitIllegalAccessException - implicitpublic static long sizeof(Object obj) throws IllegalAccessException
obj - the objectIllegalAccessException - implicitpublic static String readableSize(long size)
size - the sizeCopyright © 2017. All rights reserved.