jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1155280 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java
Date Tue, 09 Aug 2011 09:23:15 GMT
Author: angela
Date: Tue Aug  9 09:23:15 2011
New Revision: 1155280

URL: http://svn.apache.org/viewvc?rev=1155280&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java?rev=1155280&r1=1155279&r2=1155280&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/TemplateBuilderFactory.java
Tue Aug  9 09:23:15 2011
@@ -21,6 +21,7 @@ import java.util.List;
 
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
@@ -54,6 +55,20 @@ public class TemplateBuilderFactory exte
         this.namespaceRegistry = namespaceRegistry;
     }
 
+    /**
+     * Creates a new <code>TemplateBuilderFactory</code> for the specified
+     * <code>Session</code>. This is equivalent to
+     * {@link #TemplateBuilderFactory(NodeTypeManager, ValueFactory, NamespaceRegistry)}
+     * where all parameters are obtained from the given session object and
+     * the workspace associated with it.
+     *
+     * @param session The repository session.
+     * @throws RepositoryException If an error occurs.
+     */
+    public TemplateBuilderFactory(Session session) throws RepositoryException {
+        this(session.getWorkspace().getNodeTypeManager(), session.getValueFactory(), session.getWorkspace().getNamespaceRegistry());
+    }
+
     @Override
     public AbstractNodeTypeDefinitionBuilder<NodeTypeTemplate> newNodeTypeDefinitionBuilder()
             throws UnsupportedRepositoryOperationException, RepositoryException {
@@ -238,7 +253,5 @@ public class TemplateBuilderFactory exte
             List<NodeDefinitionTemplate> templates = ntd.template.getNodeDefinitionTemplates();
             templates.add(template);
         }
-
     }
-
 }



Mime
View raw message