| Method from org.apache.bsf.debug.meta.JsObjectStub Detail: |
public void define(String propertyName,
Object value,
int attributes) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_DEFINE);
cell.writeObject(propertyName);
cell.writeObject(value);
cell.writeInt(attributes);
cell.waitForCompletion();
} catch (Exception ex) {
throw new RemoteException("Marshalling error", ex);
}
}
The value can be any of the following type:
java.lang.Boolean
java.lang.Number
java.lang.String
org.apache.bsf.debug.jsdi.JsObject |
public void delete(int index) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_DELETE_BY_INDEX);
cell.writeInt(index);
cell.waitForCompletion();
} catch (Exception ex) {
throw new RemoteException("Marshalling error", ex);
}
}
Removes a property from this object.
The prototype chain is not walked to find the
property.
This operation corresponds to the ECMA [[Delete]] except that
the no result is returned. The runtime will guarantee that this
method is called only if the property exists. After this method
is called, the runtime will call Scriptable.has to see if the
property has been removed in order to determine the boolean
result of the delete operator as defined by ECMA 11.4.1.
A property can be made permanent by ignoring calls to remove
it.
The property is specified by an integral index
as defined for get.
To delete properties defined in a prototype chain,
first find the owner object of the property and then
call deleteProperty on that owner object.
Identical to delete(String) except that
an integral index is used to select the property. |
public void delete(String name) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_DELETE_BY_NAME);
cell.writeObject(name);
cell.waitForCompletion();
} catch (Exception ex) {
throw new RemoteException("Marshalling error", ex);
}
}
Removes a property from this object.
This operation corresponds to the ECMA [[Delete]] except that
the no result is returned. The runtime will guarantee that this
method is called only if the property exists. After this method
is called, the runtime will call Scriptable.has to see if the
property has been removed in order to determine the boolean
result of the delete operator as defined by ECMA 11.4.1.
A property can be made permanent by ignoring calls to remove
it.
The property is specified by a String name
as defined for get.
To delete properties defined in a prototype chain,
first find the owner object of the property and then
call deleteProperty on that owner object. |
public Object get(String name) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_BY_NAME);
cell.writeObject(name);
return cell.waitForObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public Object get(int index) throws RemoteException {
ResultCell cell;
try {
cell= m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_BY_INDEX);
cell.writeInt(index);
return cell.waitForObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public String getClassName() throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_CLASSNAME);
return (String) cell.waitForValueObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public Object getDefaultValue(Class hint) throws RemoteException {
ResultCell cell;
try {
cell= m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_DEFAULT_VALUE);
cell.writeObject(hint.getName());
return (JsObject) cell.waitForObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public Object[] getIds(boolean all) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_IDS);
cell.writeBoolean(all);
return (Object[]) cell.waitForValueObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Returns an array of property ids defined on this object.
The prototype chain is not walked.
However, modified properties that were prototype properties
will be seen.
The parameter indicates to enumerate the "DONTENUM" properties
or not.
|
public JsObject getPrototype() throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_PROTOTYPE);
return (JsObject) cell.waitForObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Get the prototype of the object. |
public JsObject getScope() throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_GET_SCOPE);
return (JsObject) cell.waitForObject();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
The scope is for supporting two things.
If the object is a function, the scope is the "execution" scope
of the function. It will be used when calling the function to
initialize the Context scope.
If the object is not a function, the scope is used for the scope
chain of execution context. |
public boolean has(int index) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_HAS_BY_INDEX);
cell.writeInt(index);
return cell.waitForBooleanValue();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public boolean has(String name) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_HAS_BY_NAME);
cell.writeObject(name);
return cell.waitForBooleanValue();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public boolean hasInstance(JsObject instance) throws RemoteException {
ResultCell cell;
JsObjectStub stub = (JsObjectStub) instance;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_HAS_INSTANCE);
cell.writeObject(stub);
return cell.waitForBooleanValue();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
The instanceof operator.
The JavaScript code "lhs instanceof rhs" causes rhs.hasInstance(lhs) to
be called.
The return value is implementation dependent so that embedded host objects can
return an appropriate value. See the JS 1.3 language documentation for more
detail.
This operator corresponds to the proposed EMCA [[HasInstance]] operator. |
public boolean isA(int cmd) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,cmd);
return cell.waitForBooleanValue();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public boolean isFunction() throws RemoteException {
return isA(DebugConstants.JO_FUNCTION);
}
|
public boolean isNotFound() {
return this == Stub.NOT_FOUND;
}
True if this object represents the "NOT_FOUND" value
for a code. This is potentially returned from
get if the property is not found. |
public boolean isScript() throws RemoteException {
return isA(DebugConstants.JO_SCRIPT);
}
|
public boolean isUndefined() {
return this == Stub.UNDEFINED;
}
Value returned when a property is undefined. |
public void put(int index,
Object value) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_PUT_BY_INDEX);
cell.writeInt(index);
cell.writeObject(value);
cell.waitForCompletion();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|
public void put(String name,
Object value) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_PUT_BY_NAME);
cell.writeObject(name);
cell.writeObject(value);
cell.waitForCompletion();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Sets a named property in this object.
The property is specified by a string name
as defined for get.
Note that if a property a is defined in the prototype p
of an object o, then evaluating o.a = 23 will cause
set to be called on the prototype p with
o as the start parameter.
To preserve JavaScript semantics, it is the Scriptable
object's responsibility to modify o.
This design allows properties to be defined in prototypes and implemented
in terms of getters and setters of Java values without consuming slots
in each instance.
The values that may be set are limited to the following:
- java.lang.Boolean objects
- java.lang.String objects
- java.lang.Number objects
- org.apache.bsf.debug.jsdi.JsObject
- null
- The value returned by Context.getUndefinedValue()
IMPORTANT: JAVA OBJECTS.
The wrapping is not yet supported. |
public void setPrototype(JsObject prototype) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_SET_PROTOTYPE);
cell.writeObject(prototype);
cell.waitForCompletion();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Set the prototype of the object. |
public void setScope(JsObject scope) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.JS_OBJECT_TID,DebugConstants.JO_SET_SCOPE);
cell.writeObject(scope);
cell.waitForCompletion();
} catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
} catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Set the prototype of the object. |