chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1444620 - in /chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src: main/java/org/apache/chemistry/opencmis/query/example/ test/java/org/apache/chemistry/opencmis/query/example/
Date Sun, 10 Feb 2013 21:51:14 GMT
Author: jens
Date: Sun Feb 10 21:51:14 2013
New Revision: 1444620

URL: http://svn.apache.org/r1444620
Log:
QueryParser example: add some javadoc

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessor.java
    chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleTypeManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExtendedAbstractPredicateWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/test/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessorTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessor.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessor.java?rev=1444620&r1=1444619&r2=1444620&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessor.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessor.java
Sun Feb 10 21:51:14 2013
@@ -30,6 +30,13 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.server.support.query.QueryObject.SortSpec;
 import org.apache.chemistry.opencmis.server.support.query.QueryUtilStrict;
 
+/**
+ * Main entry point for the parser example. It takes a CMISQL query as input,
+ * parses it and generates again CMISQL as output when traversing the tree.
+ * Runs standalone without a server. Usually this code would be called from
+ * the CMIS Discovery Service in a CMIS server implementation.
+ *
+ */
 public class ExampleQueryProcessor {
     
     public static void main(String[] args) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryWalker.java?rev=1444620&r1=1444619&r2=1444620&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryWalker.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleQueryWalker.java
Sun Feb 10 21:51:14 2013
@@ -25,6 +25,12 @@ import org.antlr.runtime.tree.Tree;
 import org.apache.chemistry.opencmis.server.support.query.StringUtil;
 import org.apache.chemistry.opencmis.server.support.query.TextSearchLexer;
 
+/**
+ * A class extending the {@link ExtendedAbstractPredicateWalker} class and generating
+ * CMISQL strings as output while traversing the trees. On each hit of a certain
+ * node or token the corresponding output of CMISQL is appended to a string
+ * buffer.
+ */
 public class ExampleQueryWalker extends ExtendedAbstractPredicateWalker {
 
     private StringBuffer result = new StringBuffer();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleTypeManager.java?rev=1444620&r1=1444619&r2=1444620&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleTypeManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExampleTypeManager.java
Sun Feb 10 21:51:14 2013
@@ -45,6 +45,13 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeMutabilityImpl;
 import org.apache.chemistry.opencmis.server.support.TypeManager;
 
+/**
+ * This class implements a minmimal type system for the example parser
+ * consisting of a single type cmis:document. An implementation of the
+ * interface TypeManager must be provided to use the parser framework.
+ * 
+ * @see org.apache.chemistry.opencmis.server.support.TypeManager
+ */
 public class ExampleTypeManager implements TypeManager {
     
     private static ExampleTypeManager INSTANCE = new ExampleTypeManager();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExtendedAbstractPredicateWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExtendedAbstractPredicateWalker.java?rev=1444620&r1=1444619&r2=1444620&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExtendedAbstractPredicateWalker.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/main/java/org/apache/chemistry/opencmis/query/example/ExtendedAbstractPredicateWalker.java
Sun Feb 10 21:51:14 2013
@@ -23,6 +23,11 @@ import java.util.List;
 import org.antlr.runtime.tree.Tree;
 import org.apache.chemistry.opencmis.server.support.query.AbstractPredicateWalker;
 
+/**
+ * An extended walker approach with more fine grained control and more callback
+ * hooks. This class is independent of the target output.
+ *
+ */
 public abstract class ExtendedAbstractPredicateWalker extends AbstractPredicateWalker {
 
     protected abstract void onStartProcessing(Tree whereNode);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/test/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessorTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/test/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessorTest.java?rev=1444620&r1=1444619&r2=1444620&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/test/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessorTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-queryparser/src/test/java/org/apache/chemistry/opencmis/query/example/ExampleQueryProcessorTest.java
Sun Feb 10 21:51:14 2013
@@ -23,6 +23,11 @@ import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
 
+/**
+ * Unit test for the sample parser. Calls the main entry point and compares output
+ * against the expected result.
+ *
+ */
 public class ExampleQueryProcessorTest {
     
     private ExampleQueryProcessor queryProcessor;



Mime
View raw message