View Javadoc

1   /*
2    * ModeShape (http://www.modeshape.org)
3    * See the COPYRIGHT.txt file distributed with this work for information
4    * regarding copyright ownership.  Some portions may be licensed
5    * to Red Hat, Inc. under one or more contributor license agreements.
6    * See the AUTHORS.txt file in the distribution for a full listing of 
7    * individual contributors.
8    *
9    * ModeShape is free software. Unless otherwise indicated, all code in ModeShape
10   * is licensed to you under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation; either version 2.1 of
12   * the License, or (at your option) any later version.
13   * 
14   * ModeShape is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this software; if not, write to the Free
21   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
23   */
24  package org.modeshape.jcr.nodetype;
25  
26  import javax.jcr.nodetype.ConstraintViolationException;
27  import net.jcip.annotations.NotThreadSafe;
28  
29  /**
30   * A template that can be used to create new child node definitions, patterned after the approach in the proposed <a
31   * href="http://jcp.org/en/jsr/detail?id=283">JSR-283</a>. This interface extends the standard {@link NodeTypeDefinition}
32   * interface and adds setter methods for the various attributes.
33   * 
34   * @see javax.jcr.nodetype.NodeTypeTemplate#getNodeDefinitionTemplates()
35   */
36  @NotThreadSafe
37  public interface NodeDefinitionTemplate extends javax.jcr.nodetype.NodeDefinitionTemplate {
38  
39      /**
40       * Set the names of the primary types that must appear on the child(ren) described by this definition
41       * 
42       * @param requiredPrimaryTypes the names of the required primary types, or null or empty if there are no requirements for the
43       *        primary types of the children described by this definition
44       * @throws ConstraintViolationException if any of the <code>requiredPrimaryTypes</code> are not a syntactically valid JCR name
45       *         in either qualified or expanded form.
46       * @deprecated As of ModeShape 2.0, use {@link #setRequiredPrimaryTypeNames(String[])} instead
47       */
48      @Deprecated
49      public void setRequiredPrimaryTypes( String[] requiredPrimaryTypes ) throws ConstraintViolationException;
50  
51      /**
52       * Set the name of the primary type that should be used by default when creating children using this node definition.
53       * 
54       * @param defaultPrimaryType the name of the primary type that should be used by default, or null if there is none
55       * @throws ConstraintViolationException if <code>defaultPrimaryType</code> is not a syntactically valid JCR name in either
56       *         qualified or expanded form.
57       * @deprecated As of ModeShape 2.0, use {@link #setDefaultPrimaryTypeName(String)} instead
58       */
59      @Deprecated
60      public void setDefaultPrimaryType( String defaultPrimaryType ) throws ConstraintViolationException;
61  
62  }