jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r161260 [3/7] - in incubator/jackrabbit/trunk: ./ applications/test/ applications/test/repository/nodetypes/ contrib/orm-persistence/applications/test/ contrib/orm-persistence/applications/test/repository/nodetypes/ src/java/org/apache/jackrabbit/core/ src/java/org/apache/jackrabbit/core/lock/ src/java/org/apache/jackrabbit/core/nodetype/ src/java/org/apache/jackrabbit/core/nodetype/virtual/ src/java/org/apache/jackrabbit/core/nodetype/xml/ src/java/org/apache/jackrabbit/core/observation/ src/java/org/apache/jackrabbit/core/search/ src/java/org/apache/jackrabbit/core/search/lucene/ src/java/org/apache/jackrabbit/core/security/ src/java/org/apache/jackrabbit/core/util/ src/java/org/apache/jackrabbit/core/version/ src/java/org/apache/jackrabbit/core/virtual/ src/java/org/apache/jackrabbit/core/xml/ src/test/org/apache/jackrabbit/core/nodetype/xml/ src/test/org/apache/jackrabbit/core/observation/ src/test/org/apache/jackrabbit/core/search/ src/test/org/apache/jackrabbit/test/api/ src/test/org/apache/jackrabbit/test/api/lock/ src/test/org/apache/jackrabbit/test/api/nodetype/ src/test/org/apache/jackrabbit/test/api/nodetype/spec/ src/test/org/apache/jackrabbit/test/api/observation/ src/test/org/apache/jackrabbit/test/api/query/ src/test/org/apache/jackrabbit/test/api/version/
Date Thu, 14 Apr 2005 11:51:04 GMT
Copied: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java (from r161036, incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildItemDef.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java?view=diff&rev=161260&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildItemDef.java&r1=161036&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildItemDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java Thu Apr 14 04:50:38 2005
@@ -16,15 +16,15 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.QName;
 
 import javax.jcr.version.OnParentVersionAction;
 
 /**
  * An <code>ItemDef</code> ...
  */
-public abstract class ChildItemDef implements Cloneable {
+public abstract class ItemDef implements Cloneable {
 
     // '*' denoting residual child item definition
     public static final QName ANY_NAME =
@@ -32,7 +32,7 @@
 
     protected QName declaringNodeType = null;
     private QName name = ANY_NAME;
-    private boolean autoCreate = false;
+    private boolean autoCreated = false;
     private int onParentVersion = OnParentVersionAction.COPY;
     private boolean writeProtected = false;
     private boolean mandatory = false;
@@ -48,11 +48,11 @@
         if (this == obj) {
             return true;
         }
-        if (obj instanceof ChildItemDef) {
-            ChildItemDef other = (ChildItemDef) obj;
+        if (obj instanceof ItemDef) {
+            ItemDef other = (ItemDef) obj;
             return (declaringNodeType == null ? other.declaringNodeType == null : declaringNodeType.equals(other.declaringNodeType))
                     && (name == null ? other.name == null : name.equals(other.name))
-                    && autoCreate == other.autoCreate
+                    && autoCreated == other.autoCreated
                     && onParentVersion == other.onParentVersion
                     && writeProtected == other.writeProtected
                     && mandatory == other.mandatory;
@@ -74,8 +74,8 @@
         this.name = name;
     }
 
-    public void setAutoCreate(boolean autoCreate) {
-        this.autoCreate = autoCreate;
+    public void setAutoCreated(boolean autoCreated) {
+        this.autoCreated = autoCreated;
     }
 
     public void setOnParentVersion(int onParentVersion) {
@@ -98,8 +98,8 @@
         return name;
     }
 
-    public boolean isAutoCreate() {
-        return autoCreate;
+    public boolean isAutoCreated() {
+        return autoCreated;
     }
 
     public int getOnParentVersion() {

Copied: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java (from r161036, incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java?view=diff&rev=161260&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java&r1=161036&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java Thu Apr 14 04:50:38 2005
@@ -21,16 +21,16 @@
 import org.apache.jackrabbit.core.QName;
 import org.apache.log4j.Logger;
 
-import javax.jcr.nodetype.ItemDef;
+import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeType;
 
 /**
- * An <code>ItemDefImpl</code> ...
+ * An <code>ItemDefinitionImpl</code> ...
  */
-abstract class ItemDefImpl implements ItemDef {
+abstract class ItemDefinitionImpl implements ItemDefinition {
 
-    private static Logger log = Logger.getLogger(ItemDefImpl.class);
+    private static Logger log = Logger.getLogger(ItemDefinitionImpl.class);
 
     protected static final String ANY_NAME = "*";
 
@@ -38,7 +38,7 @@
     // namespace resolver used to translate qualified names to JCR names
     protected final NamespaceResolver nsResolver;
 
-    private final ChildItemDef itemDef;
+    private final ItemDef itemDef;
 
     /**
      * Package private constructor
@@ -47,7 +47,8 @@
      * @param ntMgr      node type manager
      * @param nsResolver namespace resolver
      */
-    ItemDefImpl(ChildItemDef itemDef, NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver) {
+    ItemDefinitionImpl(ItemDef itemDef, NodeTypeManagerImpl ntMgr,
+                       NamespaceResolver nsResolver) {
         this.itemDef = itemDef;
         this.ntMgr = ntMgr;
         this.nsResolver = nsResolver;
@@ -99,8 +100,8 @@
     /**
      * {@inheritDoc}
      */
-    public boolean isAutoCreate() {
-        return itemDef.isAutoCreate();
+    public boolean isAutoCreated() {
+        return itemDef.isAutoCreated();
     }
 
     /**

Copied: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDef.java (from r161036, incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildNodeDef.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDef.java?view=diff&rev=161260&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildNodeDef.java&r1=161036&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDef.java&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ChildNodeDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDef.java Thu Apr 14 04:50:38 2005
@@ -22,30 +22,30 @@
 import java.util.Arrays;
 
 /**
- * A <code>ChildNodeDef</code> ...
+ * A <code>NodeDef</code> ...
  */
-public class ChildNodeDef extends ChildItemDef {
+public class NodeDef extends ItemDef {
 
     private QName defaultPrimaryType = null;
     private QName[] requiredPrimaryTypes = new QName[]{Constants.NT_BASE};
-    private boolean allowSameNameSibs = false;
+    private boolean allowsSameNameSiblings = false;
 
     /**
      * Default constructor.
      */
-    public ChildNodeDef() {
+    public NodeDef() {
     }
 
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
         }
-        if (obj instanceof ChildNodeDef) {
-            ChildNodeDef other = (ChildNodeDef) obj;
+        if (obj instanceof NodeDef) {
+            NodeDef other = (NodeDef) obj;
             return super.equals(obj)
                     && Arrays.equals(requiredPrimaryTypes, other.requiredPrimaryTypes)
                     && (defaultPrimaryType == null ? other.defaultPrimaryType == null : defaultPrimaryType.equals(other.defaultPrimaryType))
-                    && allowSameNameSibs == other.allowSameNameSibs;
+                    && allowsSameNameSiblings == other.allowsSameNameSiblings;
         }
         return false;
     }
@@ -68,10 +68,10 @@
     }
 
     /**
-     * @param allowSameNameSibs
+     * @param allowsSameNameSiblings
      */
-    public void setAllowSameNameSibs(boolean allowSameNameSibs) {
-        this.allowSameNameSibs = allowSameNameSibs;
+    public void setAllowsSameNameSiblings(boolean allowsSameNameSiblings) {
+        this.allowsSameNameSiblings = allowsSameNameSiblings;
     }
 
     /**
@@ -91,8 +91,8 @@
     /**
      * @return
      */
-    public boolean allowSameNameSibs() {
-        return allowSameNameSibs;
+    public boolean allowsSameNameSiblings() {
+        return allowsSameNameSiblings;
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java Thu Apr 14 04:50:38 2005
@@ -22,7 +22,7 @@
 import java.util.TreeSet;
 
 /**
- * <code>NodeDefId</code> uniquely identifies a <code>ChildNodeDef</code> in the
+ * <code>NodeDefId</code> uniquely identifies a <code>NodeDef</code> in the
  * node type registry.
  */
 public class NodeDefId implements Serializable {
@@ -31,9 +31,9 @@
 
     private final int id;
 
-    public NodeDefId(ChildNodeDef def) {
+    public NodeDefId(NodeDef def) {
         if (def == null) {
-            throw new IllegalArgumentException("ChildNodeDef argument can not be null");
+            throw new IllegalArgumentException("NodeDef argument can not be null");
         }
         // build key (format: <declaringNodeType>/<name>/<requiredPrimaryTypes>)
         StringBuffer sb = new StringBuffer();

Copied: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java (from r161036, incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java?view=diff&rev=161260&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java&r1=161036&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java Thu Apr 14 04:50:38 2005
@@ -22,17 +22,18 @@
 import org.apache.log4j.Logger;
 
 import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 
 /**
- * A <code>NodeDefImpl</code> ...
+ * A <code>NodeDefinitionImpl</code> ...
  */
-public class NodeDefImpl extends ItemDefImpl implements NodeDef {
+public class NodeDefinitionImpl extends ItemDefinitionImpl
+        implements NodeDefinition {
 
-    private static Logger log = Logger.getLogger(NodeDefImpl.class);
+    private static Logger log = Logger.getLogger(NodeDefinitionImpl.class);
 
-    private final ChildNodeDef nodeDef;
+    private final NodeDef nodeDef;
 
 
     /**
@@ -42,12 +43,13 @@
      * @param ntMgr      node type manager
      * @param nsResolver namespace resolver
      */
-    NodeDefImpl(ChildNodeDef nodeDef, NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver) {
+    NodeDefinitionImpl(NodeDef nodeDef, NodeTypeManagerImpl ntMgr,
+                       NamespaceResolver nsResolver) {
         super(nodeDef, ntMgr, nsResolver);
         this.nodeDef = nodeDef;
     }
 
-    public ChildNodeDef unwrap() {
+    public NodeDef unwrap() {
         return nodeDef;
     }
 
@@ -95,8 +97,8 @@
     /**
      * {@inheritDoc}
      */
-    public boolean allowSameNameSibs() {
-        return nodeDef.allowSameNameSibs();
+    public boolean allowsSameNameSiblings() {
+        return nodeDef.allowsSameNameSiblings();
     }
 }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java Thu Apr 14 04:50:38 2005
@@ -35,7 +35,7 @@
     private boolean orderableChildNodes;
     private QName primaryItemName;
     private PropDef[] propDefs;
-    private ChildNodeDef[] nodeDefs;
+    private NodeDef[] nodeDefs;
     private Set dependencies;
 
     /**
@@ -44,7 +44,7 @@
     public NodeTypeDef() {
         dependencies = null;
         name = null;
-        nodeDefs = new ChildNodeDef[0];
+        nodeDefs = new NodeDef[0];
         propDefs = new PropDef[0];
         supertypes = new QName[0];
         mixin = false;
@@ -192,9 +192,9 @@
     /**
      * Sets the child node definitions.
      *
-     * @param defs An array of <code>ChildNodeDef</code> objects
+     * @param defs An array of <code>NodeDef</code> objects
      */
-    public void setChildNodeDefs(ChildNodeDef[] defs) {
+    public void setChildNodeDefs(NodeDef[] defs) {
         resetDependencies();
         nodeDefs = defs;
     }
@@ -266,7 +266,7 @@
      * @return an array containing the child node definitions or
      *         <code>null</code> if not set.
      */
-    public ChildNodeDef[] getChildNodeDefs() {
+    public NodeDef[] getChildNodeDefs() {
         return nodeDefs;
     }
 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java Thu Apr 14 04:50:38 2005
@@ -42,9 +42,9 @@
  * <li>changing property/child node <code>protected</code> flag
  * <li>changing property/child node <code>onParentVersion</code> value
  * <li>changing property/child node <code>mandatory</code> flag to <code>false</code>
- * <li>changing property/child node <code>autoCreate</code> flag
+ * <li>changing property/child node <code>autoCreated</code> flag
  * <li>changing child node <code>defaultPrimaryType</code>
- * <li>changing child node <code>sameNameSibs</code> flag to <code>true</code>
+ * <li>changing child node <code>sameNameSiblings</code> flag to <code>true</code>
  * <li>weaken property <code>valueConstraints</code> (e.g. by removing completely
  * or by adding to existing or by making a single constraint less restrictive)
  * <li>changing property <code>defaultValues</code>
@@ -293,13 +293,13 @@
          */
 
         int maxType = NONE;
-        ChildNodeDef[] cnda1 = oldDef.getChildNodeDefs();
+        NodeDef[] cnda1 = oldDef.getChildNodeDefs();
         HashMap defs1 = new HashMap();
         for (int i = 0; i < cnda1.length; i++) {
             defs1.put(new NodeDefId(cnda1[i]), cnda1[i]);
         }
 
-        ChildNodeDef[] cnda2 = newDef.getChildNodeDefs();
+        NodeDef[] cnda2 = newDef.getChildNodeDefs();
         HashMap defs2 = new HashMap();
         for (int i = 0; i < cnda1.length; i++) {
             defs2.put(new NodeDefId(cnda2[i]), cnda2[i]);
@@ -312,8 +312,8 @@
         Iterator iter = defs1.keySet().iterator();
         while (iter.hasNext()) {
             NodeDefId id = (NodeDefId) iter.next();
-            ChildNodeDef def1 = (ChildNodeDef) defs1.get(id);
-            ChildNodeDef def2 = (ChildNodeDef) defs2.get(id);
+            NodeDef def1 = (NodeDef) defs1.get(id);
+            NodeDef def2 = (NodeDef) defs2.get(id);
             ChildNodeDefDiff diff = new ChildNodeDefDiff(def1, def2);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -329,7 +329,7 @@
         iter = defs2.keySet().iterator();
         while (iter.hasNext()) {
             NodeDefId id = (NodeDefId) iter.next();
-            ChildNodeDef def = (ChildNodeDef) defs2.get(id);
+            NodeDef def = (NodeDef) defs2.get(id);
             ChildNodeDefDiff diff = new ChildNodeDefDiff(null, def);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -342,11 +342,11 @@
 
     //--------------------------------------------------------< inner classes >
     abstract class ChildItemDefDiff {
-        protected final ChildItemDef oldDef;
-        protected final ChildItemDef newDef;
+        protected final ItemDef oldDef;
+        protected final ItemDef newDef;
         protected int type;
 
-        ChildItemDefDiff(ChildItemDef oldDef, ChildItemDef newDef) {
+        ChildItemDefDiff(ItemDef oldDef, ItemDef newDef) {
             this.oldDef = oldDef;
             this.newDef = newDef;
             init();
@@ -494,16 +494,16 @@
 
     public class ChildNodeDefDiff extends ChildItemDefDiff {
 
-        ChildNodeDefDiff(ChildNodeDef oldDef, ChildNodeDef newDef) {
+        ChildNodeDefDiff(NodeDef oldDef, NodeDef newDef) {
             super(oldDef, newDef);
         }
 
-        public ChildNodeDef getOldDef() {
-            return (ChildNodeDef) oldDef;
+        public NodeDef getOldDef() {
+            return (NodeDef) oldDef;
         }
 
-        public ChildNodeDef getNewDef() {
-            return (ChildNodeDef) newDef;
+        public NodeDef getNewDef() {
+            return (NodeDef) newDef;
         }
 
         protected void init() {
@@ -516,10 +516,10 @@
              */
             if (isModified() && type != NONE && type != MAJOR) {
 
-                boolean b1 = getOldDef().allowSameNameSibs();
-                boolean b2 = getNewDef().allowSameNameSibs();
+                boolean b1 = getOldDef().allowsSameNameSiblings();
+                boolean b2 = getNewDef().allowsSameNameSiblings();
                 if (b1 != b1 && !b2) {
-                    // changed sameNameSibs flag to false (MAJOR change)
+                    // changed sameNameSiblings flag to false (MAJOR change)
                     type = MAJOR;
                 }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java Thu Apr 14 04:50:38 2005
@@ -30,9 +30,9 @@
 import javax.jcr.Value;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.PropertyDef;
+import javax.jcr.nodetype.PropertyDefinition;
 import java.util.ArrayList;
 import java.util.HashSet;
 
@@ -85,9 +85,9 @@
      * @throws RepositoryException if no applicable child node definition
      *                             could be found
      */
-    public NodeDefImpl getApplicableChildNodeDef(QName nodeName)
+    public NodeDefinitionImpl getApplicableChildNodeDefinition(QName nodeName)
             throws RepositoryException {
-        return getApplicableChildNodeDef(nodeName, null);
+        return getApplicableChildNodeDefinition(nodeName, null);
     }
 
     /**
@@ -100,9 +100,10 @@
      * @throws RepositoryException if no applicable child node definition
      *                             could be found
      */
-    public NodeDefImpl getApplicableChildNodeDef(QName nodeName, QName nodeTypeName)
+    public NodeDefinitionImpl getApplicableChildNodeDefinition(QName nodeName,
+                                                               QName nodeTypeName)
             throws RepositoryException {
-        return new NodeDefImpl(ent.getApplicableChildNodeDef(nodeName, nodeTypeName),
+        return new NodeDefinitionImpl(ent.getApplicableChildNodeDef(nodeName, nodeTypeName),
                 ntMgr, nsResolver);
     }
 
@@ -117,10 +118,12 @@
      * @throws RepositoryException if no applicable property definition
      *                             could be found
      */
-    public PropertyDefImpl getApplicablePropertyDef(QName propertyName, int type,
-                                                    boolean multiValued)
+    public PropertyDefinitionImpl getApplicablePropertyDefinition(QName propertyName,
+                                                                  int type,
+                                                                  boolean multiValued)
             throws RepositoryException {
-        return new PropertyDefImpl(ent.getApplicablePropertyDef(propertyName, type, multiValued),
+        return new PropertyDefinitionImpl(
+                ent.getApplicablePropertyDef(propertyName, type, multiValued),
                 ntMgr, nsResolver);
     }
 
@@ -155,17 +158,17 @@
     /**
      * Returns an array containing only those child node definitions of this
      * node type (including the child node definitions inherited from supertypes
-     * of this node type) where <code>{@link NodeDef#isAutoCreate()}</code>
+     * of this node type) where <code>{@link NodeDefinition#isAutoCreated()}</code>
      * returns <code>true</code>.
      *
      * @return an array of child node definitions.
-     * @see NodeDef#isAutoCreate
+     * @see NodeDefinition#isAutoCreated
      */
-    public NodeDef[] getAutoCreateNodeDefs() {
-        ChildNodeDef[] cnda = ent.getAutoCreateNodeDefs();
-        NodeDef[] nodeDefs = new NodeDef[cnda.length];
+    public NodeDefinition[] getAutoCreatedNodeDefinitions() {
+        NodeDef[] cnda = ent.getAutoCreateNodeDefs();
+        NodeDefinition[] nodeDefs = new NodeDefinition[cnda.length];
         for (int i = 0; i < cnda.length; i++) {
-            nodeDefs[i] = new NodeDefImpl(cnda[i], ntMgr, nsResolver);
+            nodeDefs[i] = new NodeDefinitionImpl(cnda[i], ntMgr, nsResolver);
         }
         return nodeDefs;
     }
@@ -173,17 +176,17 @@
     /**
      * Returns an array containing only those property definitions of this
      * node type (including the property definitions inherited from supertypes
-     * of this node type) where <code>{@link PropertyDef#isAutoCreate()}</code>
+     * of this node type) where <code>{@link PropertyDefinition#isAutoCreated()}</code>
      * returns <code>true</code>.
      *
      * @return an array of property definitions.
-     * @see PropertyDef#isAutoCreate
+     * @see PropertyDefinition#isAutoCreated
      */
-    public PropertyDef[] getAutoCreatePropertyDefs() {
+    public PropertyDefinition[] getAutoCreatedPropertyDefinitions() {
         PropDef[] pda = ent.getAutoCreatePropDefs();
-        PropertyDef[] propDefs = new PropertyDef[pda.length];
+        PropertyDefinition[] propDefs = new PropertyDefinition[pda.length];
         for (int i = 0; i < pda.length; i++) {
-            propDefs[i] = new PropertyDefImpl(pda[i], ntMgr, nsResolver);
+            propDefs[i] = new PropertyDefinitionImpl(pda[i], ntMgr, nsResolver);
         }
         return propDefs;
     }
@@ -191,17 +194,17 @@
     /**
      * Returns an array containing only those property definitions of this
      * node type (including the property definitions inherited from supertypes
-     * of this node type) where <code>{@link PropertyDef#isMandatory()}</code>
+     * of this node type) where <code>{@link PropertyDefinition#isMandatory()}</code>
      * returns <code>true</code>.
      *
      * @return an array of property definitions.
-     * @see PropertyDef#isMandatory
+     * @see PropertyDefinition#isMandatory
      */
-    public PropertyDef[] getMandatoryPropertyDefs() {
+    public PropertyDefinition[] getMandatoryPropertyDefinitions() {
         PropDef[] pda = ent.getMandatoryPropDefs();
-        PropertyDef[] propDefs = new PropertyDef[pda.length];
+        PropertyDefinition[] propDefs = new PropertyDefinition[pda.length];
         for (int i = 0; i < pda.length; i++) {
-            propDefs[i] = new PropertyDefImpl(pda[i], ntMgr, nsResolver);
+            propDefs[i] = new PropertyDefinitionImpl(pda[i], ntMgr, nsResolver);
         }
         return propDefs;
     }
@@ -209,17 +212,17 @@
     /**
      * Returns an array containing only those child node definitions of this
      * node type (including the child node definitions inherited from supertypes
-     * of this node type) where <code>{@link NodeDef#isMandatory()}</code>
+     * of this node type) where <code>{@link NodeDefinition#isMandatory()}</code>
      * returns <code>true</code>.
      *
      * @return an array of child node definitions.
-     * @see NodeDef#isMandatory
+     * @see NodeDefinition#isMandatory
      */
-    public NodeDef[] getMandatoryNodeDefs() {
-        ChildNodeDef[] cnda = ent.getMandatoryNodeDefs();
-        NodeDef[] nodeDefs = new NodeDef[cnda.length];
+    public NodeDefinition[] getMandatoryNodeDefinitions() {
+        NodeDef[] cnda = ent.getMandatoryNodeDefs();
+        NodeDefinition[] nodeDefs = new NodeDefinition[cnda.length];
         for (int i = 0; i < cnda.length; i++) {
-            nodeDefs[i] = new NodeDefImpl(cnda[i], ntMgr, nsResolver);
+            nodeDefs[i] = new NodeDefinitionImpl(cnda[i], ntMgr, nsResolver);
         }
         return nodeDefs;
     }
@@ -237,7 +240,7 @@
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    public static void checkSetPropertyValueConstraints(PropertyDefImpl def,
+    public static void checkSetPropertyValueConstraints(PropertyDefinitionImpl def,
                                                         InternalValue[] values)
             throws ConstraintViolationException, RepositoryException {
         EffectiveNodeType.checkSetPropertyValueConstraints(def.unwrap(), values);
@@ -370,11 +373,11 @@
     /**
      * {@inheritDoc}
      */
-    public NodeDef[] getChildNodeDefs() {
-        ChildNodeDef[] cnda = ent.getAllNodeDefs();
-        NodeDef[] nodeDefs = new NodeDef[cnda.length];
+    public NodeDefinition[] getChildNodeDefinitions() {
+        NodeDef[] cnda = ent.getAllNodeDefs();
+        NodeDefinition[] nodeDefs = new NodeDefinition[cnda.length];
         for (int i = 0; i < cnda.length; i++) {
-            nodeDefs[i] = new NodeDefImpl(cnda[i], ntMgr, nsResolver);
+            nodeDefs[i] = new NodeDefinitionImpl(cnda[i], ntMgr, nsResolver);
         }
         return nodeDefs;
     }
@@ -382,11 +385,11 @@
     /**
      * {@inheritDoc}
      */
-    public PropertyDef[] getPropertyDefs() {
+    public PropertyDefinition[] getPropertyDefinitions() {
         PropDef[] pda = ent.getAllPropDefs();
-        PropertyDef[] propDefs = new PropertyDef[pda.length];
+        PropertyDefinition[] propDefs = new PropertyDefinition[pda.length];
         for (int i = 0; i < pda.length; i++) {
-            propDefs[i] = new PropertyDefImpl(pda[i], ntMgr, nsResolver);
+            propDefs[i] = new PropertyDefinitionImpl(pda[i], ntMgr, nsResolver);
         }
         return propDefs;
     }
@@ -412,11 +415,11 @@
     /**
      * {@inheritDoc}
      */
-    public NodeDef[] getDeclaredChildNodeDefs() {
-        ChildNodeDef[] cnda = ntd.getChildNodeDefs();
-        NodeDef[] nodeDefs = new NodeDef[cnda.length];
+    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+        NodeDef[] cnda = ntd.getChildNodeDefs();
+        NodeDefinition[] nodeDefs = new NodeDefinition[cnda.length];
         for (int i = 0; i < cnda.length; i++) {
-            nodeDefs[i] = new NodeDefImpl(cnda[i], ntMgr, nsResolver);
+            nodeDefs[i] = new NodeDefinitionImpl(cnda[i], ntMgr, nsResolver);
         }
         return nodeDefs;
     }
@@ -431,13 +434,13 @@
         }
         try {
             QName name = QName.fromJCRName(propertyName, nsResolver);
-            PropertyDefImpl def;
+            PropertyDefinitionImpl def;
             try {
                 // try to get definition that matches the given value type
-                def = getApplicablePropertyDef(name, value.getType(), false);
+                def = getApplicablePropertyDefinition(name, value.getType(), false);
             } catch (ConstraintViolationException cve) {
                 // fallback: ignore type
-                def = getApplicablePropertyDef(name, PropertyType.UNDEFINED, false);
+                def = getApplicablePropertyDefinition(name, PropertyType.UNDEFINED, false);
             }
             if (def.isProtected()) {
                 return false;
@@ -492,13 +495,13 @@
                     return false;
                 }
             }
-            PropertyDefImpl def;
+            PropertyDefinitionImpl def;
             try {
                 // try to get definition that matches the given value type
-                def = getApplicablePropertyDef(name, type, true);
+                def = getApplicablePropertyDefinition(name, type, true);
             } catch (ConstraintViolationException cve) {
                 // fallback: ignore type
-                def = getApplicablePropertyDef(name, PropertyType.UNDEFINED, true);
+                def = getApplicablePropertyDefinition(name, PropertyType.UNDEFINED, true);
             }
 
             if (def.isProtected()) {
@@ -590,11 +593,11 @@
     /**
      * {@inheritDoc}
      */
-    public PropertyDef[] getDeclaredPropertyDefs() {
+    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
         PropDef[] pda = ntd.getPropertyDefs();
-        PropertyDef[] propDefs = new PropertyDef[pda.length];
+        PropertyDefinition[] propDefs = new PropertyDefinition[pda.length];
         for (int i = 0; i < pda.length; i++) {
-            propDefs[i] = new PropertyDefImpl(pda[i], ntMgr, nsResolver);
+            propDefs[i] = new PropertyDefinitionImpl(pda[i], ntMgr, nsResolver);
         }
         return propDefs;
     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java Thu Apr 14 04:50:38 2005
@@ -37,13 +37,14 @@
 /**
  * A <code>NodeTypeManagerImpl</code> ...
  */
-public class NodeTypeManagerImpl implements NodeTypeManager, NodeTypeRegistryListener {
+public class NodeTypeManagerImpl implements NodeTypeManager,
+        NodeTypeRegistryListener {
 
     private static Logger log = Logger.getLogger(NodeTypeManagerImpl.class);
 
     private final NodeTypeRegistry ntReg;
 
-    private final NodeDefImpl rootNodeDef;
+    private final NodeDefinitionImpl rootNodeDef;
 
     // namespace resolver used to translate qualified names to JCR names
     private final NamespaceResolver nsResolver;
@@ -64,13 +65,14 @@
         // setup item cache with soft references to node type instances
         ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
 
-        rootNodeDef = new RootNodeDefinition(ntReg.getRootNodeDef(), this, nsResolver);
+        rootNodeDef = new RootNodeDefinition(ntReg.getRootNodeDef(), this,
+                nsResolver);
     }
 
     /**
      * @return
      */
-    public NodeDefImpl getRootNodeDefinition() {
+    public NodeDefinitionImpl getRootNodeDefinition() {
         return rootNodeDef;
     }
 
@@ -78,24 +80,24 @@
      * @param id
      * @return
      */
-    public NodeDefImpl getNodeDef(NodeDefId id) {
-        ChildNodeDef cnd = ntReg.getNodeDef(id);
+    public NodeDefinitionImpl getNodeDefinition(NodeDefId id) {
+        NodeDef cnd = ntReg.getNodeDef(id);
         if (cnd == null) {
             return null;
         }
-        return new NodeDefImpl(cnd, this, nsResolver);
+        return new NodeDefinitionImpl(cnd, this, nsResolver);
     }
 
     /**
      * @param id
      * @return
      */
-    public PropertyDefImpl getPropDef(PropDefId id) {
+    public PropertyDefinitionImpl getPropertyDefinition(PropDefId id) {
         PropDef pd = ntReg.getPropDef(id);
         if (pd == null) {
             return null;
         }
-        return new PropertyDefImpl(pd, this, nsResolver);
+        return new PropertyDefinitionImpl(pd, this, nsResolver);
     }
 
     /**
@@ -103,7 +105,8 @@
      * @return
      * @throws NoSuchNodeTypeException
      */
-    public synchronized NodeTypeImpl getNodeType(QName name) throws NoSuchNodeTypeException {
+    public synchronized NodeTypeImpl getNodeType(QName name)
+            throws NoSuchNodeTypeException {
         NodeTypeImpl nt = (NodeTypeImpl) ntCache.get(name);
         if (nt != null) {
             return nt;
@@ -222,12 +225,13 @@
      * The <code>RootNodeDefinition</code> defines the characteristics of
      * the root node.
      */
-    private static class RootNodeDefinition extends NodeDefImpl {
+    private static class RootNodeDefinition extends NodeDefinitionImpl {
 
         /**
          * Creates a new <code>RootNodeDefinition</code>.
          */
-        RootNodeDefinition(ChildNodeDef def, NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver) {
+        RootNodeDefinition(NodeDef def, NodeTypeManagerImpl ntMgr,
+                           NamespaceResolver nsResolver) {
             super(def, ntMgr, nsResolver);
         }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Thu Apr 14 04:50:38 2005
@@ -77,7 +77,7 @@
     private final HashMap registeredNTDefs;
 
     // definition of the root node
-    private final ChildNodeDef rootNodeDef;
+    private final NodeDef rootNodeDef;
 
     // map of id's and property definitions
     private final HashMap propDefs;
@@ -132,14 +132,16 @@
             throws RepositoryException {
         this.nsReg = nsReg;
         this.ntStore = ntStore;
-        customNodeTypesResource = new FileSystemResource(this.ntStore, CUSTOM_NODETYPES_RESOURCE_NAME);
+        customNodeTypesResource =
+                new FileSystemResource(this.ntStore, CUSTOM_NODETYPES_RESOURCE_NAME);
         try {
             // make sure path to resource exists
             if (!customNodeTypesResource.exists()) {
                 customNodeTypesResource.makeParentDirs();
             }
         } catch (FileSystemException fse) {
-            String error = "internal error: invalid resource: " + customNodeTypesResource.getPath();
+            String error = "internal error: invalid resource: "
+                    + customNodeTypesResource.getPath();
             log.debug(error);
             throw new RepositoryException(error, fse);
         }
@@ -162,15 +164,20 @@
         builtInNTDefs = new NodeTypeDefStore();
         InputStream in = null;
         try {
-            in = getClass().getClassLoader().getResourceAsStream(BUILTIN_NODETYPES_RESOURCE_PATH);
+            in = getClass().getClassLoader().getResourceAsStream(
+                    BUILTIN_NODETYPES_RESOURCE_PATH);
             builtInNTDefs.load(in);
             internalRegister(builtInNTDefs.all());
         } catch (IOException ioe) {
-            String error = "internal error: failed to read built-in node type definitions stored in " + BUILTIN_NODETYPES_RESOURCE_PATH;
+            String error =
+                    "internal error: failed to read built-in node type definitions stored in "
+                    + BUILTIN_NODETYPES_RESOURCE_PATH;
             log.debug(error);
             throw new RepositoryException(error, ioe);
         } catch (InvalidNodeTypeDefException intde) {
-            String error = "internal error: invalid built-in node type definition stored in " + BUILTIN_NODETYPES_RESOURCE_PATH;
+            String error =
+                    "internal error: invalid built-in node type definition stored in "
+                    + BUILTIN_NODETYPES_RESOURCE_PATH;
             log.debug(error);
             throw new RepositoryException(error, intde);
         } finally {
@@ -195,7 +202,9 @@
                 in = customNodeTypesResource.getInputStream();
             }
         } catch (FileSystemException fse) {
-            String error = "internal error: failed to access custom node type definitions stored in " + customNodeTypesResource.getPath();
+            String error =
+                    "internal error: failed to access custom node type definitions stored in "
+                    + customNodeTypesResource.getPath();
             log.debug(error);
             throw new RepositoryException(error, fse);
         }
@@ -206,11 +215,15 @@
                 customNTDefs.load(in);
                 internalRegister(customNTDefs.all());
             } catch (IOException ioe) {
-                String error = "internal error: failed to read custom node type definitions stored in " + customNodeTypesResource.getPath();
+                String error =
+                        "internal error: failed to read custom node type definitions stored in "
+                        + customNodeTypesResource.getPath();
                 log.debug(error);
                 throw new RepositoryException(error, ioe);
             } catch (InvalidNodeTypeDefException intde) {
-                String error = "internal error: invalid custom node type definition stored in " + customNodeTypesResource.getPath();
+                String error =
+                        "internal error: invalid custom node type definition stored in "
+                        + customNodeTypesResource.getPath();
                 log.debug(error);
                 throw new RepositoryException(error, intde);
             } finally {
@@ -223,8 +236,8 @@
         }
     }
 
-    private static ChildNodeDef createRootNodeDef() {
-        ChildNodeDef def = new ChildNodeDef();
+    private static NodeDef createRootNodeDef() {
+        NodeDef def = new NodeDef();
 
         // FIXME need a fake declaring node type
         def.setDeclaringNodeType(new QName(NS_DEFAULT_URI, ""));
@@ -233,8 +246,8 @@
         def.setMandatory(true);
         def.setProtected(false);
         def.setOnParentVersion(OnParentVersionAction.VERSION);
-        def.setAllowSameNameSibs(false);
-        def.setAutoCreate(true);
+        def.setAllowsSameNameSiblings(false);
+        def.setAutoCreated(true);
         return def;
     }
 
@@ -319,9 +332,9 @@
             PropDefId id = new PropDefId(def);
             propDefs.put(id, def);
         }
-        ChildNodeDef[] nda = ntd.getChildNodeDefs();
+        NodeDef[] nda = ntd.getChildNodeDefs();
         for (int i = 0; i < nda.length; i++) {
-            ChildNodeDef def = nda[i];
+            NodeDef def = nda[i];
             NodeDefId id = new NodeDefId(def);
             nodeDefs.put(id, def);
         }
@@ -335,7 +348,8 @@
             throw new NoSuchNodeTypeException(name.toString());
         }
         if (builtInNTDefs.contains(name)) {
-            throw new RepositoryException(name.toString() + ": can't unregister built-in node type.");
+            throw new RepositoryException(name.toString()
+                    + ": can't unregister built-in node type.");
         }
 
         NodeTypeDef ntd = (NodeTypeDef) registeredNTDefs.get(name);
@@ -364,7 +378,7 @@
             PropDefId id = new PropDefId(pda[i]);
             propDefs.remove(id);
         }
-        ChildNodeDef[] nda = ntd.getChildNodeDefs();
+        NodeDef[] nda = ntd.getChildNodeDefs();
         for (int i = 0; i < nda.length; i++) {
             NodeDefId id = new NodeDefId(nda[i]);
             nodeDefs.remove(id);
@@ -377,11 +391,15 @@
             out = customNodeTypesResource.getOutputStream();
             customNTDefs.store(out, nsReg);
         } catch (IOException ioe) {
-            String error = "internal error: failed to persist custom node type definitions to " + customNodeTypesResource.getPath();
+            String error =
+                    "internal error: failed to persist custom node type definitions to "
+                    + customNodeTypesResource.getPath();
             log.debug(error);
             throw new RepositoryException(error, ioe);
         } catch (FileSystemException fse) {
-            String error = "internal error: failed to persist custom node type definitions to " + customNodeTypesResource.getPath();
+            String error =
+                    "internal error: failed to persist custom node type definitions to "
+                    + customNodeTypesResource.getPath();
             log.debug(error);
             throw new RepositoryException(error, fse);
         } finally {
@@ -421,7 +439,8 @@
      */
     private void notifyRegistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
-        NodeTypeRegistryListener[] la = new NodeTypeRegistryListener[listeners.size()];
+        NodeTypeRegistryListener[] la =
+                new NodeTypeRegistryListener[listeners.size()];
         Iterator iter = listeners.values().iterator();
         int cnt = 0;
         while (iter.hasNext()) {
@@ -439,7 +458,8 @@
      */
     private void notifyReRegistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
-        NodeTypeRegistryListener[] la = new NodeTypeRegistryListener[listeners.size()];
+        NodeTypeRegistryListener[] la =
+                new NodeTypeRegistryListener[listeners.size()];
         Iterator iter = listeners.values().iterator();
         int cnt = 0;
         while (iter.hasNext()) {
@@ -457,7 +477,8 @@
      */
     private void notifyUnregistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
-        NodeTypeRegistryListener[] la = new NodeTypeRegistryListener[listeners.size()];
+        NodeTypeRegistryListener[] la =
+                new NodeTypeRegistryListener[listeners.size()];
         Iterator iter = listeners.values().iterator();
         int cnt = 0;
         while (iter.hasNext()) {
@@ -505,7 +526,8 @@
                     throw new InvalidNodeTypeDefException(msg);
                 }
                 if (!registeredNTDefs.containsKey(supertypes[i])) {
-                    String msg = "[" + name + "] invalid supertype: " + supertypes[i];
+                    String msg = "[" + name + "] invalid supertype: "
+                            + supertypes[i];
                     log.debug(msg);
                     throw new InvalidNodeTypeDefException(msg);
                 }
@@ -576,7 +598,7 @@
                 throw new InvalidNodeTypeDefException(msg);
             }
             // check that auto-created properties specify a name
-            if (pd.definesResidual() && pd.isAutoCreate()) {
+            if (pd.definesResidual() && pd.isAutoCreated()) {
                 String msg = "[" + name + "#" + pd.getName()
                         + "] auto-created properties must specify a name";
                 log.debug(msg);
@@ -584,7 +606,7 @@
             }
             // check that auto-created properties specify a type
             if (pd.getRequiredType() == PropertyType.UNDEFINED
-                    && pd.isAutoCreate()) {
+                    && pd.isAutoCreated()) {
                 String msg = "[" + name + "#" + pd.getName()
                         + "] auto-created properties must specify a type";
                 log.debug(msg);
@@ -613,7 +635,7 @@
                 // no default values specified
                 if (checkAutoCreatePropHasDefault) {
                     // auto-created properties must have a default value
-                    if (pd.isAutoCreate()) {
+                    if (pd.isAutoCreated()) {
                         String msg = "[" + name + "#" + pd.getName()
                                 + "] auto-created property must have a default value";
                         log.debug(msg);
@@ -674,9 +696,9 @@
         }
 
         // validate child-node definitions
-        ChildNodeDef[] cnda = ntd.getChildNodeDefs();
+        NodeDef[] cnda = ntd.getChildNodeDefs();
         for (int i = 0; i < cnda.length; i++) {
-            ChildNodeDef cnd = cnda[i];
+            NodeDef cnd = cnda[i];
             /**
              * sanity check:
              * make sure declaring node type matches name of node type definition
@@ -688,7 +710,7 @@
                 throw new InvalidNodeTypeDefException(msg);
             }
             // check that auto-created child-nodes specify a name
-            if (cnd.definesResidual() && cnd.isAutoCreate()) {
+            if (cnd.definesResidual() && cnd.isAutoCreated()) {
                 String msg = "[" + name + "#" + cnd.getName()
                         + "] auto-created child-nodes must specify a name";
                 log.debug(msg);
@@ -696,7 +718,7 @@
             }
             // check that auto-created child-nodes specify a default primary type
             if (cnd.getDefaultPrimaryType() == null
-                    && cnd.isAutoCreate()) {
+                    && cnd.isAutoCreated()) {
                 String msg = "[" + name + "#" + cnd.getName()
                         + "] auto-created child-nodes must specify a default primary type";
                 log.debug(msg);
@@ -737,7 +759,7 @@
                         ent = EffectiveNodeType.create(this, ntd);
                         defaultENT = ent;
                     }
-                    if (cnd.isAutoCreate()) {
+                    if (cnd.isAutoCreated()) {
                         /**
                          * check for circularity through default primary types
                          * of auto-created child nodes (node type 'a' defines
@@ -860,7 +882,7 @@
     /**
      * @return
      */
-    public ChildNodeDef getRootNodeDef() {
+    public NodeDef getRootNodeDef() {
         return rootNodeDef;
     }
 
@@ -1025,7 +1047,8 @@
         }
     }
 
-    void checkForCircularNodeAutoCreation(EffectiveNodeType childNodeENT, Stack definingParentNTs)
+    void checkForCircularNodeAutoCreation(EffectiveNodeType childNodeENT,
+                                          Stack definingParentNTs)
             throws InvalidNodeTypeDefException {
         // check for circularity through default node types of auto-created child nodes
         // (node type 'a' defines auto-created child node with default node type 'a')
@@ -1046,11 +1069,12 @@
                 buf.append("--> ");
                 buf.append("node type ");
                 buf.append(nt);
-                throw new InvalidNodeTypeDefException("circular node auto-creation detected: " + buf.toString());
+                throw new InvalidNodeTypeDefException("circular node auto-creation detected: "
+                        + buf.toString());
             }
         }
 
-        ChildNodeDef[] nodeDefs = childNodeENT.getAutoCreateNodeDefs();
+        NodeDef[] nodeDefs = childNodeENT.getAutoCreateNodeDefs();
         for (int i = 0; i < nodeDefs.length; i++) {
             QName dnt = nodeDefs[i].getDefaultPrimaryType();
             QName definingNT = nodeDefs[i].getDeclaringNodeType();
@@ -1058,11 +1082,13 @@
                 if (dnt != null) {
                     // check recursively
                     definingParentNTs.push(definingNT);
-                    checkForCircularNodeAutoCreation(getEffectiveNodeType(dnt), definingParentNTs);
+                    checkForCircularNodeAutoCreation(getEffectiveNodeType(dnt),
+                            definingParentNTs);
                     definingParentNTs.pop();
                 }
             } catch (NoSuchNodeTypeException nsnte) {
-                String msg = definingNT + " defines invalid default node type for child node " + nodeDefs[i].getName();
+                String msg = definingNT
+                        + " defines invalid default node type for child node " + nodeDefs[i].getName();
                 log.debug(msg);
                 throw new InvalidNodeTypeDefException(msg, nsnte);
             }
@@ -1197,7 +1223,8 @@
             throw new NoSuchNodeTypeException(name.toString());
         }
         if (builtInNTDefs.contains(name)) {
-            throw new RepositoryException(name.toString() + ": can't unregister built-in node type.");
+            throw new RepositoryException(name.toString()
+                    + ": can't unregister built-in node type.");
         }
 
         /**
@@ -1207,7 +1234,8 @@
         Set dependentNTs = getDependentNodeTypes(name);
         if (dependentNTs.size() > 0) {
             StringBuffer msg = new StringBuffer();
-            msg.append(name + " could not be removed because the following node types are referencing it: ");
+            msg.append(name
+                    + " could not be removed because the following node types are referencing it: ");
             Iterator iterator = dependentNTs.iterator();
             while (iterator.hasNext()) {
                 msg.append(iterator.next());
@@ -1260,7 +1288,8 @@
             throw new NoSuchNodeTypeException(name.toString());
         }
         if (builtInNTDefs.contains(name)) {
-            throw new RepositoryException(name.toString() + ": can't reregister built-in node type.");
+            throw new RepositoryException(name.toString()
+                    + ": can't reregister built-in node type.");
         }
 
         /**
@@ -1379,7 +1408,8 @@
      * @return
      * @throws NoSuchNodeTypeException
      */
-    public synchronized NodeTypeDef getNodeTypeDef(QName nodeTypeName) throws NoSuchNodeTypeException {
+    public synchronized NodeTypeDef getNodeTypeDef(QName nodeTypeName)
+            throws NoSuchNodeTypeException {
         if (!registeredNTDefs.containsKey(nodeTypeName)) {
             throw new NoSuchNodeTypeException(nodeTypeName.toString());
         }
@@ -1406,14 +1436,14 @@
      * @param id
      * @return
      */
-    public ChildNodeDef getNodeDef(NodeDefId id) {
-        ChildNodeDef def = (ChildNodeDef) nodeDefs.get(id);
+    public NodeDef getNodeDef(NodeDefId id) {
+        NodeDef def = (NodeDef) nodeDefs.get(id);
         if (def == null) {
             return null;
         }
         // return clone to make sure nobody messes around with the 'real' definition
         try {
-            return (ChildNodeDef) def.clone();
+            return (NodeDef) def.clone();
         } catch (CloneNotSupportedException e) {
             // should never get here
             log.fatal("internal error", e);
@@ -1442,13 +1472,13 @@
 
     //----------------------------------------------------------< diagnostics >
     /**
-     * Dumps the state of this <code>NodeTypeManager</code> instance.
+     * Dumps the state of this <code>NodeTypeRegistry</code> instance.
      *
      * @param ps
      * @throws RepositoryException
      */
     void dump(PrintStream ps) throws RepositoryException {
-        ps.println("NodeTypeManager (" + this + ")");
+        ps.println("NodeTypeRegistry (" + this + ")");
         ps.println();
         ps.println("Registered NodeTypes:");
         ps.println();
@@ -1466,7 +1496,7 @@
             ps.println("\tPrimaryItemName\t" + (ntd.getPrimaryItemName() == null ? "<null>" : ntd.getPrimaryItemName().toString()));
             PropDef[] pd = ntd.getPropertyDefs();
             for (int i = 0; i < pd.length; i++) {
-                ps.print("\tPropertyDef");
+                ps.print("\tPropertyDefinition");
                 ps.println(" (declared in " + pd[i].getDeclaringNodeType() + ") id=" + new PropDefId(pd[i]));
                 ps.println("\t\tName\t\t" + (pd[i].definesResidual() ? "*" : pd[i].getName().toString()));
                 String type = pd[i].getRequiredType() == 0 ? "null" : PropertyType.nameFromValue(pd[i].getRequiredType());
@@ -1497,15 +1527,15 @@
                     }
                 }
                 ps.println("\t\tDefaultValue\t" + defaultValues.toString());
-                ps.println("\t\tAutoCreate\t" + pd[i].isAutoCreate());
+                ps.println("\t\tAutoCreated\t" + pd[i].isAutoCreated());
                 ps.println("\t\tMandatory\t" + pd[i].isMandatory());
                 ps.println("\t\tOnVersion\t" + OnParentVersionAction.nameFromValue(pd[i].getOnParentVersion()));
                 ps.println("\t\tProtected\t" + pd[i].isProtected());
                 ps.println("\t\tMultiple\t" + pd[i].isMultiple());
             }
-            ChildNodeDef[] nd = ntd.getChildNodeDefs();
+            NodeDef[] nd = ntd.getChildNodeDefs();
             for (int i = 0; i < nd.length; i++) {
-                ps.print("\tNodeDef");
+                ps.print("\tNodeDefinition");
                 ps.println(" (declared in " + nd[i].getDeclaringNodeType() + ") id=" + new NodeDefId(nd[i]));
                 ps.println("\t\tName\t\t" + (nd[i].definesResidual() ? "*" : nd[i].getName().toString()));
                 QName[] reqPrimaryTypes = nd[i].getRequiredPrimaryTypes();
@@ -1518,11 +1548,11 @@
                 if (defPrimaryType != null) {
                     ps.print("\n\t\tDefaultPrimaryType\t" + defPrimaryType);
                 }
-                ps.println("\n\t\tAutoCreate\t" + nd[i].isAutoCreate());
+                ps.println("\n\t\tAutoCreated\t" + nd[i].isAutoCreated());
                 ps.println("\t\tMandatory\t" + nd[i].isMandatory());
                 ps.println("\t\tOnVersion\t" + OnParentVersionAction.nameFromValue(nd[i].getOnParentVersion()));
                 ps.println("\t\tProtected\t" + nd[i].isProtected());
-                ps.println("\t\tAllowSameNameSibs\t" + nd[i].allowSameNameSibs());
+                ps.println("\t\tAllowsSameNameSiblings\t" + nd[i].allowsSameNameSiblings());
             }
         }
         ps.println();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDef.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDef.java Thu Apr 14 04:50:38 2005
@@ -24,7 +24,7 @@
 /**
  * A <code>PropDef</code> ...
  */
-public class PropDef extends ChildItemDef {
+public class PropDef extends ItemDef {
 
     private int requiredType = PropertyType.UNDEFINED;
     private ValueConstraint[] valueConstraints = new ValueConstraint[0];

Copied: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java (from r161036, incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefImpl.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java?view=diff&rev=161260&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefImpl.java&r1=161036&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java Thu Apr 14 04:50:38 2005
@@ -22,14 +22,15 @@
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.nodetype.PropertyDef;
+import javax.jcr.nodetype.PropertyDefinition;
 
 /**
- * A <code>PropertyDefImpl</code> ...
+ * A <code>PropertyDefinitionImpl</code> ...
  */
-public class PropertyDefImpl extends ItemDefImpl implements PropertyDef {
+public class PropertyDefinitionImpl extends ItemDefinitionImpl
+        implements PropertyDefinition {
 
-    private static Logger log = Logger.getLogger(PropertyDefImpl.class);
+    private static Logger log = Logger.getLogger(PropertyDefinitionImpl.class);
 
     private final PropDef propDef;
 
@@ -41,7 +42,8 @@
      * @param ntMgr      node type manager
      * @param nsResolver namespace resolver
      */
-    PropertyDefImpl(PropDef propDef, NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver) {
+    PropertyDefinitionImpl(PropDef propDef, NodeTypeManagerImpl ntMgr,
+                           NamespaceResolver nsResolver) {
         super(propDef, ntMgr, nsResolver);
         this.propDef = propDef;
     }
@@ -66,7 +68,9 @@
             } catch (RepositoryException re) {
                 // should never get here
                 String propName = (getName() == null) ? "[null]" : getName();
-                log.error("illegal default value specified for property " + propName + " in node type " + getDeclaringNodeType(), re);
+                log.error("illegal default value specified for property "
+                        + propName + " in node type " + getDeclaringNodeType(),
+                        re);
                 return null;
             }
         }



Mime
View raw message