/** * Get the node definition given the supplied identifier. * * @param definitionId the identifier of the node definition * @return the node definition, or null if there is no such definition (or if the ID was null) */ JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getChildNodeDefinition(definitionId); }
/** * Get the property definition given the supplied identifier. * * @param definitionId the identifier of the node definition * @return the property definition, or null if there is no such definition (or if the ID was null) */ JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getPropertyDefinition(definitionId); }
final JcrPropertyDefinition findPropertyDefinition( Name primaryTypeName, Collection<Name> mixinTypeNames, Name propertyName, Value value, boolean checkMultiValuedDefinitions, boolean skipProtected, boolean checkTypesAndConstraints ) { return nodeTypes().findPropertyDefinition(session, primaryTypeName, mixinTypeNames, propertyName, value, checkMultiValuedDefinitions, skipProtected, checkTypesAndConstraints); }
final JcrPropertyDefinition findPropertyDefinition( Name primaryTypeName, Collection<Name> mixinTypeNames, Name propertyName, Value[] values, boolean skipProtected, boolean checkTypeAndConstraints ) { return nodeTypes().findPropertyDefinition(session, primaryTypeName, mixinTypeNames, propertyName, values, skipProtected, checkTypeAndConstraints); }
final JcrPropertyDefinition findPropertyDefinition( Name primaryTypeName, Collection<Name> mixinTypeNames, Name propertyName, Value[] values, boolean skipProtected, boolean checkTypeAndConstraints ) { return nodeTypes().findPropertyDefinition(session, primaryTypeName, mixinTypeNames, propertyName, values, skipProtected, checkTypeAndConstraints); }
/** * Get the node definition given the supplied identifier. * * @param definitionId the identifier of the node definition * @return the node definition, or null if there is no such definition (or if the ID was null) */ JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getChildNodeDefinition(definitionId); }
/** * Get the property definition given the supplied identifier. * * @param definitionId the identifier of the node definition * @return the property definition, or null if there is no such definition (or if the ID was null) */ JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getPropertyDefinition(definitionId); }
final JcrPropertyDefinition findPropertyDefinition( Name primaryTypeName, Collection<Name> mixinTypeNames, Name propertyName, Value value, boolean checkMultiValuedDefinitions, boolean skipProtected, boolean checkTypesAndConstraints ) { return nodeTypes().findPropertyDefinition(session, primaryTypeName, mixinTypeNames, propertyName, value, checkMultiValuedDefinitions, skipProtected, checkTypesAndConstraints); }
private NodeTypes nodeTypes() { return session.nodeTypeManager().nodeTypes(); } }
private NodeTypes nodeTypes() { return session.nodeTypeManager().nodeTypes(); } }
@Override public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { session.checkLive(); Collection<JcrNodeType> rawTypes = nodeTypes().getMixinNodeTypes(); List<JcrNodeType> types = new ArrayList<JcrNodeType>(rawTypes.size()); // Need to return a version of the node type with the current context for (JcrNodeType type : rawTypes) { types.add(type.with(context(), session)); } return new JcrNodeTypeIterator(types); }
@Override public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { session.checkLive(); Collection<JcrNodeType> rawTypes = nodeTypes().getMixinNodeTypes(); List<JcrNodeType> types = new ArrayList<JcrNodeType>(rawTypes.size()); // Need to return a version of the node type with the current context for (JcrNodeType type : rawTypes) { types.add(type.with(context(), session)); } return new JcrNodeTypeIterator(types); }
@Override public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { session.checkLive(); Collection<JcrNodeType> rawTypes = nodeTypes().getPrimaryNodeTypes(); List<JcrNodeType> types = new ArrayList<JcrNodeType>(rawTypes.size()); // Need to return a version of the node type with the current context for (JcrNodeType type : rawTypes) { types.add(type.with(context(), session)); } return new JcrNodeTypeIterator(types); }
/** * Get the {@link NodeDefinition} for the root node. * * @return the definition; never null * @throws RepositoryException * @throws NoSuchNodeTypeException */ JcrNodeDefinition getRootNodeDefinition() throws NoSuchNodeTypeException, RepositoryException { NodeTypes nodeTypes = nodeTypes(); for (NodeDefinition definition : nodeTypes.getNodeType(ModeShapeLexicon.ROOT).getChildNodeDefinitions()) { if (definition.getName().equals(JcrNodeType.RESIDUAL_ITEM_NAME)) return (JcrNodeDefinition)definition; } assert false; // should not get here return null; }
@Override public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { session.checkLive(); Collection<JcrNodeType> rawTypes = nodeTypes().getPrimaryNodeTypes(); List<JcrNodeType> types = new ArrayList<JcrNodeType>(rawTypes.size()); // Need to return a version of the node type with the current context for (JcrNodeType type : rawTypes) { types.add(type.with(context(), session)); } return new JcrNodeTypeIterator(types); }
/** * Returns the node type with the given name (if one exists) * * @param nodeTypeName the name of the node type to be returned * @return the node type with the given name (if one exists) * @see NodeTypes#getNodeType(Name) */ JcrNodeType getNodeType( Name nodeTypeName ) { JcrNodeType nodeType = nodeTypes().getNodeType(nodeTypeName); if (nodeType != null) { nodeType = nodeType.with(context(), session); } return nodeType; }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { session.checkLive(); return new JcrNodeTypeIterator(nodeTypes().getAllNodeTypes()); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { session.checkLive(); return new JcrNodeTypeIterator(nodeTypes().getAllNodeTypes()); }
@Override public JcrNodeType getNodeType( String nodeTypeName ) throws NoSuchNodeTypeException, RepositoryException { session.checkLive(); Name ntName = context().getValueFactories().getNameFactory().create(nodeTypeName); JcrNodeType type = nodeTypes().getNodeType(ntName); if (type != null) { type = type.with(context(), session); return type; } throw new NoSuchNodeTypeException(JcrI18n.typeNotFound.text(nodeTypeName)); }
@Override public JcrNodeType getNodeType( String nodeTypeName ) throws NoSuchNodeTypeException, RepositoryException { session.checkLive(); Name ntName = context().getValueFactories().getNameFactory().create(nodeTypeName); JcrNodeType type = nodeTypes().getNodeType(ntName); if (type != null) { type = type.with(context(), session); return type; } throw new NoSuchNodeTypeException(JcrI18n.typeNotFound.text(nodeTypeName)); }