Fetches the current online data for the given item, and fixes the
precision of integer quantities if necessary.

@param itemIdValue
the id of the document to inspect
@param propertyId
id of the property to consider
328657
protected void fixIntegerPrecisions(ItemIdValue itemIdValue,
			String propertyId) {

		String qid = itemIdValue.getId();

		try {
			// Fetch the online version of the item to make sure we edit the
			// current version:
			ItemDocument currentItemDocument = (ItemDocument) dataFetcher
					.getEntityDocument(qid);
			if (currentItemDocument == null) {
				System.out.println("*** " + qid
						+ " could not be fetched. Maybe it has been deleted.");
				return;
			}

			// Get the current statements for the property we want to fix:
			StatementGroup editPropertyStatements = currentItemDocument
					.findStatementGroup(propertyId);
			if (editPropertyStatements == null) {
				System.out.println("*** " + qid
						+ " no longer has any statements for " + propertyId);
				return;
			}

			PropertyIdValue property = Datamodel
					.makeWikidataPropertyIdValue(propertyId);
			List<Statement> updateStatements = new ArrayList<>();
			for (Statement s : editPropertyStatements) {
				QuantityValue qv = (QuantityValue) s.getValue();
				if (qv != null && isPlusMinusOneValue(qv)) {
					QuantityValue exactValue = Datamodel.makeQuantityValue(
							qv.getNumericValue(), qv.getNumericValue(),
							qv.getNumericValue());
					Statement exactStatement = StatementBuilder
							.forSubjectAndProperty(itemIdValue, property)
							.withValue(exactValue).withId(s.getStatementId())
							.withQualifiers(s.getQualifiers())
							.withReferences(s.getReferences())
							.withRank(s.getRank()).build();
					updateStatements.add(exactStatement);
				}
			}

			if (updateStatements.size() == 0) {
				System.out.println("*** " + qid + " quantity values for "
						+ propertyId + " already fixed");
				return;
			}

			logEntityModification(currentItemDocument.getEntityId(),
					updateStatements, propertyId);

			dataEditor.updateStatements(currentItemDocument, updateStatements,
					Collections.<Statement> emptyList(),
					"Set exact values for [[Property:" + propertyId + "|"
							+ propertyId + "]] integer quantities (Task MB2)");

		} catch (MediaWikiApiErrorException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
1072096
@Override
    public void setPropertyValue(PropertyInfo propInfo, Object value) throws Exception {
        String propId = propInfo.getId();
        Object obj = registeredProperties == null ? null : registeredProperties.get(propId);

        if (obj == null) {
            obj = new PropertyProxy(propInfo, value);
            registerProperties(obj, propId);
        } else if (obj instanceof PropertyProxy) {
            ((PropertyProxy) obj).setValue(value);
        } else {
            propInfo.setPropertyValue(obj, value, obj == this);
        }
    }
43522
public static Object getValue(final Object current, final String property) {
        return getDefinedValue(current, property).getValueResult().getOrElse(null);
    }
14186
function (mode, index, item) {
/*Line 376 - 'AtomItemsControl.js' */                if (!this._created)
/*Line 377 - 'AtomItemsControl.js' */                    return;

/*Line 379 - 'AtomItemsControl.js' */                Atom.refresh(this, "allValues");

/*Line 381 - 'AtomItemsControl.js' */                var value = this.get_value();

/*Line 383 - 'AtomItemsControl.js' */                if (this.hasItems()) {
/*Line 384 - 'AtomItemsControl.js' */                    this.onCollectionChanged(mode, index, item);
/*Line 385 - 'AtomItemsControl.js' */                    //this._selectedItems.length = 0;
/*Line 386 - 'AtomItemsControl.js' */                    if (!(value || this._allowSelectFirst)) {
/*Line 387 - 'AtomItemsControl.js' */                        AtomBinder.clear(this._selectedItems);
/*Line 388 - 'AtomItemsControl.js' */                    }
/*Line 389 - 'AtomItemsControl.js' */                }


/*Line 392 - 'AtomItemsControl.js' */                if (value != null) {
/*Line 393 - 'AtomItemsControl.js' */                    this.set_value(value);
/*Line 394 - 'AtomItemsControl.js' */                    if (this.get_selectedIndex() != -1)
/*Line 395 - 'AtomItemsControl.js' */                        return;
/*Line 396 - 'AtomItemsControl.js' */                }

/*Line 398 - 'AtomItemsControl.js' */                this.selectDefault();

/*Line 400 - 'AtomItemsControl.js' */            }
727812
public static void setProperty(String propertyName, String propertyValue) {
		try {
			FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
		} catch (TemplateException e) {
			throw new RuntimeException(e);
		}
	}
692228
public function widgetToValue($varValue, $itemId)
    {
        if (null === $varValue) {
            return null;
        }
        static $cache = [];
        $attributeId = $this->get('id');
        if (array_key_exists($attributeId, $cache) && array_key_exists($varValue, $cache[$attributeId])) {
            return $cache[$attributeId][$varValue];
        }

        $model = $this->getSelectMetaModel();
        $alias = $this->getIdColumn();

        if ($model->hasAttribute($alias)) {
            $attribute = $model->getAttribute($alias);
            // It is an attribute, we may search for it.
            $ids = $attribute->searchFor($varValue);
        } else {
            // Must be a system column then.
            $result = $this->connection->createQueryBuilder()
                ->select('v.id')
                ->from($this->getSelectSource(), 'v')
                ->where('v.' . $this->getIdColumn() . '=:value')
                ->setParameter('value', $varValue)
                ->execute();

            $ids = $result->fetchAll(\PDO::FETCH_COLUMN);
        }

        // Maybe deleted value?
        if ([] === $ids) {
            return $cache[$attributeId][$varValue] = null;
        }

        // Multiple results.
        if (null === $ids || \count($ids) > 1) {
            throw new \RuntimeException(
                \sprintf(
                    'Multiple values found for %s, are there obsolete values for %s.%s (att_id: %s)?',
                    \var_export($varValue, true),
                    $model->getTableName(),
                    $this->getColName(),
                    $this->get('id')
                )
            );
        }
        $valueId = \array_shift($ids);

        $value = $this->getValuesById(
            [$valueId],
            [$this->getAliasColumn(), $this->getValueColumn(), $this->getIdColumn(), $this->getSortingColumn()]
        );

        return $cache[$attributeId][$varValue] = $value[$valueId];
    }
235664
private void setIdValue(Object target, JsonNode idValue) throws IllegalAccessException {
		Field idField = configuration.getIdField(target.getClass());
		ResourceIdHandler idHandler = configuration.getIdHandler(target.getClass());

		if (idValue != null) {
			idField.set(target, idHandler.fromString(idValue.asText()));
		}
	}
849612
protected final int getIntValue(final String propertyName, int defaultValue) {
        int result;
        String property = this.properties.getProperty(propertyName);
        try {
            result = Integer.parseInt(property);
        } catch (NumberFormatException e) {
            LOGGER.warn("Invalid integer property in configuration: {}",
                    propertyName);
            result = defaultValue;
        }
        return result;
    }
439905
function setItem(itemName, itemValue) {
  data[itemName] = itemValue;
  if (localExists()) {
    // Convert object to string
    if ((0, _isObject2.default)(itemValue)) {
      itemValue = JSON.stringify(itemValue);
    }
    window.sessionStorage.setItem(itemName, itemValue);
  }
}
1019872
@SuppressWarnings("unchecked")
    void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {

            if (event.getButton().equals(MouseButton.LEFT)) {
                setValue(null);
            }
            changeValueIfNotMultiSelect(itemId);
            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) {
                m_menu.removeAllItems();
                fillContextMenu((Set<Logger>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            }

        }
    }
873388
protected void setProperty(String propertyName, JavascriptObject propertyValue) {
        jsObject.setMember(propertyName, propertyValue.getJSObject());
    }
742042
function (propertyName, newValue) {
            if (!this._cfg) {
                return;
            }
            if (propertyName === "items" && this._cfg.bind.hasOwnProperty(propertyName)) {
                var oldValue = this.getProperty(propertyName);
                this._cfg[propertyName] = newValue;
                this._onBoundPropertyChange(propertyName, newValue, oldValue);
            } else {
                this.$TemplateBasedWidget.setWidgetProperty.apply(this, arguments);
            }
        }
7556
static EntityIdValue fromId(String id, String siteIri) {
		switch (guessEntityTypeFromId(id)) {
			case EntityIdValueImpl.JSON_ENTITY_TYPE_ITEM:
				return new ItemIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_PROPERTY:
				return new PropertyIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_LEXEME:
				return new LexemeIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_FORM:
				return new FormIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_SENSE:
				return new SenseIdValueImpl(id, siteIri);
			default:
				throw new IllegalArgumentException("Entity id \"" + id + "\" is not supported.");
		}
	}
1194121
function getPropertyValue(wofData, property) {

  if (wofData.properties.hasOwnProperty(property)) {

    // if the value is an array, return the first item
    if (wofData.properties[property] instanceof Array) {
      return wofData.properties[property][0];
    }

    // otherwise just return the value as is
    return wofData.properties[property];
  }
  return false;
}
283288
public void setPropertyType(PropertyIdValue propertyIdValue,
			String datatypeIri) {
		datatypes.put(propertyIdValue.getId(), datatypeIri);

	}
727036
public ReferenceBuilder withPropertyValue(PropertyIdValue propertyIdValue,
			Value value) {
		getSnakList(propertyIdValue).add(
				factory.getValueSnak(propertyIdValue, value));
		return getThis();
	}
1081630
public int getProperty(String propName, int defaultValue) {
        String propValue = props.getProperty(propName);
        return (propValue == null) ? defaultValue : Integer.parseInt(propValue);
    }