org.nuxeo.ecm.core.api.model.Property.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.nuxeo.ecm.core.api.model.Property.setValue()方法的一些代码示例,展示了Property.setValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.setValue()方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.model.Property
类名称:Property
方法名:setValue

Property.setValue介绍

[英]Sets a child property value given its index. This method is required only for List properties.

If this method is not supported, an UnsupportedOperationException must be thrown.

This method will mark the child value as dirty for existing values and in the case of map properties it will mark phantom properties as new properties.
[中]设置给定索引的子属性值。此方法仅适用于列表属性。
如果不支持此方法,则必须抛出UnsupportedOperationException。
对于现有值,此方法将子值标记为脏,对于贴图属性,它将幻像属性标记为新属性。

代码示例

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setObject(Object object) {
  Object reference = resolver.getReference(object);
  property.setValue(reference);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setPropertyValue(String xpath, Serializable value) {
  getProperty(xpath).setValue(value);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setValue(String path, Object value) throws PropertyException {
  resolvePath(path).setValue(value);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setValue(int index, Object value) throws PropertyException {
  Property property = get(index);
  property.setValue(value);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setPropertyValue(String xpath, Serializable value) throws PropertyException {
  getProperty(xpath).setValue(value);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setBlob(Blob blob) {
  doc.getProperty(xPath).setValue(blob);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void internalSetValue(Serializable value) throws PropertyException {
  StringBuilder msg = newRemovedMessage();
  if (fallback == null) {
    msg.append("Do nothing");
  } else {
    msg.append("Set value to fallback property '").append(fallback.getXPath()).append("'");
  }
  if (log.isTraceEnabled()) {
    log.error(msg, new NuxeoException("debug stack trace"));
  } else {
    log.error(msg);
  }
  if (fallback != null) {
    fallback.setValue(value);
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public Object setValue(String path, Object value) throws PropertyException {
  Property prop = dp.resolvePath(path);
  Object oldValue = prop.getValue();
  prop.setValue(value);
  return oldValue;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

/**
 * If this property is deprecated and has a fallback, set value to fallback.
 */
protected void setValueDeprecation(Object value, boolean setFallback) throws PropertyException {
  if (isDeprecated()) {
    // First check if we need to set the fallback value
    if (setFallback && deprecatedFallback != null) {
      deprecatedFallback.setValue(value);
    }
    // Second check if we need to log deprecation message
    if (log.isWarnEnabled()) {
      StringBuilder msg = newDeprecatedMessage();
      msg.append("Set value to deprecated property");
      if (deprecatedFallback != null) {
        msg.append(" and to fallback property '").append(deprecatedFallback.getXPath()).append("'");
      }
      if (log.isTraceEnabled()) {
        log.warn(msg, new NuxeoException("debug stack trace"));
      } else {
        log.warn(msg);
      }
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public void setBlob(Blob blob) {
  if (blob == null) {
    doc.getProperty(xPath).setValue(null);
    mt = null;
  } else {
    String string;
    try {
      string = blob.getString();
    } catch (IOException e) {
      throw new NuxeoException(e);
    }
    // strip '\0 chars from text
    if (string.indexOf('\0') >= 0) {
      string = string.replace("\0", "");
    }
    doc.getProperty(xPath).setValue(string);
    mt = blob.getMimeType();
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public Property addValue(int index, Object value) throws PropertyException {
  Field lfield = getType().getField();
  Property property = getRoot().createProperty(this, lfield, IS_NEW);
  property.setValue(value);
  children.add(index, property);
  return property;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

@Override
public Property addValue(Object value) throws PropertyException {
  Field lfield = getType().getField();
  Property property = getRoot().createProperty(this, lfield, IS_NEW);
  property.setValue(value);
  children.add(property);
  return property;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

if (entryKey != URI) {
      property = get(entryKey);
      property.setValue(entry.getValue());
for (Entry<String, Object> entry : map.entrySet()) {
  Property property = get(entry.getKey());
  property.setValue(entry.getValue());

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

break;
case ListDiff.MODIFY:
  get(entry.index).setValue(entry.value);
  break;
case ListDiff.MOVE:

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

for (Object obj : col) {
  Property property = getRoot().createProperty(this, lfield, IS_NEW);
  property.setValue(obj);
  children.add(property);

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

property.setValue(entry.getValue());

代码示例来源:origin: org.nuxeo.ecm.routing/nuxeo-routing-core

public void setExecuted(boolean executed) {
  this.executed = executed;
  prop.get(PROP_ESCALATION_RULE_EXECUTED).setValue(Boolean.valueOf(executed));
  if (executed) {
    setExecutionTime(Calendar.getInstance());
  }
}

代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@Override
public Serializable put(String key, Serializable value) {
  Property p = principal.getModel().getProperty(key);
  Serializable v = p.getValue();
  p.setValue(value);
  return v;
}

代码示例来源:origin: org.nuxeo.ecm.routing/nuxeo-routing-core

public TaskInfo(GraphNode node, String taskDocId) {
  this.node = node;
  this.prop = (MapProperty) ((ListProperty) node.getDocument().getProperty(PROP_TASKS_INFO)).addEmpty();
  this.prop.get(PROP_TASK_INFO_TASK_DOC_ID).setValue(taskDocId);
  this.taskDocId = taskDocId;
}

代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@OperationMethod(collector = DocumentModelCollector.class)
public DocumentModel run(DocumentModel doc) throws java.lang.Exception {
  Property p = doc.getProperty(xpath);
  Object o = p.getValue();
  if (o instanceof Blob) {
    Blob blob = (Blob) o;
    blob.setFilename(name);
    p.setValue(blob);
  }
  if (save) {
    doc = session.saveDocument(doc);
  }
  return doc;
}

相关文章