Added helma.util.SystemMap class as a HashMap that is used

internally by Helma and is wrapped as a native JavaScript object.
This commit is contained in:
hns 2003-06-16 18:53:33 +00:00
parent 8aa7c6bf33
commit 44a1235803
6 changed files with 63 additions and 10 deletions

View file

@ -18,6 +18,7 @@ package helma.framework;
import helma.objectmodel.*;
import helma.util.Base64;
import helma.util.SystemMap;
import java.io.*;
import java.util.*;
@ -59,7 +60,7 @@ public class RequestTrans implements Externalizable {
*/
public RequestTrans() {
httpMethod = 0;
values = new HashMap();
values = new SystemMap();
}
/**
@ -67,7 +68,7 @@ public class RequestTrans implements Externalizable {
*/
public RequestTrans(byte method) {
httpMethod = method;
values = new HashMap();
values = new SystemMap();
}
/**

View file

@ -123,8 +123,8 @@ public final class ResponseTrans implements Externalizable {
public ResponseTrans() {
super();
message = error = null;
values = new HashMap();
handlers = new HashMap();
values = new SystemMap();
handlers = new SystemMap();
}
/**

View file

@ -18,6 +18,7 @@ package helma.framework.core;
import helma.objectmodel.INode;
import helma.util.CronJob;
import helma.util.SystemMap;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
@ -386,7 +387,7 @@ public class ApplicationBean implements Serializable {
* @return ...
*/
public Map getproperties() {
return app.getProperties();
return new SystemMap(app.getProperties());
}
/**
@ -432,7 +433,7 @@ public class ApplicationBean implements Serializable {
* @return ...
*/
public Map getSkinfiles() {
Map skinz = new HashMap();
Map skinz = new SystemMap();
for (Iterator it = app.getPrototypes().iterator(); it.hasNext();) {
Prototype p = (Prototype) it.next();
@ -451,7 +452,7 @@ public class ApplicationBean implements Serializable {
* @return ...
*/
public Map getSkinfilesInPath(Object[] skinpath) {
Map skinz = new HashMap();
Map skinz = new SystemMap();
for (Iterator it = app.getPrototypes().iterator(); it.hasNext();) {
Prototype p = (Prototype) it.next();

View file

@ -21,6 +21,7 @@ import helma.objectmodel.*;
import helma.objectmodel.db.DbMapping;
import helma.scripting.*;
import helma.util.Updatable;
import helma.util.SystemMap;
import java.io.*;
import java.util.*;
@ -447,7 +448,7 @@ public final class Prototype {
}
// a map that dynamically expands to all skins in this prototype
final class SkinMap extends HashMap {
final class SkinMap extends SystemMap {
long lastSkinmapLoad = 0;
Object[] skinpath;

View file

@ -21,6 +21,7 @@ import helma.objectmodel.ConcurrencyException;
import helma.objectmodel.INode;
import helma.scripting.*;
import helma.util.HtmlEncoder;
import helma.util.SystemMap;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
@ -485,8 +486,8 @@ public final class Skin {
// if (parameters == null)
// parameters = new HashMap ();
Object[] arguments = {
(parameters == null) ? new HashMap()
: new HashMap(parameters)
(parameters == null) ? new SystemMap()
: new SystemMap(parameters)
};
Object value = reval.scriptingEngine.invoke(handlerObject,

View file

@ -0,0 +1,49 @@
/*
* Helma License Notice
*
* The contents of this file are subject to the Helma License
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://adele.helma.org/download/helma/license.txt
*
* Copyright 1998-2003 Helma Software. All Rights Reserved.
*
* $RCSfile$
* $Author$
* $Revision$
* $Date$
*/
package helma.util;
import java.util.*;
/**
* Map class used internally by Helma.
*/
public class SystemMap extends HashMap {
/**
* Construct an empty SystemMap.
*/
public SystemMap() {
super();
}
/**
* Construct an empty SystemMap with the given initial capacity.
*/
public SystemMap(int initialCapacity) {
super(initialCapacity);
}
/**
* Construct a SystemMap with the contents of Map map.
*/
public SystemMap(Map map) {
super(map);
}
}