@Test public void testDefinesAuthorizableProperty() { for (String propName : new String[] {REP_AUTHORIZABLE_ID, REP_PRINCIPAL_NAME}) { PropertyState property = PropertyStates.createProperty(propName, "value"); assertTrue(ctx.definesProperty(mockTree("nodeName", NT_REP_USER), property)); assertTrue(ctx.definesProperty(mockTree("nodeName", NT_REP_SYSTEM_USER), property)); assertTrue(ctx.definesProperty(mockTree("nodeName", NT_REP_GROUP), property)); } }
@Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { String propName = property.getName(); String ntName = TreeUtil.getPrimaryTypeName(parent); if (NT_REP_USER.equals(ntName) || NT_REP_SYSTEM_USER.equals(ntName)) { return USER_PROPERTY_NAMES.contains(propName); } else if (NT_REP_GROUP.equals(ntName)) { return GROUP_PROPERTY_NAMES.contains(propName); } else if (NT_REP_PASSWORD.equals(ntName)) { return PWD_PROPERTY_NAMES.contains(propName); } else if (NT_REP_MEMBER_REFERENCES.equals(ntName)) { return REP_MEMBERS.equals(propName); } else return NT_REP_MEMBERS.equals(ntName); }
UserContext implements Context, UserConstants { @Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { String propName = property.getName(); String ntName = TreeUtil.getPrimaryTypeName(parent); if (NT_REP_USER.equals(ntName) || NT_REP_SYSTEM_USER.equals(ntName)) { return USER_PROPERTY_NAMES.contains(propName); } else if (NT_REP_GROUP.equals(ntName)) { return GROUP_PROPERTY_NAMES.contains(propName); } else if (NT_REP_PASSWORD.equals(ntName)) { return PWD_PROPERTY_NAMES.contains(propName); } else if (NT_REP_MEMBER_REFERENCES.equals(ntName)) { return REP_MEMBERS.equals(propName); } else return NT_REP_MEMBERS.equals(ntName); } }
UserContext implements Context, UserConstants { @Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { String propName = property.getName(); String ntName = TreeUtil.getPrimaryTypeName(parent); if (NT_REP_USER.equals(ntName) || NT_REP_SYSTEM_USER.equals(ntName)) { return USER_PROPERTY_NAMES.contains(propName); } else if (NT_REP_GROUP.equals(ntName)) { return GROUP_PROPERTY_NAMES.contains(propName); } else if (NT_REP_PASSWORD.equals(ntName)) { return PWD_PROPERTY_NAMES.contains(propName); } else if (NT_REP_MEMBER_REFERENCES.equals(ntName)) { return REP_MEMBERS.equals(propName); } else return NT_REP_MEMBERS.equals(ntName); } private  UserContext(); }
UserContext implements Context, UserConstants { @Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { String propName = property.getName(); String ntName = TreeUtil.getPrimaryTypeName(parent); if (NT_REP_USER.equals(ntName) || NT_REP_SYSTEM_USER.equals(ntName)) { return USER_PROPERTY_NAMES.contains(propName); } else if (NT_REP_GROUP.equals(ntName)) { return GROUP_PROPERTY_NAMES.contains(propName); } else if (NT_REP_PASSWORD.equals(ntName)) { return PWD_PROPERTY_NAMES.contains(propName); } else if (NT_REP_MEMBER_REFERENCES.equals(ntName)) { return REP_MEMBERS.equals(propName); } else return NT_REP_MEMBERS.equals(ntName); } private  UserContext(); @Override boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property); @Override boolean definesContextRoot(@NotNull Tree tree); @Override boolean definesTree(@NotNull Tree tree); @Override boolean definesLocation(@NotNull TreeLocation location); @Override boolean definesInternal(@NotNull Tree tree); }
UserContext implements Context, UserConstants { @Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { String propName = property.getName(); String ntName = TreeUtil.getPrimaryTypeName(parent); if (NT_REP_USER.equals(ntName) || NT_REP_SYSTEM_USER.equals(ntName)) { return USER_PROPERTY_NAMES.contains(propName); } else if (NT_REP_GROUP.equals(ntName)) { return GROUP_PROPERTY_NAMES.contains(propName); } else if (NT_REP_PASSWORD.equals(ntName)) { return PWD_PROPERTY_NAMES.contains(propName); } else if (NT_REP_MEMBER_REFERENCES.equals(ntName)) { return REP_MEMBERS.equals(propName); } else return NT_REP_MEMBERS.equals(ntName); } private  UserContext(); @Override boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property); @Override boolean definesContextRoot(@NotNull Tree tree); @Override boolean definesTree(@NotNull Tree tree); @Override boolean definesLocation(@NotNull TreeLocation location); @Override boolean definesInternal(@NotNull Tree tree);  }