IAnnotatable
pentaho.lang.IAnnotatable
The IAnnotatable
interface represents the class of objects whose instances can be freely augmented with annotations.
An annotation has a name and a value, of (almost) any kind. The undefined
value denotes a missing annotation, so it cannot be usefully be the value of an annotation.
The pentaho.lang.IAnnotatable#property
method allows getting or setting annotations on an annotated object.
By convention, the specification of an annotatable object uses a property named p
to contain a plain object, a dictionary of annotations' names and values (see pentaho.lang.spec.IAnnotatable
).
Source: doc-js/pentaho/lang/IAnnotatable.jsdoc, line 17
See also: pentaho.lang.ISpecifiable , pentaho.lang.spec.IAnnotatable
Example
// Obtain an annotatable object var foo = ... // Read foo's "bar" annotation var bar = foo.property("bar"); // And create it, if it ain't there if(bar === undefined) { bar = "I have a 'bar' annotation!"; foo.property("bar", bar); } console.log(bar);
Methods
Name | Description |
---|---|
property(name) : * | Gets an annotation of the object. |
property(name, value) : pentaho.lang.ISpecifiable | Sets an annotation on this object. |
Methods Details
property(name) : * | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets an annotation of the object. If an annotation with the specified name does not exist, Source: doc-js/pentaho/lang/IAnnotatable.jsdoc, line 55
|
property(name, value) : pentaho.lang.ISpecifiable | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets an annotation on this object. Source: doc-js/pentaho/lang/IAnnotatable.jsdoc, line 66
|