"use strict"; var LeafMatchExpression = require('./LeafMatchExpression'); // Autogenerated by cport.py on 2013-09-17 14:37 var ExistsMatchExpression = module.exports = function ExistsMatchExpression(){ base.call(this); this._matchType = 'EXISTS'; }, klass = ExistsMatchExpression, base = LeafMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); /** * * Writes a debug string for this object * @method debugString * @param level * */ proto.debugString = function debugString(level) { // File: expression_leaf.cpp lines: 286-294 return this._debugAddSpace( level ) + this.path() + " exists" + (this.getTag() ? " " + this.getTag().debugString() : "") + "\n"; }; /** * * checks if this expression is == to the other * @method equivalent * @param other * */ proto.equivalent = function equivalent(other) { // File: expression_leaf.cpp lines: 297-302 if(this._matchType != other._matchType) { return false; } return this.path() == other.path(); }; /** * * Initialize the necessary items * @method init * @param path * @param type * */ proto.init = function init(path) { // File: expression_leaf.cpp lines: 278-279 return this.initPath( path ); }; /** * * Check if the input element matches * @method matchesSingleElement * @param e * */ proto.matchesSingleElement = function matchesSingleElement(e) { // File: expression_leaf.cpp lines: 282-283 if(typeof(e) == 'undefined') return false; if(e === null) return true; if(typeof(e) == 'object') return (Object.keys(e).length > 0); else return true; }; /** * * clone this instance to a new one * @method shallowClone * */ proto.shallowClone = function shallowClone(){ // File: expression_leaf.h lines: 220-223 var e = new ExistsMatchExpression(); e.init(this.path()); return e; };