minor tweaking for docs generation

This commit is contained in:
zumbrunn 2007-07-01 15:50:28 +00:00
parent 701a2671e9
commit 460ace26be
2 changed files with 25 additions and 8 deletions

View file

@ -10,8 +10,8 @@
* *
* $RCSfile: JSON.js,v $ * $RCSfile: JSON.js,v $
* $Author: tobi $ * $Author: tobi $
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Date: 2006/07/24 17:09:23 $ * $Date: 2006/07/24 17:18:52 $
*/ */
@ -124,10 +124,18 @@
} }
}; };
/**
* This method produces a JSON text from an object.
* The object must not contain any cyclical references.
*/
Object.prototype.toJSON = function () { Object.prototype.toJSON = function () {
return s.object(this); return s.object(this);
}; };
/**
* This method produces a JSON text from an array.
* The array must not contain any cyclical references.
*/
Array.prototype.toJSON = function () { Array.prototype.toJSON = function () {
return s.array(this); return s.array(this);
}; };
@ -138,6 +146,10 @@
})(); })();
/**
* This method parses a JSON text to produce an object or
* array. It will return false if there is an error.
*/
String.prototype.parseJSON = function () { String.prototype.parseJSON = function () {
try { try {
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + this + ')'); return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + this + ')');

View file

@ -10,8 +10,8 @@
* *
* $RCSfile: Group.js,v $ * $RCSfile: Group.js,v $
* $Author: tobi $ * $Author: tobi $
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Date: 2007/04/05 15:33:58 $ * $Date: 2007/04/05 15:53:09 $
*/ */
/** /**
@ -26,9 +26,10 @@ if (!global.helma) {
/** /**
* Constructs a new helma.Group Object. * Constructs a new helma.Group Object.
* This is what is retrieved through groups.get(groupName), * @class This is what is retrieved through groups.get(groupName),
* wrapping the root object of each group tree. * wrapping the root object of each group tree.
* @param {FIXME} javaGroup FIXME * @param {FIXME} javaGroup FIXME
* @constructor
*/ */
helma.Group = function(javaGroup) { helma.Group = function(javaGroup) {
// private variable containing the wrapper object // private variable containing the wrapper object
@ -130,9 +131,11 @@ helma.Group = function(javaGroup) {
}; };
/** /**
* Constructs a new helma.Group.GroupObject. This class wraps the java GroupObject * Constructs a new helma.Group.GroupObject.
* @class This class wraps the java GroupObject
* and provides several methods for retrieving and manipulating properties. * and provides several methods for retrieving and manipulating properties.
* @param {Object} Instance of helma.extensions.helmagroups.GroupObject * @param {Object} Instance of helma.extensions.helmagroups.GroupObject
* @constructor
*/ */
helma.Group.GroupObject = function(javaGroupObject) { helma.Group.GroupObject = function(javaGroupObject) {
var helmagroups = Packages.helma.extensions.helmagroups; var helmagroups = Packages.helma.extensions.helmagroups;
@ -571,7 +574,9 @@ helma.Group.GroupObject.GET_NONE = 6;
helma.Group.GroupObject.DEFAULT_GET = helma.Group.GroupObject.GET_ALL; helma.Group.GroupObject.DEFAULT_GET = helma.Group.GroupObject.GET_ALL;
/** /**
* this is mounted as "groups". the root for all groups started in this application * This is mounted as "groups".
* @class The root for all groups started in this application
* @constructor
*/ */
helma.Group.Manager = function() { helma.Group.Manager = function() {
var helmagroups = Packages.helma.extensions.helmagroups; var helmagroups = Packages.helma.extensions.helmagroups;