本文整理了Java中org.nuxeo.ecm.core.api.model.Property.getParent()
方法的一些代码示例,展示了Property.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getParent()
方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.model.Property
类名称:Property
方法名:getParent
[英]Gets the property parent.
[中]获取属性父级。
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
@Override
public DocumentValidationReport validate(Property property, boolean validateSubProperties) {
List<PathNode> path = new ArrayList<>();
Property inspect = property;
while (inspect != null && !(inspect instanceof DocumentPart)) {
path.add(0, new PathNode(inspect.getField()));
inspect = inspect.getParent();
}
return new DocumentValidationReport(
validateAnyTypeProperty(property.getSchema(), path, property, false, validateSubProperties));
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
for (; start < segments.length; start++) {
if (segments[start].equals("..")) {
property = property.getParent();
} else {
break;
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-storage
/**
* Gets the {@link Schema} at the top-level of the type hierarchy for this {@link Property}.
*
* @since 9.3
*/
protected Schema getTopLevelSchema(Property property) {
for (;;) {
Type type = property.getType();
if (type instanceof Schema) {
return (Schema) type;
}
property = property.getParent();
}
}
代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core
/**
* Removes a property from a document given the xpath. If the xpath points to a list property the list will be
* cleared. If the path points to a blob in a list the property is removed from the list. Otherwise the xpath should
* point to a non list property that will be removed.
*/
public static void removeProperty(DocumentModel doc, String xpath) {
Property p = doc.getProperty(xpath);
if (p instanceof ListProperty) {
((ListProperty) p).clear();
} else {
Property pp = p.getParent();
if (pp != null && pp.isList()) { // remove list entry
((ListProperty) pp).remove(p);
} else {
p.remove();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!