Permalink
Browse files

split packages

  • Loading branch information...
1 parent 1d9c5a3 commit 3f1f83af2681739c8c12129cb59d09eda86f9f15 @ropalka ropalka committed Sep 12, 2012
Showing with 124 additions and 114 deletions.
  1. +5 −5 modules/api/src/main/java/org/fossnova/json/{JsonStructureFactory.java → JsonFactory.java}
  2. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/JsonEvent.java
  3. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/JsonException.java
  4. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/JsonReader.java
  5. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/JsonStreamFactory.java
  6. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/JsonWriter.java
  7. +1 −1 modules/api/src/main/java/org/fossnova/json/{ → stream}/package-info.java
  8. +2 −0 modules/impl/src/main/java/com/fossnova/json/JsonArrayImpl.java
  9. +14 −11 modules/impl/src/main/java/com/fossnova/json/{JsonStructureFactoryImpl.java → JsonFactoryImpl.java}
  10. +2 −0 modules/impl/src/main/java/com/fossnova/json/JsonObjectImpl.java
  11. +3 −0 modules/impl/src/main/java/com/fossnova/json/JsonStructureImpl.java
  12. +1 −1 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonConstants.java
  13. +13 −13 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonGrammarAnalyzer.java
  14. +1 −1 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonGrammarToken.java
  15. +10 −10 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonReaderImpl.java
  16. +4 −4 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonStreamFactoryImpl.java
  17. +38 −38 modules/impl/src/main/java/com/fossnova/json/{ → stream}/JsonWriterImpl.java
  18. +2 −2 modules/impl/src/main/java/com/fossnova/json/{ → stream}/Utils.java
  19. +1 −0 modules/impl/src/main/resources/META-INF/services/org.fossnova.json.JsonFactory
  20. +0 −1 modules/impl/src/main/resources/META-INF/services/org.fossnova.json.JsonStreamFactory
  21. +0 −1 modules/impl/src/main/resources/META-INF/services/org.fossnova.json.JsonStructureFactory
  22. +1 −0 modules/impl/src/main/resources/META-INF/services/org.fossnova.json.stream.JsonStreamFactory
  23. +12 −12 modules/tests/src/test/java/test/fossnova/json/AbstractJsonTestCase.java
  24. +1 −1 modules/tests/src/test/java/test/fossnova/json/InvalidJsonReaderTestCase.java
  25. +2 −2 modules/tests/src/test/java/test/fossnova/json/InvalidJsonWriterTestCase.java
  26. +3 −3 modules/tests/src/test/java/test/fossnova/json/JsonObjectTestCase.java
  27. +1 −1 modules/tests/src/test/java/test/fossnova/json/ValidJsonReaderTestCase.java
  28. +2 −2 modules/tests/src/test/java/test/fossnova/json/ValidJsonWriterTestCase.java
@@ -29,17 +29,17 @@
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
-public abstract class JsonStructureFactory {
+public abstract class JsonFactory {
- protected JsonStructureFactory() {
+ protected JsonFactory() {
}
- public static JsonStructureFactory newInstance() {
- final JsonStructureFactory jsonFactoryImpl = FactoryFinder.find( JsonStructureFactory.class );
+ public static JsonFactory newInstance() {
+ final JsonFactory jsonFactoryImpl = FactoryFinder.find( JsonFactory.class );
if ( jsonFactoryImpl != null ) {
return jsonFactoryImpl;
}
- throw new IllegalStateException( "Factory not configured: " + JsonStructureFactory.class.getName() );
+ throw new IllegalStateException( "Factory not configured: " + JsonFactory.class.getName() );
}
public abstract JsonObject newJsonObject();
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
/**
* JSON encoding parsing events.
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
/**
* JSON encoding exception.
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
import java.io.Closeable;
import java.io.IOException;
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
import java.io.InputStream;
import java.io.OutputStream;
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
import java.io.Closeable;
import java.io.IOException;
@@ -22,5 +22,5 @@
*
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
-package org.fossnova.json;
+package org.fossnova.json.stream;
@@ -29,6 +29,8 @@
import org.fossnova.json.JsonStructure;
import org.fossnova.json.JsonValue;
+import com.fossnova.json.stream.JsonWriterImpl;
+
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
@@ -19,29 +19,32 @@
*/
package com.fossnova.json;
-import static org.fossnova.json.JsonEvent.ARRAY_END;
-import static org.fossnova.json.JsonEvent.ARRAY_START;
-import static org.fossnova.json.JsonEvent.BOOLEAN;
-import static org.fossnova.json.JsonEvent.NULL;
-import static org.fossnova.json.JsonEvent.NUMBER;
-import static org.fossnova.json.JsonEvent.OBJECT_END;
-import static org.fossnova.json.JsonEvent.OBJECT_START;
-import static org.fossnova.json.JsonEvent.STRING;
+import static org.fossnova.json.stream.JsonEvent.ARRAY_END;
+import static org.fossnova.json.stream.JsonEvent.ARRAY_START;
+import static org.fossnova.json.stream.JsonEvent.BOOLEAN;
+import static org.fossnova.json.stream.JsonEvent.NULL;
+import static org.fossnova.json.stream.JsonEvent.NUMBER;
+import static org.fossnova.json.stream.JsonEvent.OBJECT_END;
+import static org.fossnova.json.stream.JsonEvent.OBJECT_START;
+import static org.fossnova.json.stream.JsonEvent.STRING;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
-import org.fossnova.json.JsonEvent;
import org.fossnova.json.JsonStructure;
-import org.fossnova.json.JsonStructureFactory;
+import org.fossnova.json.JsonFactory;
import org.fossnova.json.JsonValue;
+import org.fossnova.json.stream.JsonEvent;
+
+import com.fossnova.json.stream.JsonReaderImpl;
+import com.fossnova.json.stream.JsonStreamFactoryImpl;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
-public final class JsonStructureFactoryImpl extends JsonStructureFactory {
+public final class JsonFactoryImpl extends JsonFactory {
@Override
public JsonObjectImpl newJsonObject() {
@@ -30,6 +30,8 @@
import org.fossnova.json.JsonStructure;
import org.fossnova.json.JsonValue;
+import com.fossnova.json.stream.JsonWriterImpl;
+
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
@@ -27,6 +27,9 @@
import org.fossnova.json.JsonStructure;
+import com.fossnova.json.stream.JsonStreamFactoryImpl;
+import com.fossnova.json.stream.JsonWriterImpl;
+
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package com.fossnova.json;
+package com.fossnova.json.stream;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
@@ -17,23 +17,23 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package com.fossnova.json;
+package com.fossnova.json.stream;
-import static com.fossnova.json.JsonGrammarToken.ARRAY_END;
-import static com.fossnova.json.JsonGrammarToken.ARRAY_START;
-import static com.fossnova.json.JsonGrammarToken.BOOLEAN;
-import static com.fossnova.json.JsonGrammarToken.COLON;
-import static com.fossnova.json.JsonGrammarToken.COMMA;
-import static com.fossnova.json.JsonGrammarToken.NULL;
-import static com.fossnova.json.JsonGrammarToken.NUMBER;
-import static com.fossnova.json.JsonGrammarToken.OBJECT_END;
-import static com.fossnova.json.JsonGrammarToken.OBJECT_START;
-import static com.fossnova.json.JsonGrammarToken.STRING;
+import static com.fossnova.json.stream.JsonGrammarToken.ARRAY_END;
+import static com.fossnova.json.stream.JsonGrammarToken.ARRAY_START;
+import static com.fossnova.json.stream.JsonGrammarToken.BOOLEAN;
+import static com.fossnova.json.stream.JsonGrammarToken.COLON;
+import static com.fossnova.json.stream.JsonGrammarToken.COMMA;
+import static com.fossnova.json.stream.JsonGrammarToken.NULL;
+import static com.fossnova.json.stream.JsonGrammarToken.NUMBER;
+import static com.fossnova.json.stream.JsonGrammarToken.OBJECT_END;
+import static com.fossnova.json.stream.JsonGrammarToken.OBJECT_START;
+import static com.fossnova.json.stream.JsonGrammarToken.STRING;
import java.util.LinkedList;
-import org.fossnova.json.JsonEvent;
-import org.fossnova.json.JsonException;
+import org.fossnova.json.stream.JsonEvent;
+import org.fossnova.json.stream.JsonException;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package com.fossnova.json;
+package com.fossnova.json.stream;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
@@ -17,27 +17,27 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package com.fossnova.json;
+package com.fossnova.json.stream;
-import static com.fossnova.json.JsonConstants.BACKSLASH;
-import static com.fossnova.json.Utils.isControl;
-import static com.fossnova.json.Utils.isWhitespace;
-import static com.fossnova.json.Utils.toUnicodeString;
+import static com.fossnova.json.stream.JsonConstants.BACKSLASH;
+import static com.fossnova.json.stream.Utils.isControl;
+import static com.fossnova.json.stream.Utils.isWhitespace;
+import static com.fossnova.json.stream.Utils.toUnicodeString;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.BigInteger;
-import org.fossnova.json.JsonEvent;
-import org.fossnova.json.JsonException;
-import org.fossnova.json.JsonReader;
+import org.fossnova.json.stream.JsonEvent;
+import org.fossnova.json.stream.JsonException;
+import org.fossnova.json.stream.JsonReader;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
-final class JsonReaderImpl implements JsonReader {
+public final class JsonReaderImpl implements JsonReader {
private PushbackReader in;
@@ -66,7 +66,7 @@ protected void finalize() throws Throwable {
super.finalize();
}
- String getNumber() {
+ public String getNumber() {
if ( !isCurrentEvent( JsonEvent.NUMBER ) ) {
throw new IllegalStateException( "Current event isn't number" );
}
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package com.fossnova.json;
+package com.fossnova.json.stream;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -28,9 +28,9 @@
import java.io.Writer;
import java.nio.charset.Charset;
-import org.fossnova.json.JsonReader;
-import org.fossnova.json.JsonStreamFactory;
-import org.fossnova.json.JsonWriter;
+import org.fossnova.json.stream.JsonReader;
+import org.fossnova.json.stream.JsonStreamFactory;
+import org.fossnova.json.stream.JsonWriter;
/**
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
Oops, something went wrong.

0 comments on commit 3f1f83a

Please sign in to comment.