@Nonnull @Override public NodeDefinition getDefinition( @Nonnull Tree parent, @Nonnull Tree targetNode) throws RepositoryException { checkNotNull(parent); checkNotNull(targetNode); String name = dropIndexFromName(targetNode.getName()); EffectiveNodeType eff = getEffectiveNodeType(parent); return eff.getNodeDefinition(name, getEffectiveNodeType(targetNode)); }
@NotNull @Override public NodeDefinition getDefinition( @NotNull Tree parent, @NotNull Tree targetNode) throws RepositoryException { checkNotNull(parent); checkNotNull(targetNode); String name = dropIndexFromName(targetNode.getName()); EffectiveNodeType eff = getEffectiveNodeType(parent); return eff.getNodeDefinition(name, getEffectiveNodeType(targetNode)); }
@NotNull @Override public NodeDefinition getDefinition( @NotNull Tree parent, @NotNull Tree targetNode) throws RepositoryException { checkNotNull(parent); checkNotNull(targetNode); String name = dropIndexFromName(targetNode.getName()); EffectiveNodeType eff = getEffectiveNodeType(parent); return eff.getNodeDefinition(name, getEffectiveNodeType(targetNode)); }
/** * Finds the default node type for a child node with the given name. * * @param nameWithIndex child node name, possibly with an SNS index * @return default type, or {@code null} if not found */ @CheckForNull String getDefaultType(@Nonnull String nameWithIndex) { String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); for (NodeState type : types) { NodeState named = type .getChildNode(REP_NAMED_CHILD_NODE_DEFINITIONS) .getChildNode(name); NodeState residual = type .getChildNode(REP_RESIDUAL_CHILD_NODE_DEFINITIONS); for (ChildNodeEntry entry : concat( named.getChildNodeEntries(), residual.getChildNodeEntries())) { NodeState definition = entry.getNodeState(); String defaultType = definition.getName(JCR_DEFAULTPRIMARYTYPE); if (defaultType != null && snsMatch(sns, definition)) { return defaultType; } } } return null; }
/** * Finds the default node type for a child node with the given name. * * @param nameWithIndex child node name, possibly with an SNS index * @return default type, or {@code null} if not found */ @Nullable String getDefaultType(@NotNull String nameWithIndex) { String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); for (NodeState type : types) { NodeState named = type .getChildNode(REP_NAMED_CHILD_NODE_DEFINITIONS) .getChildNode(name); NodeState residual = type .getChildNode(REP_RESIDUAL_CHILD_NODE_DEFINITIONS); for (ChildNodeEntry entry : concat( named.getChildNodeEntries(), residual.getChildNodeEntries())) { NodeState definition = entry.getNodeState(); String defaultType = definition.getName(JCR_DEFAULTPRIMARYTYPE); if (defaultType != null && snsMatch(sns, definition)) { return defaultType; } } } return null; }
/** * Finds the default node type for a child node with the given name. * * @param nameWithIndex child node name, possibly with an SNS index * @return default type, or {@code null} if not found */ @Nullable String getDefaultType(@NotNull String nameWithIndex) { String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); for (NodeState type : types) { NodeState named = type .getChildNode(REP_NAMED_CHILD_NODE_DEFINITIONS) .getChildNode(name); NodeState residual = type .getChildNode(REP_RESIDUAL_CHILD_NODE_DEFINITIONS); for (ChildNodeEntry entry : concat( named.getChildNodeEntries(), residual.getChildNodeEntries())) { NodeState definition = entry.getNodeState(); String defaultType = definition.getName(JCR_DEFAULTPRIMARYTYPE); if (defaultType != null && snsMatch(sns, definition)) { return defaultType; } } } return null; }
String name = dropIndexFromName(childName); boolean sns = !name.equals(childName); List<Tree> types = getEffectiveType(parent, typeRoot);
String name = dropIndexFromName(childName); boolean sns = !name.equals(childName); List<Tree> types = getEffectiveType(parent, typeRoot);
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Set<String> typeNames = effective.getTypeNames();
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Set<String> typeNames = effective.getTypeNames();
String name = dropIndexFromName(nameWithIndex); boolean sns = !name.equals(nameWithIndex); Set<String> typeNames = effective.getTypeNames();