From RTSC-Pedia
[printable version] [offline version] | offline version generated on 11-Jun-2009 18:06 UTC |
XDCscript - Module-Body.module$validate
Validate current domain object model
Synopsis
| function module$validate() |
Description
module$validate() is called for all modules in a package, before the package's validate() function. It can be used to verify the consistency of values assigned to configuration parameters, but no changes to these parameters (or to any objects in the current model) are allowed.
Several methods are available to signal errors:
- this.$logWarning(msg, obj, sel)
prints a message but configuration successfully generates all files and exits with status 0 - this.$logError(msg, obj, sel)
prints message but configuration step fails; files are not generated and exit status is non-zero - this.$logFatal(msg, obj, sel)
logs an error and throws an Error exception terminating any further validation; files are not generated and exit status is non-zero.
The parameters to these functions are
- msg
- a string message to be output
- obj
- an arbitrary object
- sel
- an optional property (i.e., selector) within obj
All errors (warnings) are pushed onto an internal string array of errors (warnings). The error strings are created by evaluating the following JavaScript expression:
'error:::' + this.$name + ':::' + frame + ':::' + (obj + " " + sel) + ':::' + msg
where frame is the stack frame of the function calling module$validate and if sel is undefined it is replaced with "".
Warnings have the same format as errors except that the prefix is "warning:::" rather than "error:::".
See also
xdc.IPackage.validate | Client documentation for xdc.IPackage.validate |
Creating Configurable Content | How to leverage the configuration process |
[printable version] [offline version] | offline version generated on 11-Jun-2009 18:06 UTC |