本文整理了Java中org.apache.jackrabbit.oak.api.Tree.getPropertyStatus()
方法的一些代码示例,展示了Tree.getPropertyStatus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getPropertyStatus()
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.api.Tree
类名称:Tree
方法名:getPropertyStatus
[英]Get the Status of a property state or null.
[中]获取属性状态或null的状态。
代码示例来源:origin: apache/jackrabbit-oak
@Override @Nullable
public Status getStatus() {
return parent.getPropertyStatus(name);
}
代码示例来源:origin: org.apache.jackrabbit/oak-jcr
@Override @Nullable
public Status getStatus() {
return parent.getPropertyStatus(name);
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@Override @CheckForNull
public Status getStatus() {
return parent.getPropertyStatus(name);
}
代码示例来源:origin: org.apache.jackrabbit/oak-core
/**
* Utility to determine if a given group has any members.
*
* @param groupTree The tree of the target group.
* @return {@code true} if the group has any members i.e. if it has a rep:members
* property or a rep:membersList child node.
*/
private static boolean hasMembers(@NotNull Tree groupTree) {
return groupTree.getPropertyStatus(REP_MEMBERS) != null || groupTree.hasChild(REP_MEMBERS_LIST);
}
代码示例来源:origin: apache/jackrabbit-oak
/**
* Utility to determine if a given group has any members.
*
* @param groupTree The tree of the target group.
* @return {@code true} if the group has any members i.e. if it has a rep:members
* property or a rep:membersList child node.
*/
private static boolean hasMembers(@NotNull Tree groupTree) {
return groupTree.getPropertyStatus(REP_MEMBERS) != null || groupTree.hasChild(REP_MEMBERS_LIST);
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
/**
* Utility to determine if a given group has any members.
*
* @param groupTree The tree of the target group.
* @return {@code true} if the group has any members i.e. if it has a rep:members
* property or a rep:membersList child node.
*/
private static boolean hasMembers(@Nonnull Tree groupTree) {
return groupTree.getPropertyStatus(REP_MEMBERS) != null || groupTree.hasChild(REP_MEMBERS_LIST);
}
代码示例来源:origin: apache/jackrabbit-oak
/**
* Determine if the group has (potentially) been modified in which case the
* query can't be used:
* - rep:members property has been modified
* - any potential modification in the member-ref-list subtree, which is not
* easy to detect => relying on pending changes on the root object
*
* @param groupTree The tree of the target group.
* @return {@code true} if the specified group tree has an unmodified rep:members
* property or if the root has pending changes.
*/
private boolean pendingChanges(@NotNull Tree groupTree) {
Tree.Status memberPropStatus = groupTree.getPropertyStatus(REP_MEMBERS);
// rep:members is new or has been modified or root has pending changes
return Tree.Status.UNCHANGED != memberPropStatus || root.hasPendingChanges();
}
代码示例来源:origin: org.apache.jackrabbit/oak-core
/**
* Determine if the group has (potentially) been modified in which case the
* query can't be used:
* - rep:members property has been modified
* - any potential modification in the member-ref-list subtree, which is not
* easy to detect => relying on pending changes on the root object
*
* @param groupTree The tree of the target group.
* @return {@code true} if the specified group tree has an unmodified rep:members
* property or if the root has pending changes.
*/
private boolean pendingChanges(@NotNull Tree groupTree) {
Tree.Status memberPropStatus = groupTree.getPropertyStatus(REP_MEMBERS);
// rep:members is new or has been modified or root has pending changes
return Tree.Status.UNCHANGED != memberPropStatus || root.hasPendingChanges();
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
/**
* Determine if the group has (potentially) been modified in which case the
* query can't be used:
* - rep:members property has been modified
* - any potential modification in the member-ref-list subtree, which is not
* easy to detect => relying on pending changes on the root object
*
* @param groupTree The tree of the target group.
* @return {@code true} if the specified group tree has an unmodified rep:members
* property or if the root has pending changes.
*/
private boolean pendingChanges(@Nonnull Tree groupTree) {
Tree.Status memberPropStatus = groupTree.getPropertyStatus(REP_MEMBERS);
// rep:members is new or has been modified or root has pending changes
return Tree.Status.UNCHANGED != memberPropStatus || root.hasPendingChanges();
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void testGetPropertyStatus() {
Tree a = root.getTree("/a");
for (String propName : hiddenProps) {
assertNull(a.getPropertyStatus(propName));
}
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void testGetPropertyStatus() {
Tree a = root.getTree("/a");
assertNull(a.getPropertyStatus(TreeConstants.OAK_CHILD_ORDER));
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void propertyStatus() throws CommitFailedException {
Tree tree = root.getTree("/");
tree.setProperty("new", "value1");
assertEquals(Tree.Status.NEW, tree.getPropertyStatus("new"));
root.commit();
assertEquals(Tree.Status.UNCHANGED, tree.getPropertyStatus("new"));
tree.setProperty("new", "value2");
assertEquals(Tree.Status.MODIFIED, tree.getPropertyStatus("new"));
root.commit();
assertEquals(Tree.Status.UNCHANGED, tree.getPropertyStatus("new"));
tree.removeProperty("new");
assertNull(tree.getPropertyStatus("new"));
root.commit();
assertNull(tree.getPropertyStatus("new"));
Tree x = root.getTree("/x");
x.setProperty("y", "value1");
x.remove();
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void testDisconnectAfterRefresh() {
Tree x = root.getTree("/x");
x.setProperty("p", "any");
Tree xx = x.addChild("xx");
xx.setProperty("q", "any");
assertEquals(Status.MODIFIED, x.getStatus());
assertEquals(Status.NEW, x.getPropertyStatus("p"));
assertEquals(Status.NEW, xx.getStatus());
assertEquals(Status.NEW, xx.getPropertyStatus("q"));
root.refresh();
assertEquals(Status.UNCHANGED, x.getStatus());
assertNull(x.getPropertyStatus("p"));
assertFalse(xx.exists());
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void testGetPropertyStatus() throws Exception {
setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_NODES);
testRoot.refresh();
Tree a = testRoot.getTree("/a");
assertFalse(a.exists());
PropertyState p = a.getProperty(JcrConstants.JCR_PRIMARYTYPE);
assertNotNull(p);
assertEquals(Tree.Status.UNCHANGED, a.getPropertyStatus(JcrConstants.JCR_PRIMARYTYPE));
}
代码示例来源:origin: apache/jackrabbit-oak
@Test
public void testDisconnectAfterRemove() {
Tree x = root.getTree("/x");
x.setProperty("p", "any");
Tree xx = x.addChild("xx");
xx.setProperty("q", "any");
assertEquals(Status.MODIFIED, x.getStatus());
assertEquals(Status.NEW, x.getPropertyStatus("p"));
assertEquals(Status.NEW, xx.getStatus());
assertEquals(Status.NEW, xx.getPropertyStatus("q"));
root.getTree("/x").remove();
assertFalse(x.exists());
assertFalse(xx.exists());
}
内容来源于网络,如有侵权,请联系作者删除!