annotation-js
Publication date: February 22, 2017
Module for annotation in Javascript.
Annotation template:
/*@Annotation(DATA[query=""<required>,column=""<opcional>,type=""<opcional>,sufix=""<string for sufix>,dir=""<BIND_IN{default},BIND_OUT,BIND_INOUT>])@type{class,number,integer(remove all outher caracterer),date,boolean,string}@sufix{<string for sufix>}*/
Example usage:
- Add the notations in the classes:
{ /* @Annotation( ANNOTATION_NAME_1[informationName="param_email"], ANNOTATION_NAME_2[informationName="param_email_2"], ) @type{string} */ thisemail = email; /* @Annotation( ANNOTATION_NAME_1[informationName="param_phone"], ANNOTATION_NAME_2[informationName="param_phone_2"], ) @type{string} */ thisphone = phone; /* @Annotation( ANNOTATION_NAME_1[informationName="param_age"], ANNOTATION_NAME_2[informationName="param_age_2"], ) @type{integer} */ thisage = age; } { /* @Annotation( ANNOTATION_NAME_1[informationName="param_id",dir="BIND_INOUT"], ANNOTATION_NAME_2[informationName="param_id_2"], ) @type{number} */ thisid = id; /* @Annotation( ANNOTATION_NAME_1[informationName="param_description"], ANNOTATION_NAME_2[informationName="param_description_2"], ) @type{string} */ thisdescription = description; /* @Annotation( ANNOTATION_NAME_1[informationName="param_cpf",dir="BIND_INOUT"], ANNOTATION_NAME_2[informationName="param_cpf_2"], ) @type{integer} */ thiscpf = cpf; //If "123.456.789.12" is seted, all characters other than numbers will be removed, resulting "12345678912" } { /* @Annotation( ANNOTATION_NAME_1[informationName="param_name"], ANNOTATION_NAME_2[informationName="param_name_2"], ) @type{string} */ thisname = 'João'; /* @Annotation( ANNOTATION_NAME_1[informationName="param_is_dev"], ANNOTATION_NAME_2[informationName="param_is_dev_2"], ) @type{boolean} */ thisisDeveloper = true; /* @Annotation( ANNOTATION_NAME_1[informationName="param_date_created"], ANNOTATION_NAME_2[informationName="param_date_created_2"], ) @type{date} */ thisdateCreated = '2017-03-23'; /* @Annotation() @type{class} */ thiscontact = 'joaojunior.mail@gmail.com' '99 9999-9999' 29; /* @Annotation() @type{class} @sufix{_1} */ thisdata1 = 10 'Teste1'; /* @Annotation() @type{class} @sufix{_2} */ thisdata2 = 20 'Teste2'; }
- Method for reading notation (generic):
User;
Example:
var annotation = User;
- Method for reading notation (popular data in object through an array):
global;
Exemplo:
var user = ;global;
- Method for reading notation for bindVars of the module npm oracledb
:
global;
Example:
var bindVars = null;var stringToEval = global;;bindVars = Object;
- Generic SQL Generation Method (INSERT, UPDATE):
global;
Example:
var sql = global;console;
- Debug Mode:
globalannotationsDebug = true; //Default: true