Velocity Introspector that supports Rhino JavaScript objects
as well as Java Objects
| Method from org.apache.cocoon.generation.VelocityGenerator$JSIntrospector Detail: |
public Iterator getIterator(Object obj,
Info i) throws Exception {
if (!(obj instanceof Scriptable)) {
return super.getIterator(obj, i);
}
if (obj instanceof NativeArray) {
return new NativeArrayIterator((NativeArray)obj);
}
return new ScriptableIterator((Scriptable)obj);
}
|
public VelMethod getMethod(Object obj,
String methodName,
Object[] args,
Info i) throws Exception {
if (!(obj instanceof Scriptable)) {
return super.getMethod(obj, methodName, args, i);
}
return new JSMethod((Scriptable)obj, methodName);
}
|
public VelPropertyGet getPropertyGet(Object obj,
String identifier,
Info i) throws Exception {
if (!(obj instanceof Scriptable)) {
return super.getPropertyGet(obj, identifier, i);
}
return new JSPropertyGet((Scriptable)obj, identifier);
}
|
public VelPropertySet getPropertySet(Object obj,
String identifier,
Object arg,
Info i) throws Exception {
if (!(obj instanceof Scriptable)) {
return super.getPropertySet(obj, identifier, arg, i);
}
return new JSPropertySet((Scriptable)obj, identifier);
}
|