jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r590014 [5/11] - in /jackrabbit/trunk: jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jou...
Date Tue, 30 Oct 2007 10:02:57 GMT
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventFilter.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventFilter.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventFilter.java Tue Oct 30 03:02:41 2007
@@ -23,11 +23,10 @@
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.conversion.MalformedPathException;
+import org.apache.jackrabbit.spi.Path;
 
 import javax.jcr.RepositoryException;
-import javax.jcr.observation.Event;
 
 /**
  * The <code>EventFilter</code> class implements the filter logic based

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java Tue Oct 30 03:02:41 2007
@@ -18,8 +18,9 @@
 
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.conversion.MalformedPathException;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.name.PathFactoryImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -104,12 +105,12 @@
     public Path getQPath() throws RepositoryException {
         try {
             Path parent = eventState.getParentPath();
-            Path.PathElement child = eventState.getChildRelPath();
+            Path.Element child = eventState.getChildRelPath();
             int index = child.getIndex();
             if (index > 0) {
-                return Path.create(parent, child.getName(), index, false);
+                return PathFactoryImpl.getInstance().create(parent, child.getName(), index, false);
             } else {
-                return Path.create(parent, child.getName(), false);
+                return PathFactoryImpl.getInstance().create(parent, child.getName(), false);
             }
         } catch (MalformedPathException e) {
             String msg = "internal error: malformed path for event";

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventState.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventState.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventState.java Tue Oct 30 03:02:41 2007
@@ -20,8 +20,8 @@
 import org.apache.jackrabbit.core.ItemId;
 import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -70,12 +70,12 @@
      * The relative path of the child item associated with this event.
      * This is basically the name of the item with an optional index.
      */
-    private final Path.PathElement childRelPath;
+    private final Path.Element childRelPath;
 
     /**
      * The node type name of the parent node.
      */
-    private final QName nodeType;
+    private final Name nodeType;
 
     /**
      * Set of mixin QNames assigned to the parent node.
@@ -130,7 +130,7 @@
      * @param session    the {@link javax.jcr.Session} that caused this event.
      */
     private EventState(int type, NodeId parentId, Path parentPath,
-                       NodeId childId, Path.PathElement childPath, QName nodeType,
+                       NodeId childId, Path.Element childPath, Name nodeType,
                        Set mixins, Session session, boolean external) {
 
         int mask = (Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED);
@@ -174,8 +174,8 @@
     public static EventState childNodeAdded(NodeId parentId,
                                             Path parentPath,
                                             NodeId childId,
-                                            Path.PathElement childPath,
-                                            QName nodeType,
+                                            Path.Element childPath,
+                                            Name nodeType,
                                             Set mixins,
                                             Session session) {
         
@@ -202,8 +202,8 @@
     public static EventState childNodeAdded(NodeId parentId,
                                             Path parentPath,
                                             NodeId childId,
-                                            Path.PathElement childPath,
-                                            QName nodeType,
+                                            Path.Element childPath,
+                                            Name nodeType,
                                             Set mixins,
                                             Session session,
                                             boolean external) {
@@ -230,8 +230,8 @@
     public static EventState childNodeRemoved(NodeId parentId,
                                               Path parentPath,
                                               NodeId childId,
-                                              Path.PathElement childPath,
-                                              QName nodeType,
+                                              Path.Element childPath,
+                                              Name nodeType,
                                               Set mixins,
                                               Session session) {
 
@@ -258,8 +258,8 @@
     public static EventState childNodeRemoved(NodeId parentId,
                                               Path parentPath,
                                               NodeId childId,
-                                              Path.PathElement childPath,
-                                              QName nodeType,
+                                              Path.Element childPath,
+                                              Name nodeType,
                                               Set mixins,
                                               Session session,
                                               boolean external) {
@@ -284,8 +284,8 @@
      */
     public static EventState propertyAdded(NodeId parentId,
                                            Path parentPath,
-                                           Path.PathElement childPath,
-                                           QName nodeType,
+                                           Path.Element childPath,
+                                           Name nodeType,
                                            Set mixins,
                                            Session session) {
         
@@ -310,8 +310,8 @@
      */
     public static EventState propertyAdded(NodeId parentId,
                                            Path parentPath,
-                                           Path.PathElement childPath,
-                                           QName nodeType,
+                                           Path.Element childPath,
+                                           Name nodeType,
                                            Set mixins,
                                            Session session,
                                            boolean external) {
@@ -336,8 +336,8 @@
      */
     public static EventState propertyRemoved(NodeId parentId,
                                              Path parentPath,
-                                             Path.PathElement childPath,
-                                             QName nodeType,
+                                             Path.Element childPath,
+                                             Name nodeType,
                                              Set mixins,
                                              Session session) {
         
@@ -362,8 +362,8 @@
      */
     public static EventState propertyRemoved(NodeId parentId,
                                              Path parentPath,
-                                             Path.PathElement childPath,
-                                             QName nodeType,
+                                             Path.Element childPath,
+                                             Name nodeType,
                                              Set mixins,
                                              Session session,
                                              boolean external) {
@@ -388,8 +388,8 @@
      */
     public static EventState propertyChanged(NodeId parentId,
                                              Path parentPath,
-                                             Path.PathElement childPath,
-                                             QName nodeType,
+                                             Path.Element childPath,
+                                             Name nodeType,
                                              Set mixins,
                                              Session session) {
 
@@ -414,8 +414,8 @@
      */
     public static EventState propertyChanged(NodeId parentId,
                                              Path parentPath,
-                                             Path.PathElement childPath,
-                                             QName nodeType,
+                                             Path.Element childPath,
+                                             Name nodeType,
                                              Set mixins,
                                              Session session,
                                              boolean external) {
@@ -464,9 +464,9 @@
      * Returns the relative {@link Path} of the child
      * {@link javax.jcr.Item} associated with this event.
      *
-     * @return the <code>Path.PathElement</code> associated with this event.
+     * @return the <code>Path.Element</code> associated with this event.
      */
-    public Path.PathElement getChildRelPath() {
+    public Path.Element getChildRelPath() {
         return childRelPath;
     }
 
@@ -475,15 +475,15 @@
      *
      * @return the node type of the parent associated with this event.
      */
-    public QName getNodeType() {
+    public Name getNodeType() {
         return nodeType;
     }
 
     /**
-     * Returns a set of <code>QName</code>s which are the names of the mixins
+     * Returns a set of <code>Name</code>s which are the names of the mixins
      * assigned to the parent node associated with this event.
      *
-     * @return the mixin names as <code>QName</code>s.
+     * @return the mixin names as <code>Name</code>s.
      */
     public Set getMixinNames() {
         return mixins;
@@ -506,7 +506,7 @@
                 log.warn("Unknown node type: " + nodeType);
             }
             for (Iterator it = mixins.iterator(); it.hasNext(); ) {
-                QName mixinName = (QName) it.next();
+                Name mixinName = (Name) it.next();
                 try {
                     tmp.add(ntMgr.getNodeType(mixinName));
                 } catch (NoSuchNodeTypeException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java Tue Oct 30 03:02:41 2007
@@ -27,9 +27,10 @@
 import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.PathFactoryImpl;
+import org.apache.jackrabbit.name.PathBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -101,8 +102,8 @@
      *                   if no prefix should be used.
      */
     public EventStateCollection(EventDispatcher dispatcher,
-                         SessionImpl session,
-                         Path pathPrefix) {
+                                SessionImpl session,
+                                Path pathPrefix) {
         this.dispatcher = dispatcher;
         this.session = session;
         this.pathPrefix = pathPrefix;
@@ -234,11 +235,11 @@
                                 Path oldPath;
                                 try {
                                     if (moved.getIndex() == 0) {
-                                        oldPath = Path.create(parentPath, moved.getName(), false);
+                                        oldPath = PathFactoryImpl.getInstance().create(parentPath, moved.getName(), false);
                                     } else {
-                                        oldPath = Path.create(parentPath, moved.getName(), moved.getIndex(), false);
+                                        oldPath = PathFactoryImpl.getInstance().create(parentPath, moved.getName(), moved.getIndex(), false);
                                     }
-                                } catch (MalformedPathException e) {
+                                } catch (RepositoryException e) {
                                     // should never happen actually
                                     String msg = "Malformed path for item: " + state.getId();
                                     log.error(msg);
@@ -272,10 +273,10 @@
                     // reorder
                     for (Iterator ro = reordered.iterator(); ro.hasNext();) {
                         NodeState.ChildNodeEntry child = (NodeState.ChildNodeEntry) ro.next();
-                        QName name = child.getName();
+                        Name name = child.getName();
                         int index = (child.getIndex() != 1) ? child.getIndex() : 0;
                         Path parentPath = getPath(n.getNodeId(), hmgr);
-                        Path.PathElement addedElem = Path.create(name, index).getNameElement();
+                        Path.Element addedElem = PathFactoryImpl.getInstance().create(name, index).getNameElement();
                         // get removed index
                         NodeState overlayed = (NodeState) n.getOverlayedState();
                         NodeState.ChildNodeEntry entry = overlayed.getChildNodeEntry(child.getId());
@@ -283,7 +284,7 @@
                             throw new ItemStateException("Unable to retrieve old child index for item: " + child.getId());
                         }
                         int oldIndex = (entry.getIndex() != 1) ? entry.getIndex() : 0;
-                        Path.PathElement removedElem = Path.create(name, oldIndex).getNameElement();
+                        Path.Element removedElem = PathFactoryImpl.getInstance().create(name, oldIndex).getNameElement();
 
                         events.add(EventState.childNodeRemoved(n.getNodeId(),
                                 parentPath,
@@ -552,18 +553,14 @@
         if (pathPrefix == null) {
             return p;
         }
-        Path.PathBuilder builder = new Path.PathBuilder(pathPrefix.getElements());
-        Path.PathElement[] elements = p.getElements();
+        PathBuilder builder = new PathBuilder(pathPrefix.getElements());
+        Path.Element[] elements = p.getElements();
         for (int i = 0; i < elements.length; i++) {
             if (elements[i].denotesRoot()) {
                 continue;
             }
             builder.addLast(elements[i]);
         }
-        try {
-            return builder.getPath();
-        } catch (MalformedPathException e) {
-            throw new RepositoryException(e);
-        }
+        return builder.getPath();
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java Tue Oct 30 03:02:41 2007
@@ -21,8 +21,8 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.spi.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java Tue Oct 30 03:02:41 2007
@@ -42,7 +42,8 @@
 import org.apache.jackrabbit.core.persistence.bundle.util.BundleCache;
 import org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache;
 import org.apache.jackrabbit.core.persistence.bundle.util.HashMapIndex;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -406,12 +407,12 @@
 
         // init prop defs
         if (context.getNodeTypeRegistry() != null) {
-            idJcrUUID = context.getNodeTypeRegistry().getEffectiveNodeType(QName.MIX_REFERENCEABLE).getApplicablePropertyDef(
-                    QName.JCR_UUID, PropertyType.STRING, false).getId();
-            idJcrPrimaryType = context.getNodeTypeRegistry().getEffectiveNodeType(QName.NT_BASE).getApplicablePropertyDef(
-                    QName.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId();
-            idJcrMixinTypes = context.getNodeTypeRegistry().getEffectiveNodeType(QName.NT_BASE).getApplicablePropertyDef(
-                    QName.JCR_MIXINTYPES, PropertyType.NAME, true).getId();
+            idJcrUUID = context.getNodeTypeRegistry().getEffectiveNodeType(NameConstants.MIX_REFERENCEABLE).getApplicablePropertyDef(
+                    NameConstants.JCR_UUID, PropertyType.STRING, false).getId();
+            idJcrPrimaryType = context.getNodeTypeRegistry().getEffectiveNodeType(NameConstants.NT_BASE).getApplicablePropertyDef(
+                    NameConstants.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId();
+            idJcrMixinTypes = context.getNodeTypeRegistry().getEffectiveNodeType(NameConstants.NT_BASE).getApplicablePropertyDef(
+                    NameConstants.JCR_MIXINTYPES, PropertyType.NAME, true).getId();
         }
     }
 
@@ -443,25 +444,25 @@
         PropertyState state = bundle.createPropertyState(this, id.getName());
         if (state == null) {
             // check if autocreated property state
-            if (id.getName().equals(QName.JCR_UUID)) {
+            if (id.getName().equals(NameConstants.JCR_UUID)) {
                 state = createNew(id);
                 state.setType(PropertyType.STRING);
                 state.setDefinitionId(idJcrUUID);
                 state.setMultiValued(false);
                 state.setValues(new InternalValue[]{InternalValue.create(id.getParentId().getUUID().toString())});
-            } else if (id.getName().equals(QName.JCR_PRIMARYTYPE)) {
+            } else if (id.getName().equals(NameConstants.JCR_PRIMARYTYPE)) {
                 state = createNew(id);
                 state.setType(PropertyType.NAME);
                 state.setDefinitionId(idJcrPrimaryType);
                 state.setMultiValued(false);
                 state.setValues(new InternalValue[]{InternalValue.create(bundle.getNodeTypeName())});
-            } else if (id.getName().equals(QName.JCR_MIXINTYPES)) {
+            } else if (id.getName().equals(NameConstants.JCR_MIXINTYPES)) {
                 Set mixins = bundle.getMixinTypeNames();
                 state = createNew(id);
                 state.setType(PropertyType.NAME);
                 state.setDefinitionId(idJcrMixinTypes);
                 state.setMultiValued(true);
-                state.setValues(InternalValue.create((QName[]) mixins.toArray(new QName[mixins.size()])));
+                state.setValues(InternalValue.create((Name[]) mixins.toArray(new Name[mixins.size()])));
             } else {
                 throw new NoSuchItemStateException(id.toString());
             }
@@ -557,9 +558,9 @@
             } else {
                 PropertyId id = (PropertyId) state.getId();
                 // skip primaryType pr mixinTypes properties
-                if (id.getName().equals(QName.JCR_PRIMARYTYPE)
-                    || id.getName().equals(QName.JCR_MIXINTYPES)
-                    || id.getName().equals(QName.JCR_UUID)) {
+                if (id.getName().equals(NameConstants.JCR_PRIMARYTYPE)
+                    || id.getName().equals(NameConstants.JCR_MIXINTYPES)
+                    || id.getName().equals(NameConstants.JCR_UUID)) {
                     continue;
                 }
                 NodeId nodeId = id.getParentId();
@@ -609,9 +610,9 @@
             if (!state.isNode()) {
                 PropertyId id = (PropertyId) state.getId();
                 // skip primaryType pr mixinTypes properties
-                if (id.getName().equals(QName.JCR_PRIMARYTYPE)
-                    || id.getName().equals(QName.JCR_MIXINTYPES)
-                    || id.getName().equals(QName.JCR_UUID)) {
+                if (id.getName().equals(NameConstants.JCR_PRIMARYTYPE)
+                    || id.getName().equals(NameConstants.JCR_MIXINTYPES)
+                    || id.getName().equals(NameConstants.JCR_UUID)) {
                     continue;
                 }
                 NodeId nodeId = id.getParentId();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java Tue Oct 30 03:02:41 2007
@@ -27,8 +27,9 @@
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
@@ -89,7 +90,7 @@
         index &= 0x00ffffff;
         String uri = nsIndex.indexToString(index);
         String local = nameIndex.indexToString(in.readInt());
-        QName nodeTypeName = new QName(uri, local);
+        Name nodeTypeName = NameFactoryImpl.getInstance().create(uri, local);
 
         // primaryType
         bundle.setNodeTypeName(nodeTypeName);
@@ -102,7 +103,7 @@
 
         // mixin types
         Set mixinTypeNames = new HashSet();
-        QName name = readIndexedQName(in);
+        Name name = readIndexedQName(in);
         while (name != null) {
             mixinTypeNames.add(name);
             name = readIndexedQName(in);
@@ -154,7 +155,7 @@
             index &= 0x00ffffff;
             String uri = nsIndex.indexToString(index);
             String local = nameIndex.indexToString(in.readInt());
-            QName nodeTypeName = new QName(uri, local);
+            Name nodeTypeName = NameFactoryImpl.getInstance().create(uri, local);
 
             log.info("Serialzation Version: " + version);
             log.info("NodeTypeName: " + nodeTypeName);
@@ -177,7 +178,7 @@
             return false;
         }
         try {
-            QName mixinName = readIndexedQName(in);
+            Name mixinName = readIndexedQName(in);
             while (mixinName != null) {
                 log.info("MixinTypeName: " + mixinName);
                 mixinName = readIndexedQName(in);
@@ -187,7 +188,7 @@
             return false;
         }
         try {
-            QName propName = readIndexedQName(in);
+            Name propName = readIndexedQName(in);
             while (propName != null) {
                 log.info("PropertyName: " + propName);
                 if (!checkPropertyState(in)) {
@@ -209,7 +210,7 @@
         try {
             UUID cneUUID = readUUID(in);
             while (cneUUID != null) {
-                QName cneName = readQName(in);
+                Name cneName = readQName(in);
                 log.info("ChildNodentry: " + cneUUID + ":" + cneName);
                 cneUUID = readUUID(in);
             }
@@ -255,14 +256,14 @@
         // mixin types
         Iterator iter = bundle.getMixinTypeNames().iterator();
         while (iter.hasNext()) {
-            writeIndexedQName(out, (QName) iter.next());
+            writeIndexedQName(out, (Name) iter.next());
         }
         writeIndexedQName(out, null);
 
         // properties
         iter = bundle.getPropertyNames().iterator();
         while (iter.hasNext()) {
-            QName pName = (QName) iter.next();
+            Name pName = (Name) iter.next();
             NodePropBundle.PropertyEntry pState = bundle.getPropertyEntry(pName);
             if (pState == null) {
                 log.error("PropertyState missing in bundle: " + pName);
@@ -493,7 +494,7 @@
                     break;
                 case PropertyType.NAME:
                     try {
-                        QName name = readQName(in);
+                        Name name = readQName(in);
                         log.info("  name: " + name);
                     } catch (IOException e) {
                         log.error("Error while reading name value: " + e);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java Tue Oct 30 03:02:41 2007
@@ -25,8 +25,9 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
@@ -181,7 +182,7 @@
         int version = (index >> 24) & 0x0ff;
         String uri = nsIndex.indexToString(index & 0x0ffffff);
         String local = in.readUTF();
-        state.setNodeTypeName(new QName(uri, local));
+        state.setNodeTypeName(NameFactoryImpl.getInstance().create(uri, local));
 
         // parentUUID
         state.setParentId(readID(in));
@@ -205,7 +206,7 @@
         // child nodes (list of name/uuid pairs)
         count = in.readInt();   // count
         for (int i = 0; i < count; i++) {
-            QName name = readQName(in);
+            Name name = readQName(in);
             NodeId parentId = readID(in);
             state.addChildNodeEntry(name, parentId);
         }
@@ -236,13 +237,13 @@
         Collection c = state.getMixinTypeNames();
         out.writeInt(c.size()); // count
         for (Iterator iter = c.iterator(); iter.hasNext();) {
-            writeQName(out, (QName) iter.next());
+            writeQName(out, (Name) iter.next());
         }
         // properties (names)
         c = state.getPropertyNames();
         out.writeInt(c.size()); // count
         for (Iterator iter = c.iterator(); iter.hasNext();) {
-            QName pName = (QName) iter.next();
+            Name pName = (Name) iter.next();
             writeIndexedQName(out, pName);
         }
         // child nodes (list of name/uuid pairs)
@@ -340,15 +341,15 @@
     }
 
     /**
-     * Deserializes a QName
+     * Deserializes a Name
      * @param in the input stream
      * @return the qname
      * @throws IOException in an I/O error occurs.
      */
-    public QName readQName(DataInputStream in) throws IOException {
+    public Name readQName(DataInputStream in) throws IOException {
         String uri = nsIndex.indexToString(in.readInt());
         String local = in.readUTF();
-        return new QName(uri, local);
+        return NameFactoryImpl.getInstance().create(uri, local);
     }
 
     /**
@@ -372,40 +373,40 @@
     }
 
     /**
-     * Serializes a QName
+     * Serializes a Name
      * @param out the output stream
      * @param name the name
      * @throws IOException in an I/O error occurs.
      */
-    public void writeQName(DataOutputStream out, QName name) throws IOException {
+    public void writeQName(DataOutputStream out, Name name) throws IOException {
         out.writeInt(nsIndex.stringToIndex(name.getNamespaceURI()));
         out.writeUTF(name.getLocalName());
     }
 
     /**
-     * Deserializes an indexed QName
+     * Deserializes an indexed Name
      * @param in the input stream
      * @return the qname
      * @throws IOException in an I/O error occurs.
      */
-    public QName readIndexedQName(DataInputStream in) throws IOException {
+    public Name readIndexedQName(DataInputStream in) throws IOException {
         int index = in.readInt();
         if (index < 0) {
             return null;
         } else {
             String uri = nsIndex.indexToString(index);
             String local = nameIndex.indexToString(in.readInt());
-            return new QName(uri, local);
+            return NameFactoryImpl.getInstance().create(uri, local);
         }
     }
 
     /**
-     * Serializes a indexed QName
+     * Serializes a indexed Name
      * @param out the output stream
      * @param name the name
      * @throws IOException in an I/O error occurs.
      */
-    public void writeIndexedQName(DataOutputStream out, QName name) throws IOException {
+    public void writeIndexedQName(DataOutputStream out, Name name) throws IOException {
         if (name == null) {
             out.writeInt(-1);
         } else {
@@ -433,7 +434,7 @@
      */
     public PropertyId readPropertyId(DataInputStream in) throws IOException {
         UUID uuid = readUUID(in);
-        QName name = readQName(in);
+        Name name = readQName(in);
         return new PropertyId(new NodeId(uuid), name);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NodePropBundle.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NodePropBundle.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NodePropBundle.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NodePropBundle.java Tue Oct 30 03:02:41 2007
@@ -33,7 +33,8 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 /**
  * This Class provides a simple structure to hold the nodestate and related
@@ -57,7 +58,7 @@
     /**
      * the nodetype name
      */
-    private QName nodeTypeName;
+    private Name nodeTypeName;
 
     /**
      * the mixintype names
@@ -129,7 +130,7 @@
         nodeTypeName = state.getNodeTypeName();
         mixinTypeNames = state.getMixinTypeNames();
         nodeDefId = state.getDefinitionId();
-        isReferenceable = state.hasPropertyName(QName.JCR_UUID);
+        isReferenceable = state.hasPropertyName(NameConstants.JCR_UUID);
         modCount = state.getModCount();
         List list = state.getChildNodeEntries();
         Iterator iter = list.iterator();
@@ -160,13 +161,13 @@
         state.setPropertyNames(properties.keySet());
 
         // add fake property entries
-        state.addPropertyName(QName.JCR_PRIMARYTYPE);
+        state.addPropertyName(NameConstants.JCR_PRIMARYTYPE);
         if (mixinTypeNames.size()>0) {
-            state.addPropertyName(QName.JCR_MIXINTYPES);
+            state.addPropertyName(NameConstants.JCR_MIXINTYPES);
         }
         // uuid is special...only if 'referenceable'
         if (isReferenceable) {
-            state.addPropertyName(QName.JCR_UUID);
+            state.addPropertyName(NameConstants.JCR_UUID);
         }
 
         return state;
@@ -178,7 +179,7 @@
      * @param name the name of the new property
      * @return the new property state
      */
-    public PropertyState createPropertyState(PersistenceManager pMgr, QName name) {
+    public PropertyState createPropertyState(PersistenceManager pMgr, Name name) {
         PropertyEntry p = getPropertyEntry(name);
         if (p == null) {
             return null;
@@ -236,7 +237,7 @@
      * Returns the nodetype name of this bundle
      * @return the nodetype name of this bundle
      */
-    public QName getNodeTypeName() {
+    public Name getNodeTypeName() {
         return nodeTypeName;
     }
 
@@ -244,7 +245,7 @@
      * Sets the node type name
      * @param nodeTypeName the nodetype name
      */
-    public void setNodeTypeName(QName nodeTypeName) {
+    public void setNodeTypeName(Name nodeTypeName) {
         this.nodeTypeName = nodeTypeName;
     }
 
@@ -326,7 +327,7 @@
      * @param name the name of the entry.
      * @param id the id of the entry
      */
-    public void addChildNodeEntry(QName name, NodeId id) {
+    public void addChildNodeEntry(Name name, NodeId id) {
         childNodeEntries.add(new ChildNodeEntry(name, id));
     }
 
@@ -355,11 +356,11 @@
      * @return <code>true</code> if the property exists;
      *         <code>false</code> otherwise.
      */
-    public boolean hasProperty(QName name) {
+    public boolean hasProperty(Name name) {
         return properties.containsKey(name)
-                || name.equals(QName.JCR_PRIMARYTYPE)
-                || (isReferenceable && name.equals(QName.JCR_UUID))
-                || (mixinTypeNames.size()>0 && name.equals(QName.JCR_MIXINTYPES));
+                || name.equals(NameConstants.JCR_PRIMARYTYPE)
+                || (isReferenceable && name.equals(NameConstants.JCR_UUID))
+                || (mixinTypeNames.size()>0 && name.equals(NameConstants.JCR_MIXINTYPES));
     }
 
     /**
@@ -383,7 +384,7 @@
      * @param name the name of the property entry
      * @return the desired property entry or <code>null</code>
      */
-    public PropertyEntry getPropertyEntry(QName name) {
+    public PropertyEntry getPropertyEntry(Name name) {
         return (PropertyEntry) properties.get(name);
     }
 
@@ -393,7 +394,7 @@
     public void removeAllProperties() {
         Iterator iter = properties.keySet().iterator();
         while (iter.hasNext()) {
-            QName name = (QName) iter.next();
+            Name name = (Name) iter.next();
             removeProperty(name);
             iter = properties.keySet().iterator();
         }
@@ -403,7 +404,7 @@
      * Removes the proprty with the given name from this bundle.
      * @param name the name of the property
      */
-    public void removeProperty(QName name) {
+    public void removeProperty(Name name) {
         PropertyEntry pe = (PropertyEntry) properties.remove(name);
         if (pe != null) {
             pe.destroy();
@@ -452,7 +453,7 @@
         /**
          * the name of the entry
          */
-        private final QName name;
+        private final Name name;
 
         /**
          * the id of the entry
@@ -464,7 +465,7 @@
          * @param name the name
          * @param id the id
          */
-        public ChildNodeEntry(QName name, NodeId id) {
+        public ChildNodeEntry(Name name, NodeId id) {
             this.name = name;
             this.id = id;
         }
@@ -473,7 +474,7 @@
          * Returns the name.
          * @return the name.
          */
-        public QName getName() {
+        public Name getName() {
             return name;
         }
 
@@ -565,7 +566,7 @@
          * Returns the property name
          * @return the property name
          */
-        public QName getName() {
+        public Name getName() {
             return id.getName();
         }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java Tue Oct 30 03:02:41 2007
@@ -36,7 +36,7 @@
 import org.apache.jackrabbit.core.persistence.util.Serializer;
 import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -147,7 +147,7 @@
         this.persistent = Boolean.valueOf(persistent).booleanValue();
     }
 
-    protected static String buildBlobFilePath(String parentUUID, QName propName, int index) {
+    protected static String buildBlobFilePath(String parentUUID, Name propName, int index) {
         StringBuffer sb = new StringBuffer();
         char[] chars = parentUUID.toCharArray();
         int cnt = 0;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java Tue Oct 30 03:02:41 2007
@@ -26,8 +26,9 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 
 import javax.jcr.PropertyType;
 import java.io.DataInputStream;
@@ -94,7 +95,7 @@
         c = state.getPropertyNames();
         out.writeInt(c.size()); // count
         for (Iterator iter = c.iterator(); iter.hasNext();) {
-            QName propName = (QName) iter.next();
+            Name propName = (Name) iter.next();
             out.writeUTF(propName.toString());   // name
         }
         // child nodes (list of name/uuid pairs)
@@ -122,7 +123,7 @@
 
         // primaryType
         String s = in.readUTF();
-        state.setNodeTypeName(QName.valueOf(s));
+        state.setNodeTypeName(NameFactoryImpl.getInstance().create(s));
         // parentUUID (may be null)
         byte[] uuidBytes = new byte[UUID.UUID_BYTE_LENGTH];
         in.readFully(uuidBytes);
@@ -136,7 +137,7 @@
         int count = in.readInt();   // count
         Set set = new HashSet(count);
         for (int i = 0; i < count; i++) {
-            set.add(QName.valueOf(in.readUTF())); // name
+            set.add(NameFactoryImpl.getInstance().create(in.readUTF())); // name
         }
         if (set.size() > 0) {
             state.setMixinTypeNames(set);
@@ -147,12 +148,12 @@
         // properties (names)
         count = in.readInt();   // count
         for (int i = 0; i < count; i++) {
-            state.addPropertyName(QName.valueOf(in.readUTF())); // name
+            state.addPropertyName(NameFactoryImpl.getInstance().create(in.readUTF())); // name
         }
         // child nodes (list of name/uuid pairs)
         count = in.readInt();   // count
         for (int i = 0; i < count; i++) {
-            QName name = QName.valueOf(in.readUTF());    // name
+            Name name = NameFactoryImpl.getInstance().create(in.readUTF());    // name
             // uuid
             in.readFully(uuidBytes);
             state.addChildNodeEntry(name, new NodeId(new UUID(uuidBytes)));

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java Tue Oct 30 03:02:41 2007
@@ -39,8 +39,10 @@
 import org.apache.jackrabbit.core.util.DOMWalker;
 import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.util.Text;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -129,11 +131,14 @@
      */
     private String nodePathTemplate = "xxxx/xxxx/xxxxxxxxxxxxxxxxxxxxxxxx";
 
+    private final NameFactory factory;
+
     /**
      * Creates a new <code>XMLPersistenceManager</code> instance.
      */
     public XMLPersistenceManager() {
         initialized = false;
+        factory = NameFactoryImpl.getInstance();
     }
 
     /**
@@ -225,7 +230,7 @@
         }
         // check nodetype
         String ntName = walker.getAttribute(NODETYPE_ATTRIBUTE);
-        if (!QName.valueOf(ntName).equals(state.getNodeTypeName())) {
+        if (!factory.create(ntName).equals(state.getNodeTypeName())) {
             String msg = "invalid serialized state: nodetype mismatch";
             log.debug(msg);
             throw new ItemStateException(msg);
@@ -251,7 +256,7 @@
         if (walker.enterElement(MIXINTYPES_ELEMENT)) {
             Set mixins = new HashSet();
             while (walker.iterateElements(MIXINTYPE_ELEMENT)) {
-                mixins.add(QName.valueOf(walker.getAttribute(NAME_ATTRIBUTE)));
+                mixins.add(factory.create(walker.getAttribute(NAME_ATTRIBUTE)));
             }
             if (mixins.size() > 0) {
                 state.setMixinTypeNames(mixins);
@@ -264,7 +269,7 @@
             while (walker.iterateElements(PROPERTY_ELEMENT)) {
                 String propName = walker.getAttribute(NAME_ATTRIBUTE);
                 // @todo deserialize type and values
-                state.addPropertyName(QName.valueOf(propName));
+                state.addPropertyName(factory.create(propName));
             }
             walker.leaveElement();
         }
@@ -274,7 +279,7 @@
             while (walker.iterateElements(NODE_ELEMENT)) {
                 String childName = walker.getAttribute(NAME_ATTRIBUTE);
                 String childUUID = walker.getAttribute(UUID_ATTRIBUTE);
-                state.addChildNodeEntry(QName.valueOf(childName), NodeId.valueOf(childUUID));
+                state.addChildNodeEntry(factory.create(childName), NodeId.valueOf(childUUID));
             }
             walker.leaveElement();
         }
@@ -290,7 +295,7 @@
             throw new ItemStateException(msg);
         }
         // check name
-        if (!state.getName().equals(QName.valueOf(walker.getAttribute(NAME_ATTRIBUTE)))) {
+        if (!state.getName().equals(factory.create(walker.getAttribute(NAME_ATTRIBUTE)))) {
             String msg = "invalid serialized state: name mismatch";
             log.debug(msg);
             throw new ItemStateException(msg);
@@ -479,7 +484,7 @@
                 String ntName = walker.getAttribute(NODETYPE_ATTRIBUTE);
 
                 NodeState state = createNew(id);
-                state.setNodeTypeName(QName.valueOf(ntName));
+                state.setNodeTypeName(factory.create(ntName));
                 readState(walker, state);
                 return state;
             } finally {
@@ -582,7 +587,7 @@
                 writer.write("\t<" + PROPERTIES_ELEMENT + ">\n");
                 iter = state.getPropertyNames().iterator();
                 while (iter.hasNext()) {
-                    QName propName = (QName) iter.next();
+                    Name propName = (Name) iter.next();
                     writer.write("\t\t<" + PROPERTY_ELEMENT + " "
                             + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(propName.toString()) + "\">\n");
                     // @todo serialize type, definition id and values

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DefaultQueryNodeFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DefaultQueryNodeFactory.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DefaultQueryNodeFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DefaultQueryNodeFactory.java Tue Oct 30 03:02:41 2007
@@ -18,7 +18,7 @@
 
 import java.util.List;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Default implementetation of a {@link QueryNodeFactory}.
@@ -43,7 +43,7 @@
      * {@inheritDoc}
      */
     public NodeTypeQueryNode createNodeTypeQueryNode(QueryNode parent,
-                                                     QName nodeType) {
+                                                     Name nodeType) {
         return new NodeTypeQueryNode(parent, nodeType);
     }
 
@@ -65,7 +65,7 @@
      * {@inheritDoc}
      */
     public DerefQueryNode createDerefQueryNode(QueryNode parent,
-                                               QName nameTest,
+                                               Name nameTest,
                                                boolean descendants) {
         return new DerefQueryNode(parent, nameTest, descendants);
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DerefQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DerefQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DerefQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/DerefQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Represents query node that dereferences a reference property into a node and
@@ -25,7 +25,7 @@
 public class DerefQueryNode extends LocationStepQueryNode {
 
     /** The name of the reference property */
-    private QName refProperty;
+    private Name refProperty;
 
     /**
      * Creates a new <code>DerefQueryNode</code> without a name set for the
@@ -36,7 +36,7 @@
      * @param descendants if <code>true</code> this location step uses the
      *   descendant-or-self axis; otherwise the child axis.
      */
-    protected DerefQueryNode(QueryNode parent, QName nameTest, boolean descendants) {
+    protected DerefQueryNode(QueryNode parent, Name nameTest, boolean descendants) {
         super(parent);
         setNameTest(nameTest);
         setIncludeDescendants(descendants);
@@ -46,7 +46,7 @@
      * Sets a new name for the reference property.
      * @param propertyName the name of the reference property.
      */
-    public void setRefProperty(QName propertyName) {
+    public void setRefProperty(Name propertyName) {
         refProperty = propertyName;
     }
 
@@ -56,7 +56,7 @@
      * @return the name of the reference property or <code>null</code> if
      * none is set.
      */
-    public QName getRefProperty() {
+    public Name getRefProperty() {
         return refProperty;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExactQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExactQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExactQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExactQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Implements a query node that defines an exact match of a property and a
@@ -27,12 +27,12 @@
     /**
      * The name of the property to match
      */
-    private final QName property;
+    private final Name property;
 
     /**
      * The value of the property to match
      */
-    private final QName value;
+    private final Name value;
 
     /**
      * Creates a new <code>ExactQueryNode</code> instance.
@@ -41,7 +41,7 @@
      * @param property the name of the property to match.
      * @param value    the value of the property to match.
      */
-    public ExactQueryNode(QueryNode parent, QName property, QName value) {
+    public ExactQueryNode(QueryNode parent, Name property, Name value) {
         super(parent);
         if (parent == null) {
             throw new NullPointerException("parent");
@@ -69,7 +69,7 @@
      *
      * @return the name of the property to match.
      */
-    public QName getPropertyName() {
+    public Name getPropertyName() {
         return property;
     }
 
@@ -78,7 +78,7 @@
      *
      * @return the value of the property to match.
      */
-    public QName getValue() {
+    public Name getValue() {
         return value;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExecutablePreparedQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExecutablePreparedQuery.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExecutablePreparedQuery.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ExecutablePreparedQuery.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.Value;
 import javax.jcr.RepositoryException;
@@ -37,6 +37,6 @@
      *                                       valid variable in this query.
      * @throws javax.jcr.RepositoryException if an error occurs.
      */
-    public void bindValue(QName varName, Value value)
+    public void bindValue(Name varName, Value value)
             throws IllegalArgumentException, RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/LocationStepQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/LocationStepQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/LocationStepQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/LocationStepQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,8 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Defines a location step for querying the path of a node.
@@ -42,7 +43,7 @@
      * specific constant as the empty name is not a valid JCR name.
      * TODO: The root location step should be refactored somehow
      */
-    public static final QName EMPTY_NAME = new QName("", "");
+    public static final Name EMPTY_NAME = NameFactoryImpl.getInstance().create("", "");
 
     /** Empty <code>QueryNode</code> array for us as return value */
     private static final QueryNode[] EMPTY = new QueryNode[0];
@@ -51,7 +52,7 @@
      * Name test for this location step. A <code>null</code> value indicates
      * a '*' name test.
      */
-    private QName nameTest;
+    private Name nameTest;
 
     /**
      * If set to <code>true</code> this location step uses the descendant-or-self
@@ -80,7 +81,7 @@
      * if the name test is '*'.
      * @return the label of the node for this location step.
      */
-    public QName getNameTest() {
+    public Name getNameTest() {
         return nameTest;
     }
 
@@ -88,7 +89,7 @@
      * Sets a new name test.
      * @param nameTest the name test or <code>null</code> to match all names.
      */
-    public void setNameTest(QName nameTest) {
+    public void setNameTest(Name nameTest) {
         this.nameTest = nameTest;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,8 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Implements a query node that defines a node type match.
@@ -29,11 +30,11 @@
      * @param parent   the parent node for this query node.
      * @param nodeType the name of the node type.
      */
-    protected NodeTypeQueryNode(QueryNode parent, QName nodeType) {
+    protected NodeTypeQueryNode(QueryNode parent, Name nodeType) {
         // we only use the jcr primary type as a dummy value
         // the property name is actually replaced in the query builder
         // when the runtime query is created to search the index.
-        super(parent, QName.JCR_PRIMARYTYPE, nodeType);
+        super(parent, NameConstants.JCR_PRIMARYTYPE, nodeType);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OrderQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OrderQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OrderQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OrderQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.jackrabbit.spi.Name;
+
 /**
  * Implements a query node that defines the order of nodes according to the
  * values of properties.
@@ -58,7 +58,7 @@
      * @param ascending if <code>true</code> values of this properties are
      *                  ordered ascending; descending if <code>false</code>.
      */
-    public void addOrderSpec(QName property, boolean ascending) {
+    public void addOrderSpec(Name property, boolean ascending) {
         specs.add(new OrderSpec(property, ascending));
     }
 
@@ -123,7 +123,7 @@
         /**
          * The name of the property
          */
-        private QName property;
+        private Name property;
 
         /**
          * If <code>true</code> this property is orderd ascending
@@ -137,7 +137,7 @@
          * @param ascending if <code>true</code> the property is ordered
          *                  ascending, otherwise descending.
          */
-        public OrderSpec(QName property, boolean ascending) {
+        public OrderSpec(Name property, boolean ascending) {
             this.property = property;
             this.ascending = ascending;
         }
@@ -147,7 +147,7 @@
          *
          * @return the name of the property.
          */
-        public QName getProperty() {
+        public Name getProperty() {
             return property;
         }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PathQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PathQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PathQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PathQueryNode.java Tue Oct 30 03:02:41 2007
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Implements a query node that defines a path restriction.
@@ -52,7 +53,7 @@
     }
 
     /**
-     * Returns a list of valid node types under /jcr:system. List&lt;QName>.
+     * Returns a list of valid node types under /jcr:system. List&lt;Name>.
      *
      * @return a list of valid node types under /jcr:system.
      */
@@ -142,7 +143,7 @@
             return true;
         }
 
-        QName firstPathStepName = pathSteps[0].getNameTest();
+        Name firstPathStepName = pathSteps[0].getNameTest();
         if (firstPathStepName == null) {
             // If the first operand of the path steps is a node type query
             // we do not need to include the system index if the node type is
@@ -163,7 +164,7 @@
         
         // Calculate the first workspace relative location step
         LocationStepQueryNode firstWorkspaceRelativeStep = pathSteps[0];
-        if (firstPathStepName.equals(QName.ROOT)) {
+        if (firstPathStepName.equals(NameConstants.ROOT)) {
             // path starts with "/jcr:root"
             if (pathSteps.length > 1) {
                 firstWorkspaceRelativeStep = pathSteps[1];
@@ -176,9 +177,9 @@
 
         // If the first workspace relative location step is jcr:system we need 
         // to include the system tree
-        QName firstWorkspaceRelativeName = firstWorkspaceRelativeStep.getNameTest();
+        Name firstWorkspaceRelativeName = firstWorkspaceRelativeStep.getNameTest();
         if (firstWorkspaceRelativeName == null
-                || firstWorkspaceRelativeName.equals(QName.JCR_SYSTEM)) {
+                || firstWorkspaceRelativeName.equals(NameConstants.JCR_SYSTEM)) {
             return true;
         }
         

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java Tue Oct 30 03:02:41 2007
@@ -20,8 +20,8 @@
 import org.apache.jackrabbit.core.query.qom.QueryObjectModelTree;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.ItemManager;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.Value;
 import javax.jcr.RepositoryException;
@@ -73,11 +73,11 @@
         this.node = node;
         this.handler = handler;
 
-        if (!node.isNodeType(session.getJCRName(QName.NT_QUERY))) {
+        if (!node.isNodeType(session.getJCRName(NameConstants.NT_QUERY))) {
             throw new InvalidQueryException("node is not of type nt:query");
         }
-        this.statement = node.getProperty(session.getJCRName(QName.JCR_STATEMENT)).getString();
-        this.language = node.getProperty(session.getJCRName(QName.JCR_LANGUAGE)).getString();
+        this.statement = node.getProperty(session.getJCRName(NameConstants.JCR_STATEMENT)).getString();
+        this.language = node.getProperty(session.getJCRName(NameConstants.JCR_LANGUAGE)).getString();
         setExecutableQuery(handler.createExecutablePreparedQuery(
                 session, itemMgr, createQOMTree(statement, language)));
         setInitialized();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java Tue Oct 30 03:02:41 2007
@@ -20,7 +20,7 @@
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistryListener;
 import org.apache.jackrabbit.core.nodetype.PropDef;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,7 +52,7 @@
     /** The NodeTypeRegistry */
     private final NodeTypeRegistry registry;
 
-    /** Property QName to TypeMapping[] mapping */
+    /** Property Name to TypeMapping[] mapping */
     private final Map typeMapping = new HashMap();
 
     /**
@@ -73,7 +73,7 @@
      * @param propName the name of the property.
      * @return an array of <code>TypeMapping</code> instances.
      */
-    public TypeMapping[] getPropertyTypes(QName propName) {
+    public TypeMapping[] getPropertyTypes(Name propName) {
         synchronized (typeMapping) {
             TypeMapping[] types = (TypeMapping[]) typeMapping.get(propName);
             if (types != null) {
@@ -84,7 +84,7 @@
         }
     }
 
-    public void nodeTypeRegistered(QName ntName) {
+    public void nodeTypeRegistered(Name ntName) {
         try {
             NodeTypeDef def = registry.getNodeTypeDef(ntName);
             PropDef[] propDefs = def.getPropertyDefs();
@@ -92,7 +92,7 @@
                 for (int i = 0; i < propDefs.length; i++) {
                     int type = propDefs[i].getRequiredType();
                     if (!propDefs[i].definesResidual() && type != PropertyType.UNDEFINED) {
-                        QName name = propDefs[i].getName();
+                        Name name = propDefs[i].getName();
                         // only remember defined property types
                         TypeMapping[] types = (TypeMapping[]) typeMapping.get(name);
                         if (types == null) {
@@ -112,17 +112,17 @@
         }
     }
 
-    public void nodeTypeReRegistered(QName ntName) {
+    public void nodeTypeReRegistered(Name ntName) {
         nodeTypeUnregistered(ntName);
         nodeTypeRegistered(ntName);
     }
 
-    public void nodeTypeUnregistered(QName ntName) {
+    public void nodeTypeUnregistered(Name ntName) {
         // remove all TypeMapping instances refering to this ntName
         synchronized (typeMapping) {
             Map modified = new HashMap();
             for (Iterator it = typeMapping.keySet().iterator(); it.hasNext();) {
-                QName propName = (QName) it.next();
+                Name propName = (Name) it.next();
                 TypeMapping[] mapping = (TypeMapping[]) typeMapping.get(propName);
                 List remove = null;
                 for (int i = 0; i < mapping.length; i++) {
@@ -156,7 +156,7 @@
      * from the {@link org.apache.jackrabbit.core.nodetype.NodeTypeRegistry}.
      */
     private void fillCache() {
-        QName[] ntNames = registry.getRegisteredNodeTypes();
+        Name[] ntNames = registry.getRegisteredNodeTypes();
         for (int i = 0; i < ntNames.length; i++) {
             nodeTypeRegistered(ntNames[i]);
         }
@@ -167,13 +167,13 @@
         /** The property type as an integer */
         public final int type;
 
-        /** The QName of the node type where this type mapping originated */
-        final QName ntName;
+        /** The Name of the node type where this type mapping originated */
+        final Name ntName;
 
         /** True if the property type is multi-valued */
         public final boolean isMultiValued;
 
-        private TypeMapping(QName ntName, int type, boolean isMultiValued) {
+        private TypeMapping(Name ntName, int type, boolean isMultiValued) {
             this.type = type;
             this.ntName = ntName;
             this.isMultiValued = isMultiValued;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java Tue Oct 30 03:02:41 2007
@@ -18,9 +18,8 @@
 
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.spi.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,6 +34,7 @@
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.QueryResult;
 import org.apache.jackrabbit.core.query.qom.QueryObjectModelTree;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.version.VersionException;
 import java.text.NumberFormat;
@@ -141,11 +141,11 @@
         this.node = node;
         this.handler = handler;
 
-        if (!node.isNodeType(session.getJCRName(QName.NT_QUERY))) {
+        if (!node.isNodeType(session.getJCRName(NameConstants.NT_QUERY))) {
             throw new InvalidQueryException("node is not of type nt:query");
         }
-        statement = node.getProperty(session.getJCRName(QName.JCR_STATEMENT)).getString();
-        language = node.getProperty(session.getJCRName(QName.JCR_LANGUAGE)).getString();
+        statement = node.getProperty(session.getJCRName(NameConstants.JCR_STATEMENT)).getString();
+        language = node.getProperty(session.getJCRName(NameConstants.JCR_LANGUAGE)).getString();
         query = handler.createExecutableQuery(session, itemMgr, statement, language);
         setInitialized();
     }
@@ -234,10 +234,10 @@
 
             String relPath = session.getJCRPath(p).substring(1);
             Node queryNode = session.getRootNode().addNode(
-                    relPath, session.getJCRName(QName.NT_QUERY));
+                    relPath, session.getJCRName(NameConstants.NT_QUERY));
             // set properties
-            queryNode.setProperty(session.getJCRName(QName.JCR_LANGUAGE), language);
-            queryNode.setProperty(session.getJCRName(QName.JCR_STATEMENT), statement);
+            queryNode.setProperty(session.getJCRName(NameConstants.JCR_LANGUAGE), language);
+            queryNode.setProperty(session.getJCRName(NameConstants.JCR_STATEMENT), statement);
             node = queryNode;
             return node;
         } catch (NameException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryNodeFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryNodeFactory.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryNodeFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryNodeFactory.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * A factory for {@link QueryNode}s.
@@ -31,7 +31,7 @@
      * @return a {@link NodeTypeQueryNode}.
      */
     public NodeTypeQueryNode createNodeTypeQueryNode(
-            QueryNode parent, QName nodeType);
+            QueryNode parent, Name nodeType);
 
     /**
      * Creates a {@link AndQueryNode} instance.
@@ -60,7 +60,7 @@
      * @return a {@link DerefQueryNode}.
      */
     public DerefQueryNode createDerefQueryNode(
-            QueryNode parent, QName nameTest, boolean descendants);
+            QueryNode parent, Name nameTest, boolean descendants);
 
     /**
      * Creates a {@link NotQueryNode} instance.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryParser.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryParser.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryParser.java Tue Oct 30 03:02:41 2007
@@ -16,10 +16,11 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
 
 import javax.jcr.query.InvalidQueryException;
 
+import org.apache.jackrabbit.conversion.NameResolver;
+
 /**
  * This class acts as the central entry point for parsing query statements from
  * different query syntaxes into a query tree.
@@ -48,7 +49,7 @@
      */
     public static QueryRootNode parse(String statement,
                                       String language,
-                                      NamespaceResolver resolver,
+                                      NameResolver resolver,
                                       QueryNodeFactory factory)
             throws InvalidQueryException {
 
@@ -77,7 +78,7 @@
      */
     public static String toString(QueryRootNode root,
                                   String language,
-                                  NamespaceResolver resolver)
+                                  NameResolver resolver)
             throws InvalidQueryException {
 
         QueryTreeBuilder builder = QueryTreeBuilderRegistry.getQueryTreeBuilder(language);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryRootNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryRootNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryRootNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryRootNode.java Tue Oct 30 03:02:41 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.jackrabbit.spi.Name;
+
 /**
  * Implements the root node of a query tree.
  */
@@ -32,7 +32,7 @@
     private PathQueryNode locationNode;
 
     /**
-     * The list of property names (as {@link org.apache.jackrabbit.name.QName}s
+     * The list of property names (as {@link org.apache.jackrabbit.spi.Name}s
      * to select.
      */
     private List selectProperties = new ArrayList();
@@ -74,7 +74,7 @@
      *
      * @param propName the name of the property to select.
      */
-    public void addSelectProperty(QName propName) {
+    public void addSelectProperty(Name propName) {
         selectProperties.add(propName);
     }
 
@@ -83,8 +83,8 @@
      *
      * @return an array of select properties.
      */
-    public QName[] getSelectProperties() {
-        return (QName[]) selectProperties.toArray(new QName[selectProperties.size()]);
+    public Name[] getSelectProperties() {
+        return (Name[]) selectProperties.toArray(new Name[selectProperties.size()]);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeBuilder.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeBuilder.java Tue Oct 30 03:02:41 2007
@@ -16,10 +16,10 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
-
 import javax.jcr.query.InvalidQueryException;
 
+import org.apache.jackrabbit.conversion.NameResolver;
+
 /**
  * Specifies an interface for a query tree builder.
  */
@@ -30,14 +30,14 @@
      * query node factory.
      *
      * @param statement the statement.
-     * @param resolver  the namespace resolver to use.
+     * @param resolver  the name resolver to use.
      * @param factory   the query node factory to use.
      * @return the <code>QueryNode</code> tree for the statement.
      * @throws javax.jcr.query.InvalidQueryException
      *          if the statement is malformed.
      */
     QueryRootNode createQueryTree(String statement,
-                                  NamespaceResolver resolver,
+                                  NameResolver resolver,
                                   QueryNodeFactory factory)
             throws InvalidQueryException;
 
@@ -50,7 +50,7 @@
      *         <code>false</code> otherwise.
      */
     boolean canHandle(String language);
-    
+
     /**
      * Returns the set of query languages supported by this builder.
      * 
@@ -63,13 +63,13 @@
      * <code>QueryTreeBuilder</code> can handle.
      *
      * @param root     the root of the query node tree.
-     * @param resolver to resolve QNames.
+     * @param resolver to resolve Names.
      * @return a String representation of the query node tree.
      * @throws InvalidQueryException if the query node tree cannot be converted
      *                               into a String representation due to
      *                               restrictions in this syntax.
      */
-    String toString(QueryRootNode root, NamespaceResolver resolver)
+    String toString(QueryRootNode root, NameResolver resolver)
             throws InvalidQueryException;
 
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java Tue Oct 30 03:02:41 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
-
 import java.util.Arrays;
 
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+
 /**
  * Utility class to dump a {@link QueryNode} tree to a StringBuffer.
  */
@@ -68,7 +68,7 @@
         buffer.append("+ Root node");
         buffer.append("\n");
         // select properties
-        QName[] select = node.getSelectProperties();
+        Name[] select = node.getSelectProperties();
         buffer.append("+ Select properties: ");
         if (select.length == 0) {
             buffer.append("*");
@@ -147,7 +147,7 @@
         if (relPath == null) {
             buffer.append(".");
         } else {
-            Path.PathElement[] elements = relPath.getElements();
+            Path.Element[] elements = relPath.getElements();
             String slash = "";
             for (int i = 0; i < elements.length; i++) {
                 buffer.append(slash);
@@ -246,7 +246,7 @@
         if (relPath == null) {
             buffer.append(relPath);
         } else {
-            Path.PathElement[] elements = relPath.getElements();
+            Path.Element[] elements = relPath.getElements();
             String slash = "";
             for (int i = 0; i < elements.length; i++) {
                 buffer.append(slash);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/RelationQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/RelationQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/RelationQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/RelationQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,12 +16,16 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.MalformedPathException;
-
 import java.util.Date;
 
+import javax.jcr.RepositoryException;
+
+import org.apache.jackrabbit.conversion.MalformedPathException;
+import org.apache.jackrabbit.name.NameFactoryImpl;
+import org.apache.jackrabbit.name.PathBuilder;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+
 /**
  * Implements a query node that defines property value relation.
  */
@@ -29,10 +33,10 @@
 
     /**
      * Acts as an syntetic placeholder for a location step that matches any
-     * name. This is required becase a JCR path does not allow a QName with
+     * name. This is required becase a JCR path does not allow a Name with
      * a single '*' (star) character.
      */
-    public static final QName STAR_NAME_TEST = new QName(QName.NS_REP_URI, "__star__");
+    public static final Name STAR_NAME_TEST = NameFactoryImpl.getInstance().create(Name.NS_REP_URI, "__star__");
 
     /**
      * The relative path to the property.
@@ -141,7 +145,7 @@
      * @return the name of the property in this relation query node.
      * @deprecated Use {@link #getRelativePath()} instead.
      */
-    public QName getProperty() {
+    public Name getProperty() {
         return relPath == null ? null : relPath.getNameElement().getName();
     }
 
@@ -151,8 +155,8 @@
      * @param name the new property name.
      * @deprecated Use {@link #setRelativePath(Path)} instead.
      */
-    public void setProperty(QName name) {
-        Path.PathBuilder builder = new Path.PathBuilder();
+    public void setProperty(Name name) {
+        PathBuilder builder = new PathBuilder();
         builder.addLast(name);
         try {
             this.relPath = builder.getPath();
@@ -187,21 +191,22 @@
      *
      * @param element the path element to append.
      */
-    public void addPathElement(Path.PathElement element) {
-        Path.PathBuilder builder = new Path.PathBuilder();
+    public void addPathElement(Path.Element element) {
+        PathBuilder builder = new PathBuilder();
         if (relPath != null) {
             builder.addAll(relPath.getElements());
         }
         builder.addLast(element);
         try {
             relPath = builder.getPath();
-        } catch (MalformedPathException e) {
+        } 
+        catch (MalformedPathException e) {
             // path is always valid
         }
         // try to normalize the path
         try {
-            relPath = relPath.getNormalizedPath();
-        } catch (MalformedPathException e) {
+          relPath = relPath.getNormalizedPath();
+        } catch (RepositoryException e) {
             // just keep the original in that case
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/TextsearchQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/TextsearchQueryNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/TextsearchQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/TextsearchQueryNode.java Tue Oct 30 03:02:41 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.conversion.MalformedPathException;
+import org.apache.jackrabbit.name.PathBuilder;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * Implements a query node that defines a textsearch clause.
@@ -94,7 +95,7 @@
      * @return property name or <code>null</code>.
      * @deprecated Use {@link #getRelativePath()} instead.
      */
-    public QName getPropertyName() {
+    public Name getPropertyName() {
         return relPath == null ? null : relPath.getNameElement().getName();
     }
 
@@ -104,8 +105,8 @@
      * @param property the name of the property.
      * @deprecated Use {@link #setRelativePath(Path)} instead.
      */
-    public void setPropertyName(QName property) {
-        Path.PathBuilder builder = new Path.PathBuilder();
+    public void setPropertyName(Name property) {
+        PathBuilder builder = new PathBuilder();
         builder.addLast(property);
         try {
             this.relPath = builder.getPath();
@@ -149,8 +150,8 @@
      *
      * @param element the path element to append.
      */
-    public void addPathElement(Path.PathElement element) {
-        Path.PathBuilder builder = new Path.PathBuilder();
+    public void addPathElement(Path.Element element) {
+        PathBuilder builder = new PathBuilder();
         if (relPath != null) {
             builder.addAll(relPath.getElements());
         }
@@ -193,7 +194,7 @@
         }
         return false;
     }
-    
+
     /**
      * {@inheritDoc}
      */



Mime
View raw message