private void addSubtypes( String typeName, Map<String, NodeType> subtypes, Tree root, Map<String, Set<String>> inheritance) { Set<String> subnames = inheritance.get(typeName); if (subnames != null) { for (String subname : subnames) { if (!subtypes.containsKey(subname)) { Tree tree = root.getChild(subname); subtypes.put(subname, new NodeTypeImpl(tree, mapper)); } } } }
private void addSubtypes( String typeName, Map<String, NodeType> subtypes, Tree root, Map<String, Set<String>> inheritance) { Set<String> subnames = inheritance.get(typeName); if (subnames != null) { for (String subname : subnames) { if (!subtypes.containsKey(subname)) { Tree tree = root.getChild(subname); subtypes.put(subname, new NodeTypeImpl(tree, mapper)); } } } }
private void addSubtypes( String typeName, Map<String, NodeType> subtypes, Tree root, Map<String, Set<String>> inheritance) { Set<String> subnames = inheritance.get(typeName); if (subnames != null) { for (String subname : subnames) { if (!subtypes.containsKey(subname)) { Tree tree = root.getChild(subname); subtypes.put(subname, new NodeTypeImpl(tree, mapper)); } } } }
@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); }
private void addSupertypes(Tree type, Map<String, NodeType> supertypes) { PropertyState property = type.getProperty(JCR_SUPERTYPES); if (property != null) { Tree root = definition.getParent(); for (String oakName : property.getValue(Type.NAMES)) { if (!supertypes.containsKey(oakName)) { Tree supertype = root.getChild(oakName); checkState(supertype.exists()); supertypes.put( oakName, new NodeTypeImpl(supertype, mapper)); addSupertypes(supertype, supertypes); } } } }
@Override public NodeType[] getDeclaredSupertypes() { NodeType[] supertypes = NO_NODE_TYPES; String[] oakNames = getNames(JCR_SUPERTYPES); if (oakNames != null && oakNames.length > 0) { supertypes = new NodeType[oakNames.length]; Tree root = definition.getParent(); for (int i = 0; i < oakNames.length; i++) { Tree type = root.getChild(oakNames[i]); checkState(type.exists()); supertypes[i] = new NodeTypeImpl(type, mapper); } } return supertypes; }
@Override public NodeType[] getDeclaredSupertypes() { NodeType[] supertypes = NO_NODE_TYPES; String[] oakNames = getNames(JCR_SUPERTYPES); if (oakNames != null && oakNames.length > 0) { supertypes = new NodeType[oakNames.length]; Tree root = definition.getParent(); for (int i = 0; i < oakNames.length; i++) { Tree type = root.getChild(oakNames[i]); checkState(type.exists()); supertypes[i] = new NodeTypeImpl(type, mapper); } } return supertypes; }
private void addSupertypes(Tree type, Map<String, NodeType> supertypes) { PropertyState property = type.getProperty(JCR_SUPERTYPES); if (property != null) { Tree root = definition.getParent(); for (String oakName : property.getValue(Type.NAMES)) { if (!supertypes.containsKey(oakName)) { Tree supertype = root.getChild(oakName); checkState(supertype.exists()); supertypes.put( oakName, new NodeTypeImpl(supertype, mapper)); addSupertypes(supertype, supertypes); } } } }
private void addSupertypes(Tree type, Map<String, NodeType> supertypes) { PropertyState property = type.getProperty(JCR_SUPERTYPES); if (property != null) { Tree root = definition.getParent(); for (String oakName : property.getValue(Type.NAMES)) { if (!supertypes.containsKey(oakName)) { Tree supertype = root.getChild(oakName); checkState(supertype.exists()); supertypes.put( oakName, new NodeTypeImpl(supertype, mapper)); addSupertypes(supertype, supertypes); } } } }
@Override public NodeType[] getDeclaredSupertypes() { NodeType[] supertypes = NO_NODE_TYPES; String[] oakNames = getNames(JCR_SUPERTYPES); if (oakNames != null && oakNames.length > 0) { supertypes = new NodeType[oakNames.length]; Tree root = definition.getParent(); for (int i = 0; i < oakNames.length; i++) { Tree type = root.getChild(oakNames[i]); checkState(type.exists()); supertypes[i] = new NodeTypeImpl(type, mapper); } } return supertypes; }
@Override public NodeTypeIterator getDeclaredSubtypes() { List<NodeType> subtypes = Lists.newArrayList(); String oakName = getOakName(); Tree root = definition.getParent(); for (Tree child : root.getChildren()) { PropertyState supertypes = child.getProperty(JCR_SUPERTYPES); if (supertypes != null) { for (String name : supertypes.getValue(Type.NAMES)) { if (oakName.equals(name)) { subtypes.add(new NodeTypeImpl(child, mapper)); break; } } } } return new NodeTypeIteratorAdapter(subtypes); }
@Override public NodeType getDefaultPrimaryType() { String oakName = getName(JcrConstants.JCR_DEFAULTPRIMARYTYPE); if (oakName != null) { Tree types = definition.getParent(); while (!JCR_NODE_TYPES.equals(types.getName())) { types = types.getParent(); } Tree type = types.getChild(oakName); checkState(type.exists()); return new NodeTypeImpl(type, mapper); } else { return null; } }
@Override public NodeType getDefaultPrimaryType() { String oakName = getName(JcrConstants.JCR_DEFAULTPRIMARYTYPE); if (oakName != null) { Tree types = definition.getParent(); while (!JCR_NODE_TYPES.equals(types.getName())) { types = types.getParent(); } Tree type = types.getChild(oakName); checkState(type.exists()); return new NodeTypeImpl(type, mapper); } else { return null; } }
@Override public NodeType getDefaultPrimaryType() { String oakName = getName(JcrConstants.JCR_DEFAULTPRIMARYTYPE); if (oakName != null) { Tree types = definition.getParent(); while (!JCR_NODE_TYPES.equals(types.getName())) { types = types.getParent(); } Tree type = types.getChild(oakName); checkState(type.exists()); return new NodeTypeImpl(type, mapper); } else { return null; } }
@Override public NodeType[] getRequiredPrimaryTypes() { String[] oakNames = getNames(JcrConstants.JCR_REQUIREDPRIMARYTYPES); if (oakNames == null) { oakNames = new String[] { JcrConstants.NT_BASE }; } NodeType[] types = new NodeType[oakNames.length]; Tree root = definition.getParent(); while (!JCR_NODE_TYPES.equals(root.getName())) { root = root.getParent(); } for (int i = 0; i < oakNames.length; i++) { Tree type = root.getChild(oakNames[i]); checkState(type.exists()); types[i] = new NodeTypeImpl(type, mapper); } return types; }
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)); }
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)); }