jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r169148 - /incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype
Date Sun, 08 May 2005 18:58:25 GMT
Author: jukka
Date: Sun May  8 11:58:23 2005
New Revision: 169148

URL: http://svn.apache.org/viewcvs?rev=169148&view=rev
Log:
JCR-EXT: Cleaning up and upgrading to 0.16.4.1 (work in progress, does not compile!)

Added:
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDefinition.java
      - copied, changed from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDef.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDefinition.java
      - copied, changed from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDef.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDefinition.java
      - copied, changed from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDef.java
Removed:
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDef.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDef.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDef.java
Modified:
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeTypeManager.java

Copied: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDefinition.java
(from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDef.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDefinition.java?p2=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDefinition.java&p1=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDef.java&r1=164347&r2=169148&rev=169148&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDef.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseItemDefinition.java
Sun May  8 11:58:23 2005
@@ -16,41 +16,48 @@
  */
 package org.apache.jackrabbit.base.nodetype;
 
-import javax.jcr.nodetype.ItemDef;
+import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.version.OnParentVersionAction;
 
 /**
- * TODO
+ * Item definition base class.
  */
-public class BaseItemDef implements ItemDef {
+public class BaseItemDefinition implements ItemDefinition {
 
-    /** {@inheritDoc} */
+    /** Protected constructor. This class is only useful when extended. */
+    protected BaseItemDefinition() {
+    }
+
+    /** Not implemented. {@inheritDoc} */
     public NodeType getDeclaringNodeType() {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
-    /** {@inheritDoc} */
+    /** Not implemented. {@inheritDoc} */
     public String getName() {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
-    /** {@inheritDoc} */
-    public boolean isAutoCreate() {
+    /** Always returns <code>false</code>. {@inheritDoc} */
+    public boolean isAutoCreated() {
         return false;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>false</code>. {@inheritDoc} */
     public boolean isMandatory() {
         return false;
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Always returns <code>OnParentVersionAction.IGNORE</code>.
+     * {@inheritDoc}
+     */
     public int getOnParentVersion() {
         return OnParentVersionAction.IGNORE;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>false</code>. {@inheritDoc} */
     public boolean isProtected() {
         return false;
     }

Copied: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDefinition.java
(from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDef.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDefinition.java?p2=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDefinition.java&p1=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDef.java&r1=164347&r2=169148&rev=169148&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDef.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeDefinition.java
Sun May  8 11:58:23 2005
@@ -16,26 +16,30 @@
  */
 package org.apache.jackrabbit.base.nodetype;
 
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 
 /**
- * TODO
+ * Node definition base class.
  */
-public class BaseNodeDef extends BaseItemDef implements NodeDef {
+public class BaseNodeDefinition extends BaseItemDefinition implements NodeDefinition {
 
-    /** {@inheritDoc} */
+    /** Protected constructor. This class is only useful when extended. */
+    protected BaseNodeDefinition() {
+    }
+
+    /** Always returns an empty node type array. {@inheritDoc} */
     public NodeType[] getRequiredPrimaryTypes() {
         return new NodeType[0];
     }
 
-    /** {@inheritDoc} */
+    /** Not implemented. {@inheritDoc} */
     public NodeType getDefaultPrimaryType() {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
-    /** {@inheritDoc} */
-    public boolean allowSameNameSibs() {
+    /** Always returns <code>false</code>. {@inheritDoc} */
+    public boolean allowsSameNameSiblings() {
         return false;
     }
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java?rev=169148&r1=169147&r2=169148&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java
Sun May  8 11:58:23 2005
@@ -21,55 +21,70 @@
 import java.util.Set;
 
 import javax.jcr.Value;
-import javax.jcr.nodetype.ItemDef;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.ItemDefinition;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.PropertyDef;
+import javax.jcr.nodetype.PropertyDefinition;
 
 /**
- * TODO
+ * Node type base class.
  */
 public class BaseNodeType implements NodeType {
 
-    /** {@inheritDoc} */
+    /** Protected constructor. This class is only useful when extended. */
+    protected BaseNodeType() {
+    }
+
+    /** Not implemented. {@inheritDoc} */
     public String getName() {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>false</code>. {@inheritDoc} */
     public boolean isMixin() {
         return false;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>false</code>. {@inheritDoc} */
     public boolean hasOrderableChildNodes() {
         return false;
     }
 
-    /** {@inheritDoc} */
+    /** Not implemented. {@inheritDoc} */
     public String getPrimaryItemName() {
-        return null;
+        throw new UnsupportedOperationException();
+    }
+
+    /** Always returns an empty supertype array. {@inheritDoc} */
+    public NodeType[] getDeclaredSupertypes() {
+        return new NodeType[0];
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Implemented by calling <code>getDeclaredSupertypes()</code> and
+     * recursively collecting all supertypes. The collected supertype
+     * set is returned as a node type array.
+     * {@inheritDoc}
+     */
     public NodeType[] getSupertypes() {
-        Set defs = new HashSet();
+        Set supertypes = new HashSet();
 
-        NodeType[] types = getDeclaredSupertypes();
-        for (int i = 0; i < types.length; i++) {
-            defs.addAll(Arrays.asList(types[i].getSupertypes()));
+        NodeType[] declared = getDeclaredSupertypes();
+        for (int i = 0; i < declared.length; i++) {
+            supertypes.addAll(Arrays.asList(declared[i].getSupertypes()));
         }
-        defs.addAll(Arrays.asList(types));
+        supertypes.addAll(Arrays.asList(declared));
 
-        return (NodeType[]) defs.toArray(new NodeType[0]);
+        return (NodeType[]) supertypes.toArray(new NodeType[supertypes.size()]);
     }
 
-    /** {@inheritDoc} */
-    public NodeType[] getDeclaredSupertypes() {
-        return new NodeType[0];
-    }
-
-    /** {@inheritDoc} */
+    /**
+     * Implemented by calling <code>getName()</code> on this node type and
+     * all supertypes returned by <code>getSupertypes()</code>. Returns
+     * <code>true</code> if any of the names equals the given node type name.
+     * Returns <code>false</code> otherwise.
+     * {@inheritDoc}
+     */
     public boolean isNodeType(String nodeTypeName) {
         if (nodeTypeName.equals(getName())) {
             return true;
@@ -84,70 +99,112 @@
         }
     }
 
-    /** {@inheritDoc} */
-    public PropertyDef[] getPropertyDefs() {
+    /** Always returns an empty property definition array. {@inheritDoc} */
+    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
+        return new PropertyDefinition[0];
+    }
+
+    /**
+     * Implemented by calling <code>getDeclaredPropertyDefinitions()</code>
+     * this node type and all supertypes returned by
+     * <code>getSupertypes()</code>. The collected property definition set
+     * is returned as a property definition array.
+     * {@inheritDoc}
+     */
+    public PropertyDefinition[] getPropertyDefinitions() {
+        Set definitions = new HashSet();
+
+        NodeType[] supertypes = getSupertypes();
+        for (int i = 0; i < supertypes.length; i++) {
+            definitions.addAll(
+                    Arrays.asList(supertypes[i].getPropertyDefinitions()));
+        }
+        definitions.addAll(Arrays.asList(getDeclaredPropertyDefinitions()));
+
+        return (PropertyDefinition[])
+            definitions.toArray(new PropertyDefinition[definitions.size()]);
+    }
+
+    /** Always returns an empty node definition array. {@inheritDoc} */
+    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+        return new NodeDefinition[0];
+    }
+
+    /**
+     * Implemented by calling <code>getDeclaredChildNodeDefinitions()</code>
+     * on this node type and all supertypes returned by
+     * <code>getSupertypes()</code>. The collected node definition set
+     * is returned as a node definition array.
+     * {@inheritDoc}
+     */
+    public NodeDefinition[] getChildNodeDefinitions() {
         Set defs = new HashSet();
 
         NodeType[] types = getSupertypes();
         for (int i = 0; i < types.length; i++) {
-            defs.addAll(Arrays.asList(types[i].getPropertyDefs()));
+            defs.addAll(Arrays.asList(types[i].getChildNodeDefinitions()));
         }
-        defs.addAll(Arrays.asList(getDeclaredPropertyDefs()));
-
-        return (PropertyDef[]) defs.toArray(new PropertyDef[0]);
-    }
+        defs.addAll(Arrays.asList(getDeclaredChildNodeDefinitions()));
 
-    /** {@inheritDoc} */
-    public PropertyDef[] getDeclaredPropertyDefs() {
-        return new PropertyDef[0];
+        return (NodeDefinition[]) defs.toArray(new NodeDefinition[0]);
     }
 
-    /** {@inheritDoc} */
-    public NodeDef[] getChildNodeDefs() {
-        Set defs = new HashSet();
 
-        NodeType[] types = getSupertypes();
-        for (int i = 0; i < types.length; i++) {
-            defs.addAll(Arrays.asList(types[i].getChildNodeDefs()));
-        }
-        defs.addAll(Arrays.asList(getDeclaredChildNodeDefs()));
-
-        return (NodeDef[]) defs.toArray(new NodeDef[0]);
-    }
-
-    /** {@inheritDoc} */
-    public NodeDef[] getDeclaredChildNodeDefs() {
-        return new NodeDef[0];
-    }
-
-    protected PropertyDef getPropertyDef(String propertyName) {
-        PropertyDef[] defs = getPropertyDefs();
-        for (int i = 0; i < defs.length; i++) {
-            if (propertyName.equals(defs[i].getName())) {
-                return defs[i];
+    /**
+     * Returns the definition of the named property.
+     * <p>
+     * This internal utility method is used by the predicate methods
+     * in this class.
+     *
+     * @param propertyName property name
+     * @return property definition, or <code>null</code> if not found
+     */
+    private PropertyDefinition getPropertyDefinition(String propertyName) {
+        PropertyDefinition[] definitions = getPropertyDefinitions();
+        for (int i = 0; i < definitions.length; i++) {
+            if (propertyName.equals(definitions[i].getName())) {
+                return definitions[i];
             }
         }
         return null;
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Implemented by finding the definition of the named property (or the
+     * wildcard property definition if the named property definition is not
+     * found) and checking whether the defined property is single-valued.
+     * More detailed value constraints are not implemented, but this method
+     * will simply return <code>true</code> instead of throwing an
+     * {@link UnsupportedOperationException UnsupportedOperationException}
+     * for all value constraint comparisons.
+     * {@inheritDoc}
+     */
     public boolean canSetProperty(String propertyName, Value value) {
-        PropertyDef def = getPropertyDef(propertyName);
-        if (def == null) {
-            def = getPropertyDef("*");
+        PropertyDefinition definition = getPropertyDefinition(propertyName);
+        if (definition == null) {
+            definition = getPropertyDefinition("*");
         }
-        if (def == null || def.isMultiple()) {
+        if (definition == null || definition.isMultiple()) {
             return false;
         } else {
             return true; // TODO check constraints!
         }
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Implemented by finding the definition of the named property (or the
+     * wildcard property definition if the named property definition is not
+     * found) and checking whether the defined property is multi-valued.
+     * More detailed value constraints are not implemented, but this method
+     * will simply return <code>true</code> instead of throwing an
+     * {@link UnsupportedOperationException UnsupportedOperationException}
+     * for all value constraint comparisons.
+     * {@inheritDoc}
+     */
     public boolean canSetProperty(String propertyName, Value[] values) {
-        PropertyDef def = getPropertyDef(propertyName);
+        PropertyDefinition def = getPropertyDefinition(propertyName);
         if (def == null) {
-            def = getPropertyDef("*");
+            def = getPropertyDefinition("*");
         }
         if (def == null || !def.isMultiple()) {
             return false;
@@ -156,54 +213,63 @@
         }
     }
 
-    protected NodeDef getChildNodeDef(String childNodeName) {
-        NodeDef[] defs = getChildNodeDefs();
-        for (int i = 0; i < defs.length; i++) {
-            if (childNodeName.equals(defs[i].getName())) {
-                return defs[i];
+    /**
+     * Returns the definition of the named child node.
+     * <p>
+     * This internal utility method is used by the predicate methods
+     * in this class.
+     *
+     * @param childNodeName child node name
+     * @return node definition, or <code>null</code> if not found
+     */
+    private NodeDefinition getChildNodeDefinition(String childNodeName) {
+        NodeDefinition[] definitions = getChildNodeDefinitions();
+        for (int i = 0; i < definitions.length; i++) {
+            if (childNodeName.equals(definitions[i].getName())) {
+                return definitions[i];
             }
         }
         return null;
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Implemented by finding the definition of the named child node (or the
+     * wildcard child node definition if the named child node definition is
+     * not found). Returns <code>true</code> if a node definition is found,
+     * <code>false</code> otherwise.
+     * {@inheritDoc}
+     */
     public boolean canAddChildNode(String childNodeName) {
-        NodeDef def = getChildNodeDef(childNodeName);
-        if (def == null) {
-            def = getChildNodeDef("*");
-        }
-        return def != null;
+        NodeDefinition definition = getChildNodeDefinition(childNodeName);
+        if (definition == null) {
+            definition = getChildNodeDefinition("*");
+        }
+        return definition != null;
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Not implemented. Implementing this method requires access to the
+     * node type manager in order to resolve the given node type name.
+     * {@inheritDoc}
+     */
     public boolean canAddChildNode(String childNodeName, String nodeTypeName) {
-        NodeDef def = getChildNodeDef(childNodeName);
-        if (def == null) {
-            def = getChildNodeDef("*");
-        }
-        if (def == null) {
-            return false;
-        }
-
-        NodeType[] types = def.getRequiredPrimaryTypes();
-        for (int i = 0; i < types.length; i++) {
-            if (types[i].isNodeType(nodeTypeName)) {
-                return true;
-            }
-        }
-        return types.length == 0;
+        throw new UnsupportedOperationException();
     }
 
-    /** {@inheritDoc} */
+    /**
+     * Implemented by finding the definition of the named item (property or
+     * child node) and checking that the defined item is not mandatory.
+     * {@inheritDoc}
+     */
     public boolean canRemoveItem(String itemName) {
-        ItemDef def = getPropertyDef(itemName);
-        if (def == null) {
-            def = getChildNodeDef(itemName);
+        ItemDefinition definition = getPropertyDefinition(itemName);
+        if (definition == null) {
+            definition = getChildNodeDefinition(itemName);
         }
-        if (def == null) {
+        if (definition == null) {
             return true;
         } else {
-            return def.isMandatory();
+            return definition.isMandatory();
         }
     }
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeTypeManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeTypeManager.java?rev=169148&r1=169147&r2=169148&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeTypeManager.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeTypeManager.java
Sun May  8 11:58:23 2005
@@ -19,6 +19,7 @@
 import java.util.Vector;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
@@ -27,40 +28,23 @@
 import org.apache.jackrabbit.iterator.ArrayNodeTypeIterator;
 
 /**
- * TODO
+ * Node type manager base class.
  */
 public class BaseNodeTypeManager implements NodeTypeManager {
 
-    /**
-     * Static empty node type array instance. Used to avoid
-     * instantiating the empty array more than once.
-     */
-    private static final NodeType[] EMPTY_NODETYPE_ARRAY = new NodeType[0];
+    /** Protected constructor. This class is only useful when extended. */
+    protected BaseNodeTypeManager() {
+    }
 
-    /**
-     * Returns an empty iterator. Subclasses should override this method
-     * to return all the available node types.
-     *
-     * @return all node types (empty array)
-     * @throws RepositoryException on repository errors (not thrown)
-     */
+    /** Not implemented. {@inheritDoc} */
     public NodeTypeIterator getAllNodeTypes() throws RepositoryException {
-        return new ArrayNodeTypeIterator(EMPTY_NODETYPE_ARRAY);
+        throw new UnsupportedRepositoryOperationException();
     }
 
     /**
-     * Returns the named node type. Implemented by searching through
-     * the iterator returned by <code>getAllNodeTypes()</code> looking
-     * for a match for <code>nodeTypeName.equals(type.getName())</code>.
-     * <p>
-     * Note that names are compared using normal string comparison, which
-     * means that both the given name and the internal node type names must
-     * use the same namespace mappings.
-     *
-     * @param nodeTypeName node type name
-     * @return named node type
-     * @throws NoSuchNodeTypeException if the named node type does not exist
-     * @throws RepositoryException on repository errors
+     * Implemented by calling <code>getAllNodeTypes()</code> and iterating
+     * through the returned node types to find the named node type.
+     * {@inheritDoc}
      */
     public NodeType getNodeType(String nodeTypeName)
             throws NoSuchNodeTypeException, RepositoryException {
@@ -71,18 +55,13 @@
                 return type;
             }
         }
-
-        throw new NoSuchNodeTypeException(
-                "Node type " + nodeTypeName + " not found");
+        throw new NoSuchNodeTypeException("Type not found: " + nodeTypeName);
     }
 
     /**
-     * Returns all primary node types. Implemented by filtering the iterator
-     * returned by <code>getAllNodeTypes()</code> with
-     * <code>!type.isMixin()</code>.
-     *
-     * @return primary node types
-     * @throws RepositoryException on repository errors
+     * Implemented by calling <code>getAllNodeTypes()</code> and iterating
+     * through the returned node types to select all primary node types.
+     * {@inheritDoc}
      */
     public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException {
         Vector primaryTypes = new Vector();
@@ -95,17 +74,14 @@
             }
         }
 
-        return new ArrayNodeTypeIterator(
-                (NodeType[]) primaryTypes.toArray(EMPTY_NODETYPE_ARRAY));
+        return new ArrayNodeTypeIterator((NodeType[])
+                primaryTypes.toArray(new NodeType[primaryTypes.size()]));
     }
 
     /**
-     * Returns all mixin node types. Implemented by filtering the iterator
-     * returned by <code>getAllNodeTypes()</code> with
-     * <code>type.isMixin()</code>.
-     *
-     * @return mixin node types
-     * @throws RepositoryException on repository errors
+     * Implemented by calling <code>getAllNodeTypes()</code> and iterating
+     * through the returned node types to select all mixin node types.
+     * {@inheritDoc}
      */
     public NodeTypeIterator getMixinNodeTypes() throws RepositoryException {
         Vector mixinTypes = new Vector();
@@ -118,8 +94,8 @@
             }
         }
 
-        return new ArrayNodeTypeIterator(
-                (NodeType[]) mixinTypes.toArray(EMPTY_NODETYPE_ARRAY));
+        return new ArrayNodeTypeIterator((NodeType[])
+                mixinTypes.toArray(new NodeType[mixinTypes.size()]));
     }
 
 }

Copied: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDefinition.java
(from r164347, incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDef.java)
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDefinition.java?p2=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDefinition.java&p1=incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDef.java&r1=164347&r2=169148&rev=169148&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDef.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BasePropertyDefinition.java
Sun May  8 11:58:23 2005
@@ -18,29 +18,34 @@
 
 import javax.jcr.PropertyType;
 import javax.jcr.Value;
-import javax.jcr.nodetype.PropertyDef;
+import javax.jcr.nodetype.PropertyDefinition;
 
 /**
- * TODO
+ * Property definition base class.
  */
-public class BasePropertyDef extends BaseItemDef implements PropertyDef {
+public class BasePropertyDefinition extends BaseItemDefinition
+        implements PropertyDefinition {
 
-    /** {@inheritDoc} */
+    /** Protected constructor. This class is only useful when extended. */
+    protected BasePropertyDefinition() {
+    }
+
+    /** Always returns <code>PropertyType.UNDEFINED</code>. {@inheritDoc} */
     public int getRequiredType() {
         return PropertyType.UNDEFINED;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>null</code>. {@inheritDoc} */
     public String[] getValueConstraints() {
         return null;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>null</code>. {@inheritDoc} */
     public Value[] getDefaultValues() {
         return null;
     }
 
-    /** {@inheritDoc} */
+    /** Always returns <code>false</code>. {@inheritDoc} */
     public boolean isMultiple() {
         return false;
     }



Mime
View raw message