@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(@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(@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 hasNodeType(String name) throws RepositoryException { Tree types = getTypes(); return types != null && types.hasChild(getOakName(name)); }
@Override public boolean hasNodeType(String name) throws RepositoryException { Tree types = getTypes(); return types != null && types.hasChild(getOakName(name)); }
@Override public boolean hasNodeType(String name) throws RepositoryException { Tree types = getTypes(); return types != null && types.hasChild(getOakName(name)); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); Tree types = getTypes(); if (types != null) { NamePathMapper mapper = getNamePathMapper(); for (Tree type : types.getChildren()) { list.add(new NodeTypeImpl(type, mapper)); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); Tree types = getTypes(); if (types != null) { NamePathMapper mapper = getNamePathMapper(); for (Tree type : types.getChildren()) { list.add(new NodeTypeImpl(type, mapper)); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); Tree types = getTypes(); if (types != null) { NamePathMapper mapper = getNamePathMapper(); for (Tree type : types.getChildren()) { list.add(new NodeTypeImpl(type, mapper)); } } return new NodeTypeIteratorAdapter(list); }
NodeTypeImpl internalGetNodeType(String oakName) throws NoSuchNodeTypeException { Tree types = getTypes(); if (types != null) { Tree type = types.getChild(oakName); if (type.exists()) { return new NodeTypeImpl(type, getNamePathMapper()); } } throw new NoSuchNodeTypeException(getNamePathMapper().getJcrName(oakName)); }
@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; }
NodeTypeImpl internalGetNodeType(String oakName) throws NoSuchNodeTypeException { Tree types = getTypes(); if (types != null) { Tree type = types.getChild(oakName); if (type.exists()) { return new NodeTypeImpl(type, getNamePathMapper()); } } throw new NoSuchNodeTypeException(getNamePathMapper().getJcrName(oakName)); }
NodeTypeImpl internalGetNodeType(String oakName) throws NoSuchNodeTypeException { Tree types = getTypes(); if (types != null) { Tree type = types.getChild(oakName); if (type.exists()) { return new NodeTypeImpl(type, getNamePathMapper()); } } throw new NoSuchNodeTypeException(getNamePathMapper().getJcrName(oakName)); }
@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; }