Permalink
Browse files

switch to org.json

  • Loading branch information...
1 parent fd58f69 commit f53e98ba8c95396560509167a1239cbf8145743c Robert Newson committed Nov 9, 2010
Showing with 303 additions and 257 deletions.
  1. +3 −4 pom.xml
  2. +8 −8 src/main/java/com/github/rnewson/couchdb/lucene/CustomQueryParser.java
  3. +112 −106 src/main/java/com/github/rnewson/couchdb/lucene/DatabaseIndexer.java
  4. +20 −14 src/main/java/com/github/rnewson/couchdb/lucene/DocumentConverter.java
  5. +12 −8 src/main/java/com/github/rnewson/couchdb/lucene/JSONErrorHandler.java
  6. +35 −18 src/main/java/com/github/rnewson/couchdb/lucene/LuceneServlet.java
  7. +7 −8 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/Couch.java
  8. +4 −3 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/CouchDocument.java
  9. +21 −22 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/Database.java
  10. +4 −3 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/DatabaseInfo.java
  11. +8 −4 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/DesignDocument.java
  12. +6 −6 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/View.java
  13. +1 −2 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/ViewSettings.java
  14. +10 −8 src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java
  15. +15 −5 src/main/java/com/github/rnewson/couchdb/lucene/util/ServletUtils.java
  16. +8 −3 src/main/java/com/github/rnewson/couchdb/lucene/util/Utils.java
  17. +5 −5 src/test/java/com/github/rnewson/couchdb/lucene/DocumentConverterTest.java
  18. +2 −7 src/test/java/com/github/rnewson/couchdb/lucene/JsonTest.java
  19. +7 −7 src/test/java/com/github/rnewson/couchdb/lucene/couchdb/CouchDocumentTest.java
  20. +6 −6 src/test/java/com/github/rnewson/couchdb/lucene/couchdb/DesignDocumentTest.java
  21. +4 −5 src/test/java/com/github/rnewson/couchdb/lucene/couchdb/ViewTest.java
  22. +5 −5 src/test/java/com/github/rnewson/couchdb/lucene/util/AnalyzersTest.java
View
@@ -38,10 +38,9 @@
<version>1.6</version>
</dependency>
<dependency>
- <groupId>net.sf.json-lib</groupId>
- <artifactId>json-lib</artifactId>
- <version>2.2.3</version>
- <classifier>jdk15</classifier>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20090211</version>
</dependency>
<dependency>
<groupId>rhino</groupId>
@@ -16,16 +16,16 @@
* limitations under the License.
*/
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.Version;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
import com.github.rnewson.couchdb.lucene.couchdb.FieldType;
@@ -70,12 +70,12 @@ public static Sort toSort(final String sort) throws ParseException {
}
}
- public static String toString(final SortField[] sortFields) {
+ public static String toString(final SortField[] sortFields) throws JSONException {
final JSONArray result = new JSONArray();
for (final SortField field : sortFields) {
final JSONObject col = new JSONObject();
- col.element("field", field.getField());
- col.element("reverse", field.getReverse());
+ col.put("field", field.getField());
+ col.put("reverse", field.getReverse());
final String type;
switch (field.getType()) {
@@ -113,8 +113,8 @@ public static String toString(final SortField[] sortFields) {
type = "unknown";
break;
}
- col.element("type", type);
- result.add(col);
+ col.put("type", type);
+ result.put(col);
}
return result.toString();
}
Oops, something went wrong.

0 comments on commit f53e98b

Please sign in to comment.