/** * Returns the internal name for the specified JCR name. * * @param jcrName JCR node type name. * @return the internal representation of the given JCR name. * @throws javax.jcr.RepositoryException If there is no valid internal representation * of the specified JCR name. */ @NotNull protected final String getOakName(String jcrName) throws RepositoryException { return getNamePathMapper().getOakName(jcrName); }
/** * Returns the internal name for the specified JCR name. * * @param jcrName JCR node type name. * @return the internal representation of the given JCR name. * @throws javax.jcr.RepositoryException If there is no valid internal representation * of the specified JCR name. */ @NotNull protected final String getOakName(String jcrName) throws RepositoryException { return getNamePathMapper().getOakName(jcrName); }
/** * Returns the internal name for the specified JCR name. * * @param jcrName JCR node type name. * @return the internal representation of the given JCR name. * @throws javax.jcr.RepositoryException If there is no valid internal representation * of the specified JCR name. */ @Nonnull protected final String getOakName(String jcrName) throws RepositoryException { return getNamePathMapper().getOakName(jcrName); }
@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); }
EffectiveNodeTypeImpl( NodeTypeImpl primary, NodeTypeImpl[] mixins, ReadOnlyNodeTypeManager ntMgr) { this.ntMgr = ntMgr; this.valueFactory = new PartialValueFactory(ntMgr.getNamePathMapper()); addNodeType(checkNotNull(primary)); for (NodeTypeImpl mixin : checkNotNull(mixins)) { addNodeType(mixin); } if (!nodeTypes.containsKey(NT_BASE)) { try { nodeTypes.put( NT_BASE, (NodeTypeImpl) ntMgr.getNodeType(NT_BASE)); // FIXME } catch (RepositoryException e) { // TODO: ignore/warning/error? } } }
EffectiveNodeTypeImpl( NodeTypeImpl primary, NodeTypeImpl[] mixins, ReadOnlyNodeTypeManager ntMgr) { this.ntMgr = ntMgr; this.valueFactory = new PartialValueFactory(ntMgr.getNamePathMapper()); addNodeType(checkNotNull(primary)); for (NodeTypeImpl mixin : checkNotNull(mixins)) { addNodeType(mixin); } if (!nodeTypes.containsKey(NT_BASE)) { try { nodeTypes.put( NT_BASE, (NodeTypeImpl) ntMgr.getNodeType(NT_BASE)); // FIXME } catch (RepositoryException e) { // TODO: ignore/warning/error? } } }
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)); }
@Override public void checkSetProperty(PropertyState property) throws RepositoryException { PropertyDefinition definition = getDefinition(property); if (definition.isProtected()) { return; } NodeType nt = definition.getDeclaringNodeType(); if (definition.isMultiple()) { List<Value> values = ValueFactoryImpl.createValues(property, ntMgr.getNamePathMapper()); if (!nt.canSetProperty(property.getName(), values.toArray(new Value[values.size()]))) { throw new ConstraintViolationException("Cannot set property '" + property.getName() + "' to '" + values + '\''); } } else { Value v = ValueFactoryImpl.createValue(property, ntMgr.getNamePathMapper()); if (!nt.canSetProperty(property.getName(), v)) { throw new ConstraintViolationException("Cannot set property '" + property.getName() + "' to '" + v + '\''); } } }