jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r164228 - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: ./ nodetype/ xml/
Date Fri, 22 Apr 2005 12:42:40 GMT
Author: stefan
Date: Fri Apr 22 05:42:39 2005
New Revision: 164228

URL: http://svn.apache.org/viewcvs?rev=164228&view=rev
Log:
JCR-73: some javadoc improvements

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java Fri Apr 22 05:42:39
2005
@@ -913,7 +913,7 @@
 
     //--------------------------------------------------------< inner classes >
     /**
-     * package protected inner class used to build a path from path elements;
+     * package private inner class used to build a path from path elements;
      * this class does not validate the format of the path elements!
      */
     static final class PathBuilder implements Cloneable {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java Fri Apr
22 05:42:39 2005
@@ -1079,7 +1079,7 @@
                     valueType = values[i].getType();
                 } else if (valueType != values[i].getType()) {
                     // inhomogeneous types
-                    String msg = "inhomogeneous type of values";
+                        String msg = "inhomogeneous type of values";
                     log.debug(msg);
                     throw new ValueFormatException(msg);
                 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java Fri
Apr 22 05:42:39 2005
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.QName;
 
 /**
- * This interface defines the base for item definitions.
+ * Superinterface of {@link NodeDef} and {@link PropDef}.
  */
-public interface ItemDef  {
+public interface ItemDef {
 
     /**
      * '*' denoting residual child item definition
@@ -30,52 +30,62 @@
     QName ANY_NAME = new QName(Constants.NS_DEFAULT_URI, "*");
 
     /**
-     * Returns the name of this item def.
-     * @return the name of this item def.
+     * Gets the name of the child item.
+     *
+     * @return the name of the child item.
      */
     QName getName();
 
     /**
-     * Returns the name of the declaring node type.
+     * Gets the name of the declaring node type.
+     *
      * @return the name of the declaring node type.
      */
     QName getDeclaringNodeType();
 
     /**
-     * Returns the 'autoCreated' flag.
+     * Determines whether the item is 'autoCreated'.
+     *
      * @return the 'autoCreated' flag.
      */
     boolean isAutoCreated();
 
     /**
-     * Returns the 'onParentVersion' attribute.
+     * Gets the 'onParentVersion' attribute of the item.
+     *
      * @return the 'onParentVersion' attribute.
      */
     int getOnParentVersion();
 
     /**
-     * Returns the 'protected' flag.
+     * Determines whether the item is 'protected'.
+     *
      * @return the 'protected' flag.
      */
     boolean isProtected();
 
     /**
-     * Returns the 'mandatory' flag.
+     * Determines whether the item is 'mandatory'.
+     *
      * @return the 'mandatory' flag.
      */
     boolean isMandatory();
 
     /**
-     * Checks if this item definition is a residual definition.
-     * @return <code>true</code> if this is a residual definition;
+     * Determines whether this item definition defines a residual set of
+     * child items. This is equivalent to calling
+     * <code>getName().equals(ANY_NAME)</code>.
+     *
+     * @return <code>true</code> if this definition defines a residual set;
      *         <code>false</code> otherwise.
      */
     boolean definesResidual();
 
     /**
-     * Checks if this is a node definition.
+     * Determines whether this item definition defines a node.
+     *
      * @return <code>true</code> if this is a node definition;
-     *         <code>false</code> otherwise, i.e. this is a property definition.
+     *         <code>false</code> otherwise (i.e. it is a property definition).
      */
     boolean definesNode();
 }

Modified: 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/ItemDefImpl.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java
Fri Apr 22 05:42:39 2005
@@ -21,13 +21,14 @@
 import javax.jcr.version.OnParentVersionAction;
 
 /**
- * This class is an abstract implementation for the <code>ItemDef</code>
- * interface and holds the generic item definition attributes.
+ * This abstract class implements the <code>ItemDef</code>
+ * interface and additionaly provides setter's for the
+ * various item definition attributes.
  */
 public abstract class ItemDefImpl implements ItemDef {
 
     /**
-     * The name of this item definition.
+     * The name of the child item.
      */
     private QName name = ANY_NAME;
 
@@ -47,7 +48,7 @@
     private int onParentVersion = OnParentVersionAction.COPY;
 
     /**
-     * The 'writeProtected' flag.
+     * The 'protected' flag.
      */
     private boolean writeProtected = false;
 
@@ -57,9 +58,10 @@
     private boolean mandatory = false;
 
     /**
-     * Sets the declaring node type.
+     * Sets the name of declaring node type.
      *
-     * @param declaringNodeType
+     * @param declaringNodeType name of the declaring node type (must not be
+     *                          <code>null</code>)
      */
     public void setDeclaringNodeType(QName declaringNodeType) {
         if (declaringNodeType == null) {
@@ -69,9 +71,9 @@
     }
 
     /**
-     * Sets the name.
+     * Sets the name of the child item.
      *
-     * @param name
+     * @param name name of child item (must not be  <code>null</code>)
      */
     public void setName(QName name) {
         if (name == null) {
@@ -81,41 +83,50 @@
     }
 
     /**
-     * Sets the auto create flag.
+     * Sets the 'autoCreated' flag.
      *
-     * @param autoCreated
+     * @param autoCreated a <code>boolean</code>
      */
     public void setAutoCreated(boolean autoCreated) {
         this.autoCreated = autoCreated;
     }
 
     /**
-     * Sets the on parent version.
+     * Sets the 'onParentVersion' attribute.
      *
-     * @param onParentVersion
+     * @param onParentVersion any of the following constants:
+     * <UL>
+     *    <LI><code>OnParentVersionAction.COPY</code>
+     *    <LI><code>OnParentVersionAction.VERSION</code>
+     *    <LI><code>OnParentVersionAction.INITIALIZE</code>
+     *    <LI><code>OnParentVersionAction.COMPUTE</code>
+     *    <LI><code>OnParentVersionAction.IGNORE</code>
+     *    <LI><code>OnParentVersionAction.ABORT</code>
+     * </UL>
      */
     public void setOnParentVersion(int onParentVersion) {
         this.onParentVersion = onParentVersion;
     }
 
     /**
-     * Sets the protected flag.
+     * Sets the 'protected' flag.
      *
-     * @param writeProtected
+     * @param writeProtected a <code>boolean</code>
      */
     public void setProtected(boolean writeProtected) {
         this.writeProtected = writeProtected;
     }
 
     /**
-     * Sets the mandatory flag.
+     * Sets the 'mandatory' flag.
      *
-     * @param mandatory
+     * @param mandatory a <code>boolean</code>
      */
     public void setMandatory(boolean mandatory) {
         this.mandatory = mandatory;
     }
 
+    //--------------------------------------------------------------< ItemDef >
     /**
      * {@inheritDoc}
      */
@@ -165,14 +176,16 @@
         return name.equals(ANY_NAME);
     }
 
+    //-------------------------------------------< java.lang.Object overrides >
     /**
-     * Checks if this item definition is equal to the given one. Two item
-     * definitions are equal if they are the same object or if all their
-     * attributes are equal.
-     *
-     * @param obj the object to compare to
-     * @return <code>true</code> if this item definition is equals to obj;
-     *         <code>false</code> otherwise.
+     * Compares two item definitions for equality. Returns <code>true</code>
+     * if the given object is an item defintion and has the same attributes
+     * as this item definition.
+     *
+     * @param obj the object to compare this item definition with
+     * @return <code>true</code> if the object is equal to this item definition,
+     *         <code>false</code> otherwise
+     * @see Object#equals(Object)
      */
     public boolean equals(Object obj) {
         if (this == obj) {
@@ -181,8 +194,8 @@
         if (obj instanceof ItemDefImpl) {
             ItemDefImpl other = (ItemDefImpl) obj;
             return (declaringNodeType == null
-                        ? other.declaringNodeType == null
-                        : declaringNodeType.equals(other.declaringNodeType))
+                    ? other.declaringNodeType == null
+                    : declaringNodeType.equals(other.declaringNodeType))
                     && (name == null ? other.name == null : name.equals(other.name))
                     && autoCreated == other.autoCreated
                     && onParentVersion == other.onParentVersion

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefinitionImpl.java
Fri Apr 22 05:42:39 2005
@@ -27,13 +27,16 @@
 
 /**
  * This class implements the <code>ItemDefinition</code> interface.
+ * All method calls are delegated to the wrapped {@link ItemDef},
+ * performing the translation from <code>QName</code>s to JCR names
+ * (and vice versa) where necessary.
  */
 abstract class ItemDefinitionImpl implements ItemDefinition {
 
     /**
-     * The default logger.
+     * Logger instance for this class
      */
-    private static Logger log = Logger.getLogger(ItemDefImpl.class);
+    private static Logger log = Logger.getLogger(ItemDefinitionImpl.class);
 
     /**
      * Literal for 'any name'.
@@ -51,7 +54,7 @@
     protected final NamespaceResolver nsResolver;
 
     /**
-     * The underlying child item definition.
+     * The wrapped item definition.
      */
     protected final ItemDef itemDef;
 
@@ -70,15 +73,16 @@
     }
 
     /**
-     * Returns the qualified name of this item definition.
+     * Gets the <code>QName</code> of the child item.
      *
-     * @return
+     * @return the <code>QName</code> of the child item.
+     * @see #getName()
      */
     public QName getQName() {
         return itemDef.getName();
     }
 
-    //-----------------------------------------------------< ItemDefinition >---
+    //-------------------------------------------------------< ItemDefinition >
     /**
      * {@inheritDoc}
      */
@@ -103,7 +107,8 @@
                 return itemDef.getName().toJCRName(nsResolver);
             } catch (NoPrefixDeclaredException npde) {
                 // should never get here
-                log.error("encountered unregistered namespace in property name", npde);
+                log.error("encountered unregistered namespace in property name",
+                        npde);
                 // not correct, but an acceptable fallback
                 return itemDef.getName().toString();
             }

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?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- 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
Fri Apr 22 05:42:39 2005
@@ -28,20 +28,24 @@
 public class NodeDefId implements Serializable {
 
     /**
-     * the serial number.
+     * Serialization UID of this class.
      */
     static final long serialVersionUID = 7020286139887664713L;
 
     /**
-     * The internal id.
+     * The internal id is computed based on the characteristics of the
+     * <code>NodeDef</code> that this <code>NodeDefId</code> identifies.
      */
     private final int id;
 
     /**
-     * Creates a new NodeDefId from the given NodeDef
-     * @param def
+     * Creates a new <code>NodeDefId</code> that serves as identifier for
+     * the given <code>NodeDef</code>. An internal id is computed based on
+     * the characteristics of the <code>NodeDef</code> that it identifies.
+     *
+     * @param def <code>NodeDef</code> to create identifier for
      */
-    NodeDefId(NodeDefImpl def) {
+    NodeDefId(NodeDef def) {
         if (def == null) {
             throw new IllegalArgumentException("NodeDef argument can not be null");
         }
@@ -68,8 +72,10 @@
     }
 
     /**
-     * Private constructor that creates an NodeDefId using an internal id
-     * @param id
+     * Private constructor that creates a <code>NodeDefId</code> using an
+     * internal id
+     *
+     * @param id internal id
      */
     private NodeDefId(int id) {
         this.id = id;
@@ -94,6 +100,7 @@
         return new NodeDefId(Integer.parseInt(s));
     }
 
+    //-------------------------------------------< java.lang.Object overrides >
     /**
      * {@inheritDoc}
      */

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
Fri Apr 22 05:42:39 2005
@@ -27,13 +27,16 @@
 
 /**
  * This class implements the <code>NodeDefinition</code> interface.
+ * All method calls are delegated to the wrapped {@link NodeDef},
+ * performing the translation from <code>QName</code>s to JCR names
+ * (and vice versa) where necessary.
  */
 public class NodeDefinitionImpl extends ItemDefinitionImpl implements NodeDefinition {
 
     /**
-     * The default logger.
+     * Logger instance for this class
      */
-    private static Logger log = Logger.getLogger(NodeDefImpl.class);
+    private static Logger log = Logger.getLogger(NodeDefinitionImpl.class);
 
     /**
      * Package private constructor.
@@ -48,16 +51,15 @@
     }
 
     /**
-     * Returns the underlying node definition.
+     * Returns the wrapped node definition.
      *
-     * @return the underlying node definition.
+     * @return the wrapped node definition.
      */
     public NodeDef unwrap() {
         return (NodeDef) itemDef;
     }
 
-    //-----------------------------------------------------< NodeDefinition >---
-
+    //-------------------------------------------------------< NodeDefinition >
     /**
      * {@inheritDoc}
      */

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?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- 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
Fri Apr 22 05:42:39 2005
@@ -33,6 +33,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Map;
+import java.util.Iterator;
 
 /**
  * A <code>NodeTypeManagerImpl</code> implements a session dependant
@@ -42,12 +43,12 @@
         NodeTypeRegistryListener {
 
     /**
-     * The default logger.
+     * Logger instance for this class
      */
     private static Logger log = Logger.getLogger(NodeTypeManagerImpl.class);
 
     /**
-     * The underlying node type registry.
+     * The wrapped node type registry.
      */
     private final NodeTypeRegistry ntReg;
 
@@ -80,14 +81,19 @@
     private final Map ndCache;
 
     /**
-     * Constructor.
+     * Creates a new <code>NodeTypeManagerImpl</code> instance.
+     *
+     * @param ntReg      node type registry
+     * @param nsResolver namespace resolver
      */
-    public NodeTypeManagerImpl(NodeTypeRegistry ntReg, NamespaceResolver nsResolver) {
+    public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
+                               NamespaceResolver nsResolver) {
         this.nsResolver = nsResolver;
         this.ntReg = ntReg;
         this.ntReg.addListener(this);
 
-        // setup caches with soft references to node type & item definition instances
+        // setup caches with soft references to node type
+        // & item definition instances
         ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
         pdCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
         ndCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
@@ -110,15 +116,15 @@
      */
     public NodeDefinitionImpl getNodeDefinition(NodeDefId id) {
         synchronized (ndCache) {
-            NodeDefinitionImpl nd = (NodeDefinitionImpl) ndCache.get(id);
-            if (nd == null) {
-                NodeDef cnd = ntReg.getNodeDef(id);
-                if (cnd != null) {
-                    nd = new NodeDefinitionImpl(cnd, this, nsResolver);
-                    ndCache.put(id, nd);
+            NodeDefinitionImpl ndi = (NodeDefinitionImpl) ndCache.get(id);
+            if (ndi == null) {
+                NodeDef nd = ntReg.getNodeDef(id);
+                if (nd != null) {
+                    ndi = new NodeDefinitionImpl(nd, this, nsResolver);
+                    ndCache.put(id, ndi);
                 }
             }
-            return nd;
+            return ndi;
         }
     }
 
@@ -165,39 +171,67 @@
         return ntReg;
     }
 
-    //-------------------------------------------< NodeTypeRegistryListener >---
+    //---------------------------------------------< NodeTypeRegistryListener >
     /**
      * {@inheritDoc}
      */
     public void nodeTypeRegistered(QName ntName) {
-        // ignore
+        // not interested, ignore
     }
 
     /**
      * {@inheritDoc}
      */
     public void nodeTypeReRegistered(QName ntName) {
-        // flush cache
+        // flush all affected cache entries
         ntCache.remove(ntName);
-        // just clear all definitions from cache
-        // @todo do smart/selective flush of definition caches
-        pdCache.clear();
-        ndCache.clear();
+        synchronized(pdCache) {
+            Iterator iter = pdCache.values().iterator();
+            while (iter.hasNext()) {
+                PropDefImpl pd = (PropDefImpl) iter.next();
+                if (ntName.equals(pd.getDeclaringNodeType())) {
+                    iter.remove();
+                }
+            }
+        }
+        synchronized(ndCache) {
+            Iterator iter = ndCache.values().iterator();
+            while (iter.hasNext()) {
+                NodeDefImpl nd = (NodeDefImpl) iter.next();
+                if (ntName.equals(nd.getDeclaringNodeType())) {
+                    iter.remove();
+                }
+            }
+        }
     }
 
     /**
      * {@inheritDoc}
      */
     public void nodeTypeUnregistered(QName ntName) {
-        // sync cache
+        // flush all affected cache entries
         ntCache.remove(ntName);
-        // just clear all definitions from cache
-        // @todo do smart/selective flush of definition caches
-        pdCache.clear();
-        ndCache.clear();
+        synchronized(pdCache) {
+            Iterator iter = pdCache.values().iterator();
+            while (iter.hasNext()) {
+                PropDefImpl pd = (PropDefImpl) iter.next();
+                if (ntName.equals(pd.getDeclaringNodeType())) {
+                    iter.remove();
+                }
+            }
+        }
+        synchronized(ndCache) {
+            Iterator iter = ndCache.values().iterator();
+            while (iter.hasNext()) {
+                NodeDefImpl nd = (NodeDefImpl) iter.next();
+                if (ntName.equals(nd.getDeclaringNodeType())) {
+                    iter.remove();
+                }
+            }
+        }
     }
 
-    //----------------------------------------------------< NodeTypeManager >---
+    //------------------------------------------------------< NodeTypeManager >
     /**
      * {@inheritDoc}
      */
@@ -243,7 +277,8 @@
     /**
      * {@inheritDoc}
      */
-    public NodeType getNodeType(String nodeTypeName) throws NoSuchNodeTypeException {
+    public NodeType getNodeType(String nodeTypeName)
+            throws NoSuchNodeTypeException {
         try {
             return getNodeType(QName.fromJCRName(nodeTypeName, nsResolver));
         } catch (UnknownPrefixException upe) {
@@ -253,9 +288,9 @@
         }
     }
 
-    //--------------------------------------------------------< diagnostics >---
+    //----------------------------------------------------------< diagnostics >
     /**
-     * Dumps the state of this <code>NodeTypeManager</code> instance.
+     * Dumps the state of this <code>NodeTypeManagerImpl</code> instance.
      *
      * @param ps
      * @throws RepositoryException
@@ -266,7 +301,7 @@
         ntReg.dump(ps);
     }
 
-    //------------------------------------------------------< inner classes >---
+    //--------------------------------------------------------< inner classes >
     /**
      * The <code>RootNodeDefinition</code> defines the characteristics of
      * the root node.

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
Fri Apr 22 05:42:39 2005
@@ -19,26 +19,33 @@
 import java.io.Serializable;
 
 /**
- * <code>PropDefId</code> uniquely identifies a <code>PropDef</code>
in the
+ * <code>PropDefId</code> serves as identifier for a given <code>PropDef</code>.
+ *
+ *
+ * uniquely identifies a <code>PropDef</code> in the
  * node type registry.
  */
 public class PropDefId implements Serializable {
 
     /**
-     * Serial number
+     * Serialization UID of this class.
      */
     static final long serialVersionUID = 3675238890036653593L;
 
     /**
-     * The internal id
+     * The internal id is computed based on the characteristics of the
+     * <code>PropDef</code> that this <code>PropDefId</code> identifies.
      */
     private final int id;
 
     /**
-     * Creates a new PropDefId from the given PropDef
-     * @param def
+     * Creates a new <code>PropDefId</code> that serves as identifier for
+     * the given <code>PropDef</code>. An internal id is computed based on
+     * the characteristics of the <code>PropDef</code> that it identifies.
+     *
+     * @param def <code>PropDef</code> to create identifier for
      */
-    PropDefId(PropDefImpl def) {
+    PropDefId(PropDef def) {
         if (def == null) {
             throw new IllegalArgumentException("PropDef argument can not be null");
         }
@@ -61,8 +68,10 @@
     }
 
     /**
-     * Creates a new PropDefId with the given internal id
-     * @param id
+     * Private constructor that creates a <code>PropDefId</code> using an
+     * internal id
+     *
+     * @param id internal id
      */
     private PropDefId(int id) {
         this.id = id;
@@ -87,6 +96,7 @@
         return new PropDefId(Integer.parseInt(s));
     }
 
+    //-------------------------------------------< java.lang.Object overrides >
     /**
      * {@inheritDoc}
      */

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
Fri Apr 22 05:42:39 2005
@@ -26,11 +26,15 @@
 
 /**
  * This class implements the <code>PropertyDefinition</code> interface.
+ * All method calls are delegated to the wrapped {@link PropDef},
+ * performing the translation from <code>QName</code>s to JCR names
+ * (and vice versa) where necessary.
  */
-public class PropertyDefinitionImpl extends ItemDefinitionImpl implements PropertyDefinition
{
+public class PropertyDefinitionImpl extends ItemDefinitionImpl
+        implements PropertyDefinition {
 
     /**
-     * The default logger.
+     * Logger instance for this class
      */
     private static Logger log = Logger.getLogger(PropertyDefinitionImpl.class);
 
@@ -47,16 +51,15 @@
     }
 
     /**
-     * Returns the underlying property definition.
+     * Returns the wrapped property definition.
      * 
-     * @return the underlying property definition.
+     * @return the wrapped property definition.
      */
     public PropDef unwrap() {
         return (PropDef) itemDef;
     }
 
-    //-------------------------------------------------< PropertyDefinition >---
-
+    //---------------------------------------------------< PropertyDefinition >
     /**
      * {@inheritDoc}
      */
@@ -72,7 +75,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;
             }
         }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?rev=164228&r1=164227&r2=164228&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Fri Apr 22 05:42:39 2005
@@ -351,20 +351,20 @@
 /*
         // FIXME delegate to NodeTypeInstanceHandler
         } else if (MIX_VERSIONABLE.equals(declaringNT)) {
-        // mix:versionable node type
-        if (JCR_VERSIONHISTORY.equals(name)) {
-        // jcr:versionHistory property
-        genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getUUID()))};
-        } else if (JCR_BASEVERSION.equals(name)) {
-        // jcr:baseVersion property
-        genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
-        } else if (JCR_ISCHECKEDOUT.equals(name)) {
-        // jcr:isCheckedOut property
-        genValues = new InternalValue[]{InternalValue.create(true)};
-        } else if (JCR_PREDECESSORS.equals(name)) {
-        // jcr:predecessors property
-        genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
-        }
+            // mix:versionable node type
+            if (JCR_VERSIONHISTORY.equals(name)) {
+                // jcr:versionHistory property
+                genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getUUID()))};
+            } else if (JCR_BASEVERSION.equals(name)) {
+                // jcr:baseVersion property
+                genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
+            } else if (JCR_ISCHECKEDOUT.equals(name)) {
+                // jcr:isCheckedOut property
+                genValues = new InternalValue[]{InternalValue.create(true)};
+            } else if (JCR_PREDECESSORS.equals(name)) {
+                // jcr:predecessors property
+                genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
+            }
 */
         }
 



Mime
View raw message