Returns the (first) kbItemController  which has the given model value.
@returns {KbItemController}
760194
function (model) {
            var items = this._element.querySelectorAll('[kb-item]');
            for (var i = 0; i < items.length; i++) {
                var kbItem = angular.element(items.item(i)).controller('kbItem');
                if (kbItem.model === model) {
                    return kbItem;
                }
            }
        }
224807
public Kv getKv() {
		Kv kv = new Kv();
		Map<String, String[]> paraMap = request.getParameterMap();
		for (Entry<String, String[]> entry : paraMap.entrySet()) {
			String[] values = entry.getValue();
			String value = (values != null && values.length > 0) ? values[0] : null;
			kv.put(entry.getKey(), "".equals(value) ? null : value);
		}
		return kv;
	}
1299690
public ModelAnnotation getAnnotation(Class<? extends Annotation> value) {
		for (ModelAnnotation item : annotations) {
			if (item.getName().equals(value.getCanonicalName())) {
				return item;
			}
		}

		return null;
	}
135282
function(model) {
        var modelObj = model.changedAttributes();
        _.each(model.changed, function(value, key) {
          if (typeof value === 'undefined' || value === null) {
            if (key == 'id') {
              delete modelObj[key];
            } else {
              modelObj[key] = null;
            }
          }
        });

        return modelObj;
      }
1264475
function (value, modelsToIgnore) {
    modelsToIgnore = modelsToIgnore || {};

    modelsToIgnore[value.name] = value;

    // Response support
    if (value.examples && _.isPlainObject(value.examples)) {
      value = _.cloneDeep(value);
      var keys = Object.keys(value.examples);

      _.forEach(keys, function(key) {
        if(key.indexOf('application/json') === 0) {
          var example = value.examples[key];
          if (_.isString(example)) {
            example = jsyaml.safeLoad(example);
          }
          value.definition.example = example;
          return schemaToJSON(value.definition, example, modelsToIgnore, value.modelPropertyMacro);
        }
      });
    }

    if (value.examples) {
      value = _.cloneDeep(value);
      var example = value.examples;
      if (_.isString(example)) {
        example = jsyaml.safeLoad(example);
      }
      value.definition.example = example;
      return schemaToJSON(value.definition, example, modelsToIgnore, value.modelPropertyMacro);
    }

    return schemaToJSON(value.definition, value.models, modelsToIgnore, value.modelPropertyMacro);
  }
947206
function (model) {

                var ret = [];

                function getSubModel(obj) {

                    if (obj === model) {
                        return;
                    }

                    if (_.indexOf(ret, obj) !== -1) {
                        // already in list
                        return;
                    }

                    if (obj instanceof Model) {
                        ret.push(obj);
                        return;
                    }

                    for (var key in obj) {
                        if (obj.hasOwnProperty(key)) {
                            var value = obj[key];

                            if (value instanceof Array) {
                                for (var i = 0; i < value.length; i++) {
                                    getSubModel(value[i]);
                                }
                            } else if (value instanceof List) {
                                value.each(getSubModel);
                            } else if (value instanceof Object) {
                                getSubModel(value);
                            }
                        }
                    }
                }

                getSubModel(model.$);

                return ret;

            }
166515
function (connectionName, collectionName, obj, cb) {
        if (_.isObject(obj)) {
            try {
                var modelInstance = new this._model(obj);
                return cb(null, modelInstance);
            }
            catch (err) {
                return cb(err, null);
            }
        }
    }
223159
function modelItemMediator(item, index) {
    const { Model } = this;

    // if an item is already instance of Model
    if (item instanceof Model) {
        return item;
    }

    let itemData;

    if (item && typeof item.toJSON === 'function') {
        // if item is not falsy and if it has toJSON method
        // then retrieve instance data by this method
        itemData = item.toJSON(false);
    } else {
        // if not then use an item as its data
        itemData = item;
    }

    return new Model(itemData, this, index);
}
1196578
public ItemsSketch<T> getResult() {
    if (gadget_ == null) {
      return ItemsSketch.getInstance(maxK_, comparator_);
    }
    return ItemsSketch.copy(gadget_); //can't have any externally owned handles.
  }
581112
function (value) {
            var report = new ariaWidgetsControllersReportsDropDownControllerReport();
            var dataModel = this._dataModel;
            if (value === null) {
                report.ok = true;
                dataModel.value = null;
                dataModel.text = '';
            } else {
                if (!ariaUtilsJson.equals(value, dataModel.value)) {
                    // Only update the data-model if there has been a change, otherwise onchange is raised
                    ariaUtilsJson.setValue(dataModel, 'selectedValues', value);
                    dataModel.value = value;

                } else {
                    if (!ariaUtilsJson.equals(dataModel.selectedValues, dataModel.value)) {
                        // Only update the data-model if there has been a change, otherwise onchange is raised
                        value = dataModel.selectedValues;
                        dataModel.value = value;
                    }
                }
                report.ok = true;
                var text = this._getDisplayValue(value);
                dataModel.text = text;
            }
            if (report.ok) {
                report.text = dataModel.text;
                report.value = this._getValue(dataModel.text, dataModel.value);
            }
            return report;
        }
363049
function() {
			// If this Model has already been fully serialized in this branch once, return to avoid loops
			if ( this.isLocked() ) {
				return this.id;
			}
			
			this.acquire();
			var json = Backbone.Model.prototype.toJSON.call( this );
			
			if ( this.constructor._superModel && !( this.constructor._subModelTypeAttribute in json ) ) {
				json[ this.constructor._subModelTypeAttribute ] = this.constructor._subModelTypeValue;
			}
			
			_.each( this._relations, function( rel ) {
					var value = json[ rel.key ];

					if ( rel.options.includeInJSON === true) {
						if ( value && _.isFunction( value.toJSON ) ) {
							json[ rel.keyDestination ] = value.toJSON();
						}
						else {
							json[ rel.keyDestination ] = null;
						}
					}
					else if ( _.isString( rel.options.includeInJSON ) ) {
						if ( value instanceof Backbone.Collection ) {
							json[ rel.keyDestination ] = value.pluck( rel.options.includeInJSON );
						}
						else if ( value instanceof Backbone.Model ) {
							json[ rel.keyDestination ] = value.get( rel.options.includeInJSON );
						}	
						else {
							json[ rel.keyDestination ] = null;
						}
					}
					else if ( _.isArray( rel.options.includeInJSON ) ) {
						if ( value instanceof Backbone.Collection ) {
							var valueSub = [];
							value.each( function( model ) {
								var curJson = {};
								_.each( rel.options.includeInJSON, function( key ) {
									curJson[ key ] = model.get( key );
								});
								valueSub.push( curJson );
							});
							json[ rel.keyDestination ] = valueSub;
						}
						else if ( value instanceof Backbone.Model ) {
							var valueSub = {};
							_.each( rel.options.includeInJSON, function( key ) {
								valueSub[ key ] = value.get( key );
							});
							json[ rel.keyDestination ] = valueSub;
						}
						else {
							json[ rel.keyDestination ] = null;
						}
					}
					else {
						delete json[ rel.key ];
					}

					if ( rel.keyDestination !== rel.key ) {
						delete json[ rel.key ];
					}
				});
			
			this.release();
			return json;
		}
719956
public Object getControlValue()
    {
        Object objValue = null;
        if (m_iCurrentState == ON)
            objValue = Boolean.TRUE;
        else if (m_iCurrentState == OFF)
            objValue = Boolean.FALSE;
        return objValue;
    }
338635
function(models, out)
  {
    var target = out || this.cloneEmpty();

    for (var i = 0; i < this.length; i++)
    {
      var a = this[ i ];
      var key = a.$key();
      var exists = false;

      if ( models instanceof ModelCollection )
      {
        exists = models.has( key );
      }
      else
      {
        for (var k = 0; k < models.length && !exists; k++)
        {
          var modelKey = this.buildKeyFromInput( models[ k ] );

          exists = (key === modelKey);
        }
      }

      if (!exists)
      {
        target.push( a );
      }
    }

    return target;
  }
1238474
function() {
      
      var getDefaultValueForField = function (classObj, paramName) {
         var i, length = classObj.groupOptions.length, f;
         
         for(i = 0 ; i < length ; i++) {
            f = classObj.groupOptions[i];
            
            // Retro-compatibility with deprecated inputParams Object
            if(lang.isObject(f.inputParams) && f.inputParams.name == paramName) {
               return f.inputParams.value;
               
            // New prefered way to use field options
            } else if (f.name == paramName) {
               return f.value;
            }
         }
         return undefined;
      };
      
      
      // The field parameters
      var fieldParams = this.group.getValue();
      var classObj = inputEx.getFieldClass(this.typeSelect.getValue());
      
      // + default values
      for(var key in fieldParams) {
         if( fieldParams.hasOwnProperty(key) ) {
            var value1 = getDefaultValueForField(classObj, key);
            var value2 = fieldParams[key];
            if(value1 == value2) {
               fieldParams[key] = undefined;
            }
         }
      }
      
      // The field type
      fieldParams.type = this.typeSelect.getValue();
      
      // The value defined by the fieldValue
      if(this.fieldValue) fieldParams.value = this.fieldValue.getValue();
      
      return fieldParams;
   }
682484
function () {
            if (this.$subBinding) {
                this.$subBinding.invalidateValueCache();
                return this.$subBinding.getValue();
            } else {

                if (this.$cachedValue !== undefined && !this.$jsonObject) {
                    return this.$cachedValue;
                }

                this.$originalValue = undefined;
                if (this.$.fnc && !this.$jsonObject) {
                    this.$originalValue = this.$.fnc.apply(this.$.scope, this._getFncParameters());
                } else if (this.$.path.length === 1) {
                    this.$originalValue = this.$.scope.get(this.$.key.name);
                } else if (this.$jsonObject && !_.isString(this.$jsonObject)) {
                    this.$originalValue = this.$.scope.get(this.$jsonObject, this.$.path.slice(1));
                } else {
                    this.$originalValue = this.$.scope.get(this.$.path);
                }
                this.$cachedValue = this.transform.call(this.transformScope, this.$originalValue);
                return this.$cachedValue;
            }

        }
223821
function () {
                /*  create initial values object  */
                var values = {};

                /*  iterate over all models towards the root component  */
                var found = false;
                var comp = this;
                var owner, model;
                while (comp !== null) {
                    owner = comp.property({ name: "ComponentJS:model", returnowner: true });
                    if (!_cs.isdefined(owner))
                        break;
                    found = true;
                    model = owner.property("ComponentJS:model");
                    comp = owner.parent();

                    /*  enhance values object with properties of all models  */
                    for (var name in model.data) {
                        var symbol = name.replace(/[^a-zA-Z0-9_]+/g, "_");
                        (function (owner, name, symbol) {
                            Object.defineProperty(values, symbol, {
                                enumerable:   false,
                                configurable: false,
                                writeable:    true,
                                get: function ()      { return owner.value(name);        },
                                set: function (value) { return owner.value(name, value); }
                            });
                        })(owner, name, symbol);
                    }
                }

                /*  sanity check situation  */
                if (!found)
                    throw _cs.exception("values", "no models found at all");

                /*  return generated object  */
                return values;
            }
486233
function (model) {
            if (!this.ngModel) {
                return; // A kb-item can't be selected without a ng-model on the container element.
            }
            if (this.multiple) {
                if (this.isSelected(model) === false) {
                    this.selected.push(model);
                    this.ngModel.$setViewValue(this.selected);
                }
            } else {
                this.selected[0] = model;
                this.ngModel.$setViewValue(model);
            }
        }