// ----------------------------------------------------------------
// Autogenerated by fieldmapper.pl
+// Requires JSON.js
// ----------------------------------------------------------------
+function FieldmapperException(message) {
+ this.message = message;
+}
+FieldmapperException.toString = function() {
+ return "FieldmapperException: " + this.message + "\\n";
+}
+
+
JS
for my $object (keys %$map) {
JS
print <<JS;
+
function $short_name(array) {
- if(array) { this.array = array; }
- else { this.array = []; }
+
+ this.classname = "$short_name";
+ this._isfieldmapper = true;
+
+ if(array) {
+ if( array.constructor == Array)
+ this.array = array;
+
+ else
+ throw new FieldmapperException(
+ "Attempt to build fieldmapper object with non-array");
+
+ } else { this.array = []; }
+
}
-$short_name.classname = "$short_name";
+$short_name._isfieldmapper = true;
+
JS