* Refactor constructors a lil bit, make className final, clean up import statements.
This commit is contained in:
parent
fd598f23cf
commit
ff20cddcda
1 changed files with 8 additions and 7 deletions
|
@ -17,7 +17,6 @@
|
||||||
package helma.scripting.rhino;
|
package helma.scripting.rhino;
|
||||||
|
|
||||||
import helma.framework.core.*;
|
import helma.framework.core.*;
|
||||||
import helma.framework.ResponseTrans;
|
|
||||||
import helma.framework.repository.Resource;
|
import helma.framework.repository.Resource;
|
||||||
import helma.objectmodel.*;
|
import helma.objectmodel.*;
|
||||||
import helma.objectmodel.db.*;
|
import helma.objectmodel.db.*;
|
||||||
|
@ -33,7 +32,7 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
public class HopObject extends ScriptableObject implements Wrapper, PropertyRecorder {
|
public class HopObject extends ScriptableObject implements Wrapper, PropertyRecorder {
|
||||||
|
|
||||||
String className;
|
final String className;
|
||||||
INode node;
|
INode node;
|
||||||
RhinoCore core;
|
RhinoCore core;
|
||||||
|
|
||||||
|
@ -48,9 +47,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
* @param core the RhinoCore
|
* @param core the RhinoCore
|
||||||
*/
|
*/
|
||||||
protected HopObject(String className, RhinoCore core) {
|
protected HopObject(String className, RhinoCore core) {
|
||||||
this.className = className;
|
this(className, core, null, null);
|
||||||
this.core = core;
|
|
||||||
setParentScope(core.global);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,12 +55,16 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
* Creates a new HopObject.
|
* Creates a new HopObject.
|
||||||
*
|
*
|
||||||
* @param className the className
|
* @param className the className
|
||||||
|
* @param core the RhinoCore
|
||||||
|
* @param node the wrapped node
|
||||||
* @param proto the object's prototype
|
* @param proto the object's prototype
|
||||||
*/
|
*/
|
||||||
protected HopObject(String className, RhinoCore core,
|
protected HopObject(String className, RhinoCore core,
|
||||||
INode node, Scriptable proto) {
|
INode node, Scriptable proto) {
|
||||||
this(className, core);
|
this.className = className;
|
||||||
|
this.core = core;
|
||||||
this.node = node;
|
this.node = node;
|
||||||
|
if (proto != null)
|
||||||
setPrototype(proto);
|
setPrototype(proto);
|
||||||
setParentScope(core.global);
|
setParentScope(core.global);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue