|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
helma.scripting.rhino.HopObject
public class HopObject
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
protected |
HopObject(java.lang.String className,
RhinoCore core)
Creates a new HopObject prototype. |
protected |
HopObject(java.lang.String className,
RhinoCore core,
INode node,
org.mozilla.javascript.Scriptable proto)
Creates a new HopObject. |
protected |
HopObject(java.lang.String className,
RhinoCore core,
NodeHandle handle,
org.mozilla.javascript.Scriptable proto)
Creates a new HopObject. |
Method Summary | |
---|---|
void |
clearChangeSet()
Clear the set of changed properties. |
void |
defineProperty(java.lang.String propertyName,
java.lang.Object value,
int attributes)
Overwritten to not define constructor property as constant - we need to have the constructor property resettable in Helma. |
void |
delete(java.lang.String name)
|
protected java.lang.Object |
equivalentValues(java.lang.Object value)
Custom == operator. |
java.lang.Object |
get(int idx,
org.mozilla.javascript.Scriptable start)
|
java.lang.Object |
get(java.lang.String name,
org.mozilla.javascript.Scriptable start)
|
java.lang.Object[] |
getAllIds()
Return all property names of this object. |
java.util.Set |
getChangeSet()
Returns a set containing the names of properties changed since the last time startRecording() was called. |
java.lang.String |
getClassName()
Get the class/prototype name for this HopObject |
java.lang.Object |
getDefaultValue(java.lang.Class hint)
Return a primitive representation for this object. |
java.lang.Object[] |
getIds()
Return all "ordinary" property ids of this object. |
INode |
getNode()
Return the INode wrapped by this HopObject. |
boolean |
has(int idx,
org.mozilla.javascript.Scriptable start)
|
boolean |
has(java.lang.String name,
org.mozilla.javascript.Scriptable start)
Check if a property is set in this HopObject |
static HopObject |
init(RhinoCore core)
Initialize HopObject prototype for Rhino scope. |
boolean |
jsFunction_add(java.lang.Object child)
|
boolean |
jsFunction_addAt(int index,
java.lang.Object child)
|
void |
jsFunction_clearCache()
Clear the node's cache node. |
int |
jsFunction_contains(java.lang.Object obj)
Deprecated. use indexOf(Object) instead. |
int |
jsFunction_count()
|
java.lang.Object |
jsFunction_get(java.lang.Object id)
Get a childObject by name/id or index |
java.lang.Object |
jsFunction_getById(java.lang.Object id)
Get a child object by ID |
java.lang.Object |
jsFunction_getResource(java.lang.String resourceName)
Returns a prototype's resource of a given name. |
java.lang.Object |
jsFunction_getResources(java.lang.String resourceName)
Returns an array containing the prototype's resource with a given name. |
java.lang.Object |
jsFunction_href(java.lang.Object action,
java.lang.Object params)
Get the URL for this object with the application |
int |
jsFunction_indexOf(java.lang.Object obj)
Check if node is contained in the subnode collection. |
boolean |
jsFunction_invalidate(java.lang.Object childId)
Invalidate the node itself or a subnode |
boolean |
jsFunction_isPersistent()
Check whether the wrapped Node is persistent. |
boolean |
jsFunction_isTransient()
Check whether the wrapped Node is transient. |
org.mozilla.javascript.Scriptable |
jsFunction_list(java.lang.Object startArg,
java.lang.Object lengthArg)
Return a JS array of child objects with the given start and length. |
java.lang.Object |
jsFunction_persist()
Makes the HopObject and all its reachable descendants persistent. |
void |
jsFunction_prefetchChildren(java.lang.Object startArg,
java.lang.Object lengthArg)
Prefetch child objects from (relational) database. |
boolean |
jsFunction_remove(java.lang.Object arg)
Remove this object from the database. |
boolean |
jsFunction_removeChild(java.lang.Object child)
Remove a child node from this node's collection without deleting it from the database. |
boolean |
jsFunction_renderSkin(java.lang.Object skinobj,
java.lang.Object paramobj)
Render a skin to the response buffer. |
java.lang.String |
jsFunction_renderSkinAsString(java.lang.Object skinobj,
java.lang.Object paramobj)
Render a skin and return its output as string. |
boolean |
jsFunction_set(java.lang.Object id,
java.lang.Object value)
Set a property on this HopObject |
int |
jsFunction_size()
|
java.lang.Object |
jsGet_cache()
|
void |
put(java.lang.String name,
org.mozilla.javascript.Scriptable start,
java.lang.Object value)
Set a property in this HopObject |
void |
startRecording()
Tell this PropertyRecorder to start recording changes to properties |
void |
stopRecording()
Tell this PropertyRecorder to stop recording changes to properties |
java.lang.String |
toString()
Return a string representation of this HopObject. |
java.lang.Object |
unwrap()
Returns the wrapped Node. |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected HopObject(java.lang.String className, RhinoCore core)
className
- the prototype namecore
- the RhinoCoreprotected HopObject(java.lang.String className, RhinoCore core, INode node, org.mozilla.javascript.Scriptable proto)
className
- the classNamecore
- the RhinoCorenode
- the wrapped nodeproto
- the object's prototypeprotected HopObject(java.lang.String className, RhinoCore core, NodeHandle handle, org.mozilla.javascript.Scriptable proto)
className
- the classNamecore
- the RhinoCorehandle
- the handle for the wrapped nodeproto
- the object's prototypeMethod Detail |
---|
public static HopObject init(RhinoCore core)
core
- the RhinoCore
public java.lang.String getClassName()
getClassName
in interface org.mozilla.javascript.Scriptable
getClassName
in class org.mozilla.javascript.ScriptableObject
public void defineProperty(java.lang.String propertyName, java.lang.Object value, int attributes)
defineProperty
in class org.mozilla.javascript.ScriptableObject
propertyName
- the property namevalue
- the property valueattributes
- the property attributespublic java.lang.Object getDefaultValue(java.lang.Class hint)
getDefaultValue
in interface org.mozilla.javascript.Scriptable
getDefaultValue
in class org.mozilla.javascript.ScriptableObject
hint
- the type hint
public INode getNode()
public java.lang.Object unwrap()
unwrap
in interface org.mozilla.javascript.Wrapper
public java.lang.Object jsGet_cache()
public boolean jsFunction_renderSkin(java.lang.Object skinobj, java.lang.Object paramobj) throws java.io.UnsupportedEncodingException, java.io.IOException
skinobj
- The skin object or nameparamobj
- An optional parameter object
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.Object jsFunction_getResource(java.lang.String resourceName)
resourceName
- the name of the resource, e.g. "type.properties",
"messages.properties", "script.js", etc.
public java.lang.Object jsFunction_getResources(java.lang.String resourceName)
resourceName
- the name of the resource, e.g. "type.properties",
"messages.properties", "script.js", etc.
public java.lang.String jsFunction_renderSkinAsString(java.lang.Object skinobj, java.lang.Object paramobj) throws java.io.UnsupportedEncodingException, java.io.IOException
skinobj
- The skin object or nameparamobj
- An optional parameter object
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.Object jsFunction_href(java.lang.Object action, java.lang.Object params) throws java.io.UnsupportedEncodingException, java.io.IOException
action
- optional action nameparams
- optional query parameters
java.io.UnsupportedEncodingException
- if the application's charset property
is not a valid encoding name
java.io.IOException
public java.lang.Object jsFunction_get(java.lang.Object id)
id
- The name/id or index, depending if the argument is a String or Number.
public java.lang.Object jsFunction_getById(java.lang.Object id)
id
- the child id.
public boolean jsFunction_set(java.lang.Object id, java.lang.Object value)
id
- The name/id or index, depending if the argument is a String or Number.
public int jsFunction_count()
public int jsFunction_size()
public void jsFunction_prefetchChildren(java.lang.Object startArg, java.lang.Object lengthArg)
public void jsFunction_clearCache()
public org.mozilla.javascript.Scriptable jsFunction_list(java.lang.Object startArg, java.lang.Object lengthArg)
public boolean jsFunction_add(java.lang.Object child)
child
- ...
public boolean jsFunction_addAt(int index, java.lang.Object child)
index
- ...child
- ...
public boolean jsFunction_remove(java.lang.Object arg)
public boolean jsFunction_removeChild(java.lang.Object child)
public java.lang.Object jsFunction_persist()
public boolean jsFunction_invalidate(java.lang.Object childId)
public boolean jsFunction_isPersistent()
public boolean jsFunction_isTransient()
public int jsFunction_indexOf(java.lang.Object obj)
public int jsFunction_contains(java.lang.Object obj)
public void put(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)
put
in interface org.mozilla.javascript.Scriptable
put
in class org.mozilla.javascript.ScriptableObject
name
- property namestart
- value
- ...public boolean has(java.lang.String name, org.mozilla.javascript.Scriptable start)
has
in interface org.mozilla.javascript.Scriptable
has
in class org.mozilla.javascript.ScriptableObject
name
- the property namestart
- the object in which the lookup began
public void delete(java.lang.String name)
delete
in interface org.mozilla.javascript.Scriptable
delete
in class org.mozilla.javascript.ScriptableObject
name
- ...public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
name
- ...start
- ...
public java.lang.Object[] getAllIds()
getAllIds
in interface org.mozilla.javascript.debug.DebuggableObject
getAllIds
in class org.mozilla.javascript.ScriptableObject
public java.lang.Object[] getIds()
getIds
in interface org.mozilla.javascript.Scriptable
getIds
in class org.mozilla.javascript.ScriptableObject
public boolean has(int idx, org.mozilla.javascript.Scriptable start)
has
in interface org.mozilla.javascript.Scriptable
has
in class org.mozilla.javascript.ScriptableObject
idx
- ...start
- ...
public java.lang.Object get(int idx, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
idx
- ...start
- ...
protected java.lang.Object equivalentValues(java.lang.Object value)
Scriptable.NOT_FOUND
if this object does not
have custom equality operator for the given value,
Boolean.TRUE if this object is equivalent to value,
Boolean.FALSE if this object is not equivalent to
value.
equivalentValues
in class org.mozilla.javascript.ScriptableObject
public java.lang.String toString()
toString
in class java.lang.Object
public void startRecording()
startRecording
in interface PropertyRecorder
public void stopRecording()
stopRecording
in interface PropertyRecorder
public java.util.Set getChangeSet()
getChangeSet
in interface PropertyRecorder
public void clearChangeSet()
clearChangeSet
in interface PropertyRecorder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |