ViewBuilder constructor
@param {Object}             meta     Meta infos like: { name: 'name', version: 1, payload: 'some.path' }
@param {Function || String} denormFn Function handle
`function(evtData, vm){}`
@constructor
332562
function ViewBuilder (meta, denormFn) {
  Definition.call(this, meta);

  // used for replay...
  this.workerId = uuid().toString();

  meta = meta || {};

  if (!denormFn || (!_.isFunction(denormFn) && !_.isString(denormFn))) {
    var err = new Error('denormalizer function not injected!');
    debug(err);
    throw err;
  }

  if (_.isString(denormFn) && denormFn !== 'update' && denormFn !== 'create' && denormFn !== 'delete') {
    var err = new Error('denormalizer function "' + denormFn + '" not available! Use "create", "update" or "delete"!');
    debug(err);
    throw err;
  }

  this.version = meta.version || 0;
  this.payload = meta.payload === '' ? meta.payload : (meta.payload || null);
  this.aggregate = meta.aggregate || null;
  this.context = meta.context || null;
  this.id = meta.id || null;
  this.query = meta.query || null;
  this.autoCreate = meta.autoCreate === undefined || meta.autoCreate === null ? true : meta.autoCreate;
  this.priority = meta.priority || Infinity;

  if (_.isString(denormFn)) {
    if (denormFn === 'delete') {
      denormFn = function (evtData, vm) {
        vm.destroy();
      };
    } else {
      denormFn = function (evtData, vm) {
        vm.set(evtData);
      };
    }
  }

  this.denormFn = denormFn;

  if (denormFn.length === 2) {
    this.denormFn = function (evtData, vm, clb) {
      denormFn.call(this, evtData, vm);
      if (this.retryCalled) {
        return;
      }
      clb(null);
    };
  }

  var unwrappedDenormFn = this.denormFn;

  this.denormFn = function (evtData, vm, clb) {
    var wrappedCallback = function () {
      try {
        clb.apply(this, _.toArray(arguments));
      } catch (e) {
        debug(e);
        process.emit('uncaughtException', e);
      }
    };

    try {
      unwrappedDenormFn.call(this, evtData, vm, wrappedCallback.bind(this));
    } catch (e) {
      debug(e);
      process.emit('uncaughtException', e);
    }
  };

  this.idGenerator(function () {
    return uuid().toString();
  });

  this.defineShouldHandle(truthyShouldHandle);

  this.defineShouldHandleEvent(truthyShouldHandleEvent);  

  this.onAfterCommit(function (evt, vm) {});
}
111818
function Event (meta, evtFn) {
  Definition.call(this, meta);

  meta = meta || {};

  if (evtFn && !_.isFunction(evtFn)) {
    var err = new Error('Event function not injected!');
    debug(err);
    throw err;
  }

  this.version = meta.version || 0;
  this.payload = meta.payload === '' ? meta.payload : (meta.payload || null);

  this.evtFn = evtFn;
}
131084
function processMeta (markdownContent) {
  let meta = {};
  let metaArr;
  let metaString;
  let metas;

  let yamlObject;

  switch (true) {
    case _metaRegex.test(markdownContent):
      metaArr = markdownContent.match(_metaRegex);
      metaString = metaArr ? metaArr[1].trim() : '';

      if (metaString) {
        metas = metaString.match(/(.*): (.*)/ig);
        metas.forEach(item => {
          const parts = item.split(': ');
          if (parts[0] && parts[1]) {
            meta[cleanString(parts[0], true)] = parts[1].trim();
          }
        });
      }
      break;

    case _metaRegexYaml.test(markdownContent):
      metaArr = markdownContent.match(_metaRegexYaml);
      metaString = metaArr ? metaArr[1].trim() : '';
      yamlObject = yaml.safeLoad(metaString);
      meta = cleanObjectStrings(yamlObject);
      break;

    default:
    // No meta information
  }

  return meta;
}
925200
function (evt, callback) {
    var self = this;

    function denorm() {
      if (self.executeDenormFnForEach) {
        return self.denormalizeForEach(evt, callback);
      }

      if (self.query) {
        return self.handleQuery(evt, self.query, callback);
      }

      if (!self.query && self.getQueryForThisViewBuilder) {
        self.getQueryForThisViewBuilder(evt, function (err, query) {
          if (err) {
            debug(err);
            return callback(err);
          }
          self.handleQuery(evt, query, callback);
        });
        return;
      }

      self.extractId(evt, function (err, id) {
        if (err) {
          debug(err);
          return callback(err);
        }

        self.loadViewModel(id, function (err, vm) {
          if (err) {
            debug(err);
            return callback(err);
          }

          if (vm.actionOnCommit === 'create' && !self.autoCreate) {
            return callback(null, []);
          }

          self.handleOne(vm, evt, function (err, notification) {
            if (err) {
              debug(err);
              return callback(err);
            }

            var notis = [];
            if (notification) {
              notis.push(notification);
            }

            callback(null, notis);
          });
        });
      });
    }

    // if (this.shouldHandleRequestsOnlyEvent) {
    this.shouldHandleEvent(evt, function (err, doHandle) {
      if (err) {
        return callback(err);
      }

      if (!doHandle) {
        return callback(null, []);
      }

      denorm();
    });
    // } else {
      // denorm();
    // }
  }
786732
function (name, meta, target) {
            if (!__define.defineEvent(target || this.prototype, name, meta)) {
                this._events_.push(name);
            }

            return this;
        }
225652
function(filePath) {

    if( path.extname(filePath) === '.js' ) {
      filePath = path.dirname(filePath);
    }

    ////console.log(colors.gray('loading meta:'), filePath);

    this.filePath = filePath;

    var meta = require(filePath + '/meta');

    //set the name of the class to the last name value
    this.name = meta.name;

    if( typeof this.meta === 'object' ) {
      this.meta = merge(meta, this.meta);
    } else {
      this.meta = meta;
    }
  }
1238805
@Override
    public void componentMetaDataCreated(MetaDataEvent<ComponentMetaData> event) {
        JaccService js = jaccService.getService();
        if (js != null) {
            MetaData metaData = event.getMetaData();
            if (metaData instanceof BeanMetaData) {
                BeanMetaData bmd = (BeanMetaData) metaData;
                js.propagateEJBRoles(bmd.j2eeName.getApplication(), bmd.j2eeName.getModule(), bmd.enterpriseBeanName, bmd.ivRoleLinkMap,
                                     JaccUtil.convertMethodInfoList(JaccUtil.mergeMethodInfos(bmd)));
            }
        }
    }
575659
function Denormalizer(options) {
  EventEmitter.call(this);

  options = options || {};

  if (!options.denormalizerPath) {
    var err = new Error('Please provide denormalizerPath in options');
    debug(err);
    throw err;
  }

  var defaults = {
    retryOnConcurrencyTimeout: 800,
    commandRejectedEventName: 'commandRejected',
    callOnAfterCommitDuringReplay: false
  };

  _.defaults(options, defaults);

  this.structureLoader = createStructureLoader(options.structureLoader);

  this.repository = viewmodel.write(options.repository);

  var defaultRevOpt = {
    queueTimeout: 1000,
    queueTimeoutMaxLoops: 3//,
    // startRevisionNumber: 1
  };

  options.revisionGuard = options.revisionGuard || {};

  _.defaults(options.revisionGuard, defaultRevOpt);

  this.revisionGuardStore = revisionGuardStore.create(options.revisionGuard);

  this.options = options;

  this.definitions = {
    event: {
      correlationId: 'correlationId', // optional
      id: 'id',                       // optional
      name: 'name',                   // optional
//      aggregateId: 'aggregate.id',    // optional
//      context: 'context.name',        // optional
//      aggregate: 'aggregate.name',    // optional
      payload: 'payload'              // optional
//      revision: 'revision'            // optional
//      version: 'version',             // optional
//      meta: 'meta'                    // optional, if defined theses values will be copied to the notification (can be used to transport information like userId, etc..)
    },
    notification: {
      correlationId: 'correlationId',      // optional, the command Id
      id: 'id',                            // optional
      action: 'name',                      // optional
      collection: 'collection',            // optional
      payload: 'payload'                   // optional
//      context: 'meta.context.name',        // optional, if defined theses values will be copied from the event
//      aggregate: 'meta.aggregate.name',    // optional, if defined theses values will be copied from the event
//      aggregateId: 'meta.aggregate.id',    // optional, if defined theses values will be copied from the event
//      revision: 'meta.aggregate.revision', // optional, if defined theses values will be copied from the event
//      eventId: 'meta.event.id',            // optional, if defined theses values will be copied from the event
//      event: 'meta.event.name',            // optional, if defined theses values will be copied from the event
//      meta: 'meta'                         // optional, if defined theses values will be copied from the event (can be used to transport information like userId, etc..)
    }
  };

  this.idGenerator(function () {
    return uuid().toString();
  });

  this.onEvent(function (evt) {
    debug('emit event:', evt);
  });

  this.onNotification(function (noti) {
    debug('emit notification:', noti);
  });

  this.onEventMissing(function (info, evt) {
    debug('missing events: ', info, evt);
  });

  this.defaultEventExtension(function (evt) {
    return evt;
  });
}
114313
@SuppressWarnings("unchecked")
    static <P> LightMetaProperty<P> of(
            MetaBean metaBean,
            final Method getMethod,
            MethodHandles.Lookup lookup,
            final String propertyName,
            int constructorIndex) {
        
        MethodHandle getter;
        try {
            getter = lookup.unreflect(getMethod);
        } catch (IllegalArgumentException | IllegalAccessException ex) {
            throw new UnsupportedOperationException("Property cannot be read: " + propertyName, ex);
        }
        return new LightMetaProperty<>(
                metaBean, 
                propertyName, 
                (Class<P>) getMethod.getReturnType(), 
                getMethod.getGenericReturnType(), 
                Arrays.asList(getMethod.getAnnotations()), 
                getter,
                null,
                constructorIndex,
                PropertyStyle.DERIVED);
    }
487009
function actionCreator(type, payload, meta) {
  var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};

  var action = _objectSpread({
    type: type,
    payload: payload
  }, data);

  if (payload instanceof Error) {
    action.error = true;
  }

  if (meta) {
    action.meta = meta;
  }

  return action;
}
725599
function getMeta(key) {
  return baseQuery(key)
    .select('meta')
    .where('id', key)
    .then(pullValFromRows(key, 'meta'));
}
1293284
function (target, name, meta){
            var _ctor = __define.fixTargetCtor(target),
                _key = __define.fixTargetKey(name),
                _exist = _key in _ctor,
                _descriptor = {};
            var _getter, _setter;

            if ('value' in meta) {
                var _value = meta.value,
                    _field = '_' + name,
                    _get = meta.get,
                    _set = meta.set;

                _getter = _get || function () {
                    if (_field in this) {
                        return this[_field];
                    }
                    else {
                        return zn.is(_value, 'function') ? _value.call(this) : _value;
                    }
                };
                _setter = meta.readonly ?
                    function (value, options) {
                        if (options && options.force) {
                            this[_field] = value;
                        }
                        else {
                            return false;
                        }
                    } :
                    (_set ||function (value) {
                        this[_field] = value;
                    });
            } else {
                _getter = meta.get || function () {
                    return undefined;
                };
                _setter = meta.set || function () {
                    return false;
                };
            }

            if (_exist) {
                _getter.__super__ = _ctor[_key].getter;
                _setter.__super__ = _ctor[_key].setter;
            }

            /*
            if(!_exist){
                _descriptor = Object.defineProperty(target, name, {
                    get: _getter,
                    set: _setter,
                    configurable : true
                });
            }*/


            _descriptor = Object.defineProperty(target, name, {
                get: _getter,
                set: _setter,
                configurable : true
            });

            _ctor[_key] = {
                name: name,
                type: 'property',
                meta: meta,
                getter: _getter,
                setter: _setter,
                descriptor: _descriptor
            };

            return _exist;
        }
947861
protected function isPropertyViewField(Metadata $meta, $viewType, $field)
    {
        $config = $meta->getConfiguration()['view'][$viewType]['fields'][$field];

        return !isset($config['widget']) && !isset($config['service']) && !isset($config['callback']);
    }
790505
function (target, name, meta){
            var _ctor = __define.fixTargetCtor(target),
                _key = __define.fixTargetKey(name),
                _exist = _key in _ctor,
                _descriptor = {};

            if(!_exist){
                _descriptor = Object.defineProperty(target, 'on' + name.toLowerCase(), {
                    get: function () {
                        var _listeners = this.__handlers__[name];
                        if (_listeners) {
                            return _listeners[0].handler;
                        }
                        else {
                            return null;
                        }
                    },
                    set: function (value) {
                        var _handlers = this.__handlers__;
                        var _listeners = _handlers[name] = _handlers[name] || [];

                        _listeners[0] = {
                            owner: this,
                            handler: value,
                            context: null
                        };
                    }
                });
            }
            _ctor[_key] = {
                name: name,
                type: 'event',
                meta: meta,
                descriptor: _descriptor
            };

            return _exist;
        }
1146072
function() {
			if (!this.metaPath) {
				this.oMetaContext = this.oMetaModel.getMetaContext(this.path);
				this.metaPath = this.oMetaContext.getPath();
			} else {
				this.oMetaContext = this.oMetaModel.createBindingContext(this.metaPath);
			}
		}
135350
function metaToValue (meta) {
  const types = {
    value: () => meta.value,
    array: () => meta.members.map((member) => metaToValue(member)),
    buffer: () => bufferUtils.metaToBuffer(meta.value),
    promise: () => resolvePromise({ then: metaToValue(meta.then) }),
    error: () => metaToPlainObject(meta),
    date: () => new Date(meta.value),
    exception: () => { throw errorUtils.deserialize(meta.value) }
  }

  if (meta.type in types) {
    return types[meta.type]()
  } else {
    let ret
    if (remoteObjectCache.has(meta.id)) {
      v8Util.addRemoteObjectRef(contextId, meta.id)
      return remoteObjectCache.get(meta.id)
    }

    // A shadow class to represent the remote function object.
    if (meta.type === 'function') {
      const remoteFunction = function (...args) {
        let command
        if (this && this.constructor === remoteFunction) {
          command = 'ELECTRON_BROWSER_CONSTRUCTOR'
        } else {
          command = 'ELECTRON_BROWSER_FUNCTION_CALL'
        }
        const obj = ipcRendererInternal.sendSync(command, contextId, meta.id, wrapArgs(args))
        return metaToValue(obj)
      }
      ret = remoteFunction
    } else {
      ret = {}
    }

    setObjectMembers(ret, ret, meta.id, meta.members)
    setObjectPrototype(ret, ret, meta.id, meta.proto)
    Object.defineProperty(ret.constructor, 'name', { value: meta.name })

    // Track delegate obj's lifetime & tell browser to clean up when object is GCed.
    v8Util.setRemoteObjectFreer(ret, contextId, meta.id)
    v8Util.setHiddenValue(ret, 'atomId', meta.id)
    v8Util.addRemoteObjectRef(contextId, meta.id)
    remoteObjectCache.set(meta.id, ret)
    return ret
  }
}
790351
function CommittingEventTransformer (meta, transformFn) {
  Definition.call(this, meta);

  meta = meta || {};

  if (transformFn && !_.isFunction(transformFn)) {
    var err = new Error('Transform function not injected!');
    debug(err);
    throw err;
  }

  this.version = meta.version;

  this.transformFn = transformFn;
}