Published on WSO2 Oxygen Tank (http://wso2.org)

What are JavaScript Annotations?

By keith
Created 2008-06-17 21:21

The JavaScript language allows users to set properties on any object, including a function (cause a function in JavaScript is an object). The Mashup Server treats some of these predefined properties in a special way. We refer to these special properties as annotations.

Applies To

1. Mashup Server 1.0 or later

 

The Mashup Server processors annotations on both an operation level and a service level. Service level annotations are set using the syntax “this.anotationName = annotationValue;

this.description = “Example of a service level annotaion”;

Operation level annotations are set using the syntax “operationName.annotationName = annotationValue;" 

foo.description = “Example of a operation level annotation”;
function foo () {
// some function
}

The Mashup Server uses these annotations to build service meta-data. Hence service level annotations provide meta-data for the service while the operation level annotations provide meta-data about a particular operation.



Author: Keith Chapmon, Senior Software Engineer, WSO2 Inc. keith at wso2 dot com


Source URL:
http://wso2.org/library/3714