Package helma.scripting.rhino
Class JavaObject
- java.lang.Object
-
- org.mozilla.javascript.NativeJavaObject
-
- helma.scripting.rhino.JavaObject
-
- All Implemented Interfaces:
java.io.Serializable
,org.mozilla.javascript.Scriptable
,org.mozilla.javascript.SymbolScriptable
,org.mozilla.javascript.Wrapper
public class JavaObject extends org.mozilla.javascript.NativeJavaObject
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaObject(org.mozilla.javascript.Scriptable scope, java.lang.Object obj, java.lang.String protoName, org.mozilla.javascript.Scriptable prototype, RhinoCore core)
Creates a new JavaObject wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(java.lang.String name, org.mozilla.javascript.Scriptable start)
Get a named property from this object.java.lang.Object
getResource(java.lang.String resourceName)
Returns a prototype's resource of a given name.java.lang.Object
getResources(java.lang.String resourceName)
Returns an array containing the prototype's resource with a given name.boolean
has(java.lang.String name, org.mozilla.javascript.Scriptable start)
Checks whether the given property is defined in this object.java.lang.Object
href(java.lang.Object action, java.lang.Object params)
Get the URL for this object with the applicationboolean
renderSkin(java.lang.Object skinobj, java.lang.Object paramobj)
java.lang.String
renderSkinAsString(java.lang.Object skinobj, java.lang.Object paramobj)
-
Methods inherited from class org.mozilla.javascript.NativeJavaObject
canConvert, coerceType, createInterfaceAdapter, delete, delete, delete, get, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, initMembers, put, put, put, setParentScope, setPrototype, unwrap, wrap
-
-
-
-
Constructor Detail
-
JavaObject
public JavaObject(org.mozilla.javascript.Scriptable scope, java.lang.Object obj, java.lang.String protoName, org.mozilla.javascript.Scriptable prototype, RhinoCore core)
Creates a new JavaObject wrapper.
-
-
Method Detail
-
renderSkin
public boolean renderSkin(java.lang.Object skinobj, java.lang.Object paramobj) throws java.io.UnsupportedEncodingException, java.io.IOException
- Parameters:
skinobj
- ...paramobj
- ...- Returns:
- ...
- Throws:
java.io.UnsupportedEncodingException
java.io.IOException
-
renderSkinAsString
public java.lang.String renderSkinAsString(java.lang.Object skinobj, java.lang.Object paramobj) throws java.io.UnsupportedEncodingException, java.io.IOException
- Parameters:
skinobj
- ...paramobj
- ...- Returns:
- ...
- Throws:
java.io.UnsupportedEncodingException
java.io.IOException
-
href
public java.lang.Object href(java.lang.Object action, java.lang.Object params) throws java.io.UnsupportedEncodingException, java.io.IOException
Get the URL for this object with the application- Parameters:
action
- optional action nameparams
- optional query parameters- Returns:
- the URL for the object
- Throws:
java.io.UnsupportedEncodingException
- if the application's charset property is not a valid encoding namejava.io.IOException
-
has
public boolean has(java.lang.String name, org.mozilla.javascript.Scriptable start)
Checks whether the given property is defined in this object.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classorg.mozilla.javascript.NativeJavaObject
-
get
public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
Get a named property from this object.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.NativeJavaObject
-
getResource
public java.lang.Object getResource(java.lang.String resourceName)
Returns a prototype's resource of a given name. Walks up the prototype's inheritance chain if the resource is not found- Parameters:
resourceName
- the name of the resource, e.g. "type.properties", "messages.properties", "script.js", etc.- Returns:
- the resource, if found, null otherwise
-
getResources
public java.lang.Object getResources(java.lang.String resourceName)
Returns an array containing the prototype's resource with a given name.- Parameters:
resourceName
- the name of the resource, e.g. "type.properties", "messages.properties", "script.js", etc.- Returns:
- an array of resources with the given name
-
-