/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.jackrabbit.spi;

import org.apache.jackrabbit.name.QName;

import java.util.Collection;

/**
 * <code>QNodeTypeDefinition</code>...
 */
public interface QNodeTypeDefinition {

    /**
     * Returns the name of the node type being defined or
     * <code>null</code> if not set.
     *
     * @return the name of the node type or <code>null</code> if not set.
     */
    QName getQName();

    /**
     * Returns an array containing the names of the supertypes or
     * <code>null</code> if not set.
     *
     * @return an array listing the names of the supertypes or
     *         <code>null</code> if not set.
     */
    QName[] getSupertypes();

    /**
     * Returns the value of the mixin flag.
     *
     * @return true if this is a mixin node type; false otherwise.
     */
    boolean isMixin();

    /**
     * Returns the value of the orderableChildNodes flag.
     *
     * @return true if nodes of this node type can have orderable child nodes; false otherwise.
     */
    boolean hasOrderableChildNodes();

    /**
     * Returns the name of the primary item (one of the child items of the
     * node's of this node type) or <code>null</code> if not set.
     *
     * @return the name of the primary item or <code>null</code> if not set.
     */
    QName getPrimaryItemName();

    /**
     * Returns an array containing the property definitions or
     * <code>null</code> if not set.
     *
     * @return an array containing the property definitions or
     *         <code>null</code> if not set.
     */
    QPropertyDefinition[] getPropertyDefs();

    /**
     * Returns an array containing the child node definitions or
     * <code>null</code> if not set.
     *
     * @return an array containing the child node definitions or
     *         <code>null</code> if not set.
     */
    QNodeDefinition[] getChildNodeDefs();

    /**
     * Returns a collection of node type <code>QName</code>s that are being
     * referenced by <i>this</i> node type definition (e.g. as supertypes, as
     * required/default primary types in child node definitions, as REFERENCE
     * value constraints in property definitions).
     * <p/>
     * Note that self-references (e.g. a child node definition that specifies
     * the declaring node type as the default primary type) are not considered
     * dependencies.
     *
     * @return a collection of node type <code>QName</code>s
     */
    Collection getDependencies();
}

@@ -1276,34 +1276,133 @@
 pertypes
- or%0A     *
+. If no%0A     * supertypes have been specified, then an empty array is returned%0A     * for mixin types and the
  %3Ccode%3En
 ull%3C/cod
@@ -1389,35 +1389,38 @@
  the %3Ccode%3En
-ull
+t:base
 %3C/code%3E 
 if not set.%0A
@@ -1407,34 +1407,116 @@
 %3C/code%3E 
-if not set
+primary type and%0A     * an array containing just %3Ccode%3Ent:base%3Ccode%3E for other primary types
 .%0A     *
 %0A     * 
@@ -1503,32 +1503,36 @@
 ypes.%0A     *
+ %3Cp%3E
 %0A     * 
 @return an a
@@ -1523,108 +1523,117 @@
   * 
-@
+The 
 return
- an
+ed
  array 
-listing the names of the supertypes or
+must not be modified by the application.
 %0A     *
+%0A
      
-    %3Ccode%3Enull%3C/code%3E if not set.
+* @return an array of supertype names
 %0A   

work in progress