本文整理了Java中org.nuxeo.ecm.core.api.model.Property.init()
方法的一些代码示例,展示了Property.init()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.init()
方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.model.Property
类名称:Property
方法名:init
[英]Initializes the property with the given normalized value.
The given value must be normalized - note that no check is done on that.
The phantom flag is unset by this operation.
This method should be used to initialize properties.
[中]使用给定的规范化值初始化属性。
给定的值必须规范化——请注意,没有对其进行检查。
此操作将取消幻影标志的设置。
应使用此方法初始化属性。
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
@Override
@SuppressWarnings("unchecked")
public void init(Serializable value) throws PropertyException {
if (value == null) { // IGNORE null values - properties will be
// considered PHANTOMS
return;
}
Map<String, Serializable> map = (Map<String, Serializable>) value;
for (Entry<String, Serializable> entry : map.entrySet()) {
Property property = get(entry.getKey());
property.init(entry.getValue());
}
removePhantomFlag();
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
@Override
@SuppressWarnings("unchecked")
public void init(Serializable value) throws PropertyException {
if (value == null) {
// IGNORE null values - properties will be
// considered PHANTOMS
return;
}
Map<String, Serializable> map;
if (value instanceof Map) {
map = (Map<String, Serializable>) value;
} else if (value instanceof Blob) {
// XXX: workaround: get the uri from the local prop because it's not on
// the Blob
map = getMapFromBlobWithUri((Blob) value);
} else {
throw new PropertyException("Invalid value for external blob (map or blob needed): " + value);
}
for (Entry<String, Serializable> entry : map.entrySet()) {
Property property = get(entry.getKey());
property.init(entry.getValue());
}
removePhantomFlag();
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
@Override
@SuppressWarnings("unchecked")
public void init(Serializable value) throws PropertyException {
if (value == null) { // IGNORE null values - properties will be
// considered PHANTOMS
return;
}
List<Serializable> list;
if (value.getClass().isArray()) { // accept also arrays
list = (List<Serializable>) PrimitiveArrays.toList(value);
} else {
list = (List<Serializable>) value;
}
children.clear(); // do not use clear() method since it is marking the
// list as dirty
Field lfield = getType().getField();
for (Serializable obj : list) {
Property property = getRoot().createProperty(this, lfield, 0);
property.init(obj);
children.add(property);
}
removePhantomFlag();
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-storage
property.init((Serializable) value);
} else if (type.isComplexType()) {
property.init(array);
} else {
list.add(p.getValue());
property.init((Serializable) list);
内容来源于网络,如有侵权,请联系作者删除!