You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
-Shortcut serialisation process if objects already exist in serializer and flag is passed
-Add new Decorator to model file for transactions to pass flag to serializer
-Remove unrequired validation steps
-Update tests to account for changes
-Update API text and digest
Signed-off-by: nkl199@yahoo.co.uk <nkl199@yahoo.co.uk>
* Specialised decorator implementation for the @readonly decorator.
22
+
*/
23
+
classReadOnlyDecoratorextendsDecorator{
24
+
25
+
/**
26
+
* Create a Decorator.
27
+
* @param {ClassDeclaration | Property} parent - the owner of this property
28
+
* @param {Object} ast - The AST created by the parser
29
+
* @throws {IllegalModelException}
30
+
*/
31
+
constructor(parent,ast){
32
+
super(parent,ast);
33
+
}
34
+
35
+
/**
36
+
* Process the AST and build the model
37
+
* @throws {IllegalModelException}
38
+
* @private
39
+
*/
40
+
process(){
41
+
super.process();
42
+
constargs=this.getArguments();
43
+
if(args.length!==1){
44
+
thrownewIllegalModelException(`@readonly decorator expects 1 argument, but ${args.length} arguments were specified.`,this.parent.getModelFile(),this.ast.location);
45
+
}
46
+
constarg=args[0];
47
+
if(typeofarg!=='boolean'){
48
+
thrownewIllegalModelException(`@readonly decorator expects a boolean argument, but an argument of type ${typeofarg} was specified.`,this.parent.getModelFile(),this.ast.location);
49
+
}
50
+
this.value=arg;
51
+
}
52
+
53
+
/**
54
+
* Get the value of this commit decorator.
55
+
* @return {boolean} The value of this commit decorator.
0 commit comments