@Override public boolean isNodeType(@Nullable String primaryTypeName, @NotNull Iterator<String> mixinTypes, @NotNull String nodeTypeName) throws NoSuchNodeTypeException, RepositoryException { // shortcut if (JcrConstants.NT_BASE.equals(nodeTypeName)) { return true; } Tree types = getTypes(); if (primaryTypeName != null && isa(types, primaryTypeName, nodeTypeName)) { return true; } while (mixinTypes.hasNext()) { if (isa(types, mixinTypes.next(), nodeTypeName)) { return true; } } return false; }
@Override public boolean isNodeType(String typeName, String superName) { return isa(getTypes(), typeName, superName); }
@Override public boolean isNodeType(String typeName, String superName) { return isa(getTypes(), typeName, superName); }
@Override public boolean isNodeType(String typeName, String superName) { return isa(getTypes(), typeName, superName); }
@Override public boolean isNodeType(@CheckForNull String primaryTypeName, @Nonnull Iterator<String> mixinTypes, @Nonnull String nodeTypeName) throws NoSuchNodeTypeException, RepositoryException { // shortcut if (JcrConstants.NT_BASE.equals(nodeTypeName)) { return true; } Tree types = getTypes(); if (primaryTypeName != null && isa(types, primaryTypeName, nodeTypeName)) { return true; } while (mixinTypes.hasNext()) { if (isa(types, mixinTypes.next(), nodeTypeName)) { return true; } } return false; }
@Override public boolean isNodeType(@Nullable String primaryTypeName, @NotNull Iterator<String> mixinTypes, @NotNull String nodeTypeName) throws NoSuchNodeTypeException, RepositoryException { // shortcut if (JcrConstants.NT_BASE.equals(nodeTypeName)) { return true; } Tree types = getTypes(); if (primaryTypeName != null && isa(types, primaryTypeName, nodeTypeName)) { return true; } while (mixinTypes.hasNext()) { if (isa(types, mixinTypes.next(), nodeTypeName)) { return true; } } return false; }
@Override public boolean isNodeType(Tree tree, String oakNtName) { // shortcuts for common cases if (JcrConstants.NT_BASE.equals(oakNtName)) { return true; } else if (JcrConstants.MIX_REFERENCEABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_UUID)) { return false; } else if (JcrConstants.MIX_VERSIONABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_ISCHECKEDOUT)) { return false; } Tree types = getTypes(); PropertyState primary = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE); if (primary != null && primary.getType() == Type.NAME) { String name = primary.getValue(Type.NAME); if (isa(types, name, oakNtName)) { return true; } } PropertyState mixins = tree.getProperty(JcrConstants.JCR_MIXINTYPES); if (mixins != null && mixins.getType() == Type.NAMES) { for (String name : mixins.getValue(Type.NAMES)) { if (isa(types, name, oakNtName)) { return true; } } } return false; }
@Override public boolean isNodeType(Tree tree, String oakNtName) { // shortcuts for common cases if (JcrConstants.NT_BASE.equals(oakNtName)) { return true; } else if (JcrConstants.MIX_REFERENCEABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_UUID)) { return false; } else if (JcrConstants.MIX_VERSIONABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_ISCHECKEDOUT)) { return false; } Tree types = getTypes(); PropertyState primary = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE); if (primary != null && primary.getType() == Type.NAME) { String name = primary.getValue(Type.NAME); if (isa(types, name, oakNtName)) { return true; } } PropertyState mixins = tree.getProperty(JcrConstants.JCR_MIXINTYPES); if (mixins != null && mixins.getType() == Type.NAMES) { for (String name : mixins.getValue(Type.NAMES)) { if (isa(types, name, oakNtName)) { return true; } } } return false; }
@Override public boolean isNodeType(Tree tree, String oakNtName) { // shortcuts for common cases if (JcrConstants.NT_BASE.equals(oakNtName)) { return true; } else if (JcrConstants.MIX_REFERENCEABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_UUID)) { return false; } else if (JcrConstants.MIX_VERSIONABLE.equals(oakNtName) && !tree.hasProperty(JcrConstants.JCR_ISCHECKEDOUT)) { return false; } Tree types = getTypes(); PropertyState primary = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE); if (primary != null && primary.getType() == Type.NAME) { String name = primary.getValue(Type.NAME); if (isa(types, name, oakNtName)) { return true; } } PropertyState mixins = tree.getProperty(JcrConstants.JCR_MIXINTYPES); if (mixins != null && mixins.getType() == Type.NAMES) { for (String name : mixins.getValue(Type.NAMES)) { if (isa(types, name, oakNtName)) { return true; } } } return false; }