From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 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

XDCscript - Module-Object.$logError Log an error from this module
XDCscript - Module-Object.$logFatal Throw fatal exception from this module
XDCscript - Module-Object.$logWarning Log a warning from this module
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 04-Aug-2010 21:08 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved


Views
Personal tools
package reference