Added support for constructor and methods of constructor (static methods).

This commit is contained in:
Michael Mathews 2010-08-10 13:00:11 +01:00
parent 46d5dc17b7
commit 36b2684b9a
2 changed files with 29 additions and 3 deletions

View File

@ -18,6 +18,11 @@
addDocNode(thisNamespace, from, element.path, element.name);
}
else if (element.kind === 'method') {
//var _to = to;
if (element.scope === 'static') {
to = to.constructor;
}
if (! to.functions) {
to.functions = {};
}
@ -38,6 +43,8 @@
"nullable": typeof element.param[i].nullable === 'boolean'? element.param[i].nullable : ""
});
}
//to = _to;
}
else if (element.kind === 'property') {
if (! to.properties) {
@ -49,14 +56,32 @@
"type": element.type? (element.type.length === 1? element.type[0] : element.type) : ""
};
}
else if (element.kind === 'constructor') {
else if (element.kind === 'constructor') {
if (! to.classes) {
to.classes = {};
}
var thisClass = to.classes[element.name] = {
"name" : element.name,
"description" : element.desc || ""
"description" : element.classdesc || "",
"access": element.access || "",
"constructor": {
"name" : element.name,
"description" : element.desc || "",
"parameters": [
]
}
};
if (element.param) for (var i = 0, len = element.param.length; i < len; i++) {
thisClass.constructor.parameters.push({
"name": element.param[i].name,
"type": element.param[i].type? (element.param[i].type.length === 1? element.param[i].type[0] : element.param[i].type) : "",
"description": element.param[i].description || "",
"default": element.param[i].defaultvalue || "",
"optional": typeof element.param[i].optional === 'boolean'? element.param[i].optional : "",
"nullable": typeof element.param[i].nullable === 'boolean'? element.param[i].nullable : ""
});
}
addDocNode(thisClass, from, element.path, element.name);
}
});

View File

@ -45,11 +45,12 @@ geometry.util.ShapeFactory.prototype = {
* @class This is the basic Shape class.
* It can be considered an abstract class, even though no such thing
* really existing in JavaScript
* @param {Object} template
* @throws {MemoryException} If there is no more memory
* @throws GeneralShapeException rarely (if ever)
* @return {geometry.Shape|geometry.Coordinate} A new shape.
*/
geometry.Shape = function(){
geometry.Shape = function(template){
/**
* This is an example of a function that is not given as a property