Commits

John Marsden  committed ee53648

Update for 0.2.10 and Nebulus

  • Participants
  • Parent commits 60a37b4

Comments (0)

Files changed (33)

     <groupId>cc.plural</groupId>
     <artifactId>jsonij</artifactId>
     <packaging>jar</packaging>
-    <version>0.2.9-SNAPSHOT</version>
+    <version>0.2.10-SNAPSHOT</version>
     <name>JSONiJ</name>
     <url>http://jsonij.plural.cc</url>
     <build>

File src/main/java/cc/plural/jsonij/JPath.java

 import cc.plural.jsonij.jpath.Component;
 import cc.plural.jsonij.jpath.JPathImp;
 import cc.plural.jsonij.jpath.JPathParser;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  * JPath implementation. Inspired by XPath and <a href="http://goessner.net/articles/JsonPath/">JsonPath</a>.

File src/main/java/cc/plural/jsonij/JSON.java

 import java.io.IOException;
 import java.io.Reader;
 
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  * JSON document class.

File src/main/java/cc/plural/jsonij/JSONMarshaler.java

 import cc.plural.jsonij.marshal.JSONDocumentMarshaler;
 import cc.plural.jsonij.marshal.JSONMarshalerException;
 import cc.plural.jsonij.marshal.JavaMarshaler;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/main/java/cc/plural/jsonij/JSONParser.java

 import java.math.BigInteger;
 import java.util.Locale;
 
-import cc.plural.parser.ParserException;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.ReaderParser;
 
 
 /**

File src/main/java/cc/plural/jsonij/JSONParserException.java

 
 import java.util.Locale;
 
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/main/java/cc/plural/jsonij/JSONReader.java

  **/
 package cc.plural.jsonij;
 
-import cc.plural.parser.BaseReaderParser;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.BaseReaderParser;
+import cc.plural.jsonij.parser.ReaderParser;
 
 public abstract class JSONReader extends BaseReaderParser implements ReaderParser {
     public abstract ReaderParser getStringReader();

File src/main/java/cc/plural/jsonij/ReaderJSONReader.java

 import java.io.IOException;
 import java.io.Reader;
 
-import cc.plural.parser.Position;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.Position;
+import cc.plural.jsonij.parser.ReaderParser;
 
 /**
  * java.io.Reader implementation of a JSONReader. 

File src/main/java/cc/plural/jsonij/StringJSONReader.java

 
 import java.io.IOException;
 
-import cc.plural.parser.ParserException;
-import cc.plural.parser.Position;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.Position;
+import cc.plural.jsonij.parser.ReaderParser;
 
 /**
  * java.lang.String implementation of a JSONReader. 

File src/main/java/cc/plural/jsonij/jpath/JPathParser.java

 import cc.plural.jsonij.jpath.ExpressionPredicate.FunctionExpressionPredicateCondition;
 import cc.plural.jsonij.jpath.ExpressionPredicate.OperatorExpressionPredicateCondition;
 import cc.plural.jsonij.jpath.functions.FunctionArgument;
-import cc.plural.parser.BaseReaderParser;
-import cc.plural.parser.ParserException;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.BaseReaderParser;
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.ReaderParser;
 import static cc.plural.jsonij.Constants.ALL_CHAR;
 import static cc.plural.jsonij.Constants.AND;
 import static cc.plural.jsonij.Constants.COLON_CHAR;

File src/main/java/cc/plural/jsonij/jpath/JPathParserException.java

 
 import java.util.Locale;
 
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/main/java/cc/plural/jsonij/jpath/functions/FunctionArgument.java

 import cc.plural.jsonij.Value;
 import cc.plural.jsonij.JSONParser.StatefullValue;
 import cc.plural.jsonij.jpath.JPathParserException;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/main/java/cc/plural/jsonij/marshal/JSONMarshalerException.java

 
 import java.util.Locale;
 
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/main/java/cc/plural/jsonij/parser/BaseParserException.java

+/**
+ * Copyright (C) 2010-2011 J.W.Marsden
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package cc.plural.jsonij.parser;
+
+public class BaseParserException extends Exception {
+
+	/**
+	 * Serial UID
+	 */
+	private static final long serialVersionUID = -4518394051006246504L;
+
+	protected int line;
+
+	protected int position;
+
+	protected String message;
+
+	public BaseParserException() {
+	}
+
+	public BaseParserException(String message) {
+		this(-1, -1, message);
+	}
+
+	public BaseParserException(int line, int position, String message) {
+		this.line = line;
+		this.position = position;
+		this.message = message;
+	}
+
+	@Override
+	public String getMessage() {
+		String output = "Parsing Exception";
+		if (line != -1 || position != -1) {
+			output = String.format("%s (%s,%s): %s", output, line, position, message);
+		} else {
+			output = String.format("%s: %s", output, message);
+		}
+		return output;
+	}
+}

File src/main/java/cc/plural/jsonij/parser/BaseReaderParser.java

+/**
+ * Copyright (C) 2010-2011 J.W.Marsden
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package cc.plural.jsonij.parser;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import cc.plural.jsonij.parser.BaseParserException;
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.Position;
+import cc.plural.jsonij.parser.ReaderParser;
+
+/**
+ *
+ * @author openecho
+ */
+public abstract class BaseReaderParser implements ReaderParser {
+
+    protected int peekValue;
+    protected boolean hasPeeked;
+    protected Position position;
+
+    public BaseReaderParser() {
+        this(null);
+    }
+
+    public BaseReaderParser(Reader reader) {
+        this.peekValue = -1;
+        this.hasPeeked = false;
+        this.position = new Position();
+    }
+    
+    /**
+     * @return the position
+     */
+    public Position getPosition() {
+        return position;
+    }
+
+    /**
+     * @param position the position to set
+     */
+    protected Position setPosition(Position position) {
+        return this.position = position;
+    }
+
+    /**
+     * Only here for POJO reasons.
+     * @return hasPeeked()
+     * @see hasPeeked()
+     */
+    public boolean isHasPeeked() {
+        return hasPeeked();
+    }
+
+    public boolean hasPeeked() {
+        return hasPeeked;
+    }
+
+    public void setHasPeeked(boolean hasPeeked) {
+        this.hasPeeked = hasPeeked;
+    }
+
+    public int getLineNumber() {
+        return getPosition().getLineNumber();
+    }
+
+    public int getPositionNumber() {
+        return getPosition().getPostionNumber();
+    }
+
+    public int peek() throws IOException, ParserException {
+        if (!hasPeeked) {
+            peekValue = readNext();
+            hasPeeked = true;
+        }
+        return peekValue;
+    }
+
+    public int read() throws IOException, ParserException {
+        if (hasPeeked) {
+            hasPeeked = false;
+            return peekValue;
+        }
+        return readNext();
+    }
+
+    /**
+     * Reads from the reader.
+     *
+     * @param targetReader The reader to be read from.
+     * @return The read byte if found otherwise -1 if the end of the stream is reached.
+     * @throws IOException Java IO Exception.
+     */
+    protected abstract int readNext() throws IOException, ParserException;
+
+    public void close() {
+
+    }
+
+
+    protected void handleNewLine() throws IOException {
+        getPosition().newLine();
+    }
+
+    @Override
+    public String toString() {
+        String state = "";
+        try {
+            state = String.format("Next Char %s", (char) peek());
+        } catch (IOException e) {
+            state = String.format("Unknown State: %s", e.toString());
+        } catch (BaseParserException e) {
+            state = String.format("Unknown State: %s", e.toString());
+        }
+        return String.format("Reader %s: %s", getPosition(), state);
+    }
+}

File src/main/java/cc/plural/jsonij/parser/ParserException.java

+/**
+ * Copyright (C) 2010-2011 J.W.Marsden
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package cc.plural.jsonij.parser;
+
+import java.lang.reflect.Array;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import cc.plural.jsonij.parser.BaseParserException;
+
+/**
+ * Internationised Parser Exception.
+ * 
+ * @author J.W.Marsden
+ * @version 1.0.0
+ */
+public abstract class ParserException extends BaseParserException {
+    /**
+	 * Serial UID
+	 */
+	private static final long serialVersionUID = 470719429874019122L;
+	/**
+     * Exception Key
+     */
+    protected String key;
+    /**
+     * Exception Locale
+     */
+    protected Locale locale;
+
+    /**
+     * Basic Constructor.
+     *
+     * @param key Exception key
+     * @param args Additional Arguments for Exception
+     */
+    public ParserException(String key, Object... args) {
+        this(key, -1, -1, null, args);
+    }
+
+    /**
+     * Constructor Including Line Number and Position Number of Exception
+     *
+     * @param key Exception Key
+     * @param line Exception Line
+     * @param position Exception Position
+     * @param args Additional Arguments for Exception
+     */
+    public ParserException(String key, int line, int position, Object... args) {
+        this(key, line, position, null, args);
+    }
+
+    /**
+     * Constructor Including Line Number, Position Number and Locale of Exception.
+     *
+     * @param key Exception Key
+     * @param line Exception Line
+     * @param position Exception Position
+     * @param locale Valid Locale for the exception
+     * @param args Additional Arguments for Exception
+     */
+    public ParserException(String key, int line, int position, Locale locale, Object... args) {
+        this.line = line;
+        this.position = position;
+        this.key = key;
+
+        /**
+         * TODO:
+         * Fix this. Dont force it to be English!
+         */
+        this.locale = ((locale == null) ? Locale.ENGLISH : locale);
+        if (this.locale != null) {
+            try {
+                String messageFormat = ResourceBundle.getBundle(getBundleName()).getString(this.key);
+                this.message = String.format(messageFormat, args);
+            } catch (Exception ex) {
+                StringBuilder argumentStringBuilder = new StringBuilder();
+                Object argValue;
+                int argCount;
+                if (( argCount = Array.getLength(args) ) > 0) {
+                    for (int i = 0; i < argCount - 1; i++) {
+                        argValue = args[i];
+                        if (argValue != null) {
+                            argumentStringBuilder.append(args.toString()).append(',');
+                        } else {
+                            argumentStringBuilder.append("null").append(',');
+                        }
+                    }
+                    argValue = args[argCount - 1];
+                    if (argValue != null) {
+                        argumentStringBuilder.append(argValue.toString());
+                    } else {
+                        argumentStringBuilder.append("null");
+                    }
+                }
+                String messageFormat = "Message Format Not Found (%s#%s[%s]): %s";
+                this.message = String.format(messageFormat, getBundleName(), this.key, argumentStringBuilder.toString(), ex);
+            }
+        } else {
+            this.message = String.format("Undefined Exception %s %s", key, locale);
+        }
+    }
+
+    public abstract String getBundleName();
+}

File src/main/java/cc/plural/jsonij/parser/Position.java

+/**
+ * Copyright (C) 2010-2011 J.W.Marsden
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package cc.plural.jsonij.parser;
+
+public class Position {
+
+    //protected int readCount;
+    protected int lineNumber;
+    protected int postionNumber;
+
+    public Position() {
+        //this.readCount = 0;
+        this.lineNumber = 1;
+        this.postionNumber = 0;
+    }
+/*
+    public int getReadCount() {
+        return readCount;
+    }
+
+    public int setReadCount(int readCount) {
+        return this.readCount = readCount;
+    }
+
+    public int tickReadCount() {
+        return this.readCount++;
+    }
+*/
+    public int getLineNumber() {
+        return lineNumber;
+    }
+
+    public int setLineNumber(int lineNumber) {
+        return this.lineNumber = lineNumber;
+    }
+
+    public int newLine() {
+        postionNumber = 0;
+        return lineNumber++;
+    }
+
+    public int getPostionNumber() {
+        return postionNumber;
+    }
+
+    public int setPostionNumber(int postionNumber) {
+        return this.postionNumber = postionNumber;
+    }
+
+    final public int movePosition() {
+        return postionNumber++;
+    }
+
+    @Override
+    public String toString() {
+        return String.format("(%s,%s)", getLineNumber(), getPostionNumber());
+    }
+}

File src/main/java/cc/plural/jsonij/parser/ReaderParser.java

+/**
+ * Copyright (C) 2010-2011 J.W.Marsden
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package cc.plural.jsonij.parser;
+
+import java.io.IOException;
+
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.Position;
+
+/**
+ *
+ * @author openecho
+ */
+public interface ReaderParser {
+
+    /**
+     * @return the position
+     */
+    public Position getPosition();
+
+    /**
+     * Only here for POJO reasons.
+     * @return hasPeeked()
+     * @see hasPeeked()
+     */
+    public boolean isHasPeeked();
+
+    public boolean hasPeeked();
+
+    public void setHasPeeked(boolean hasPeeked);
+
+    public int getLineNumber();
+
+    public int getPositionNumber();
+
+    public int peek() throws IOException, ParserException;
+
+    public int read() throws IOException, ParserException;
+
+    public void close();
+}

File src/main/java/cc/plural/parser/BaseParserException.java

-/**
- * Copyright (C) 2010-2011 J.W.Marsden
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-package cc.plural.parser;
-
-public class BaseParserException extends Exception {
-
-	/**
-	 * Serial UID
-	 */
-	private static final long serialVersionUID = -4518394051006246504L;
-
-	protected int line;
-
-	protected int position;
-
-	protected String message;
-
-	public BaseParserException() {
-	}
-
-	public BaseParserException(String message) {
-		this(-1, -1, message);
-	}
-
-	public BaseParserException(int line, int position, String message) {
-		this.line = line;
-		this.position = position;
-		this.message = message;
-	}
-
-	@Override
-	public String getMessage() {
-		String output = "Parsing Exception";
-		if (line != -1 || position != -1) {
-			output = String.format("%s (%s,%s): %s", output, line, position, message);
-		} else {
-			output = String.format("%s: %s", output, message);
-		}
-		return output;
-	}
-}

File src/main/java/cc/plural/parser/BaseReaderParser.java

-/**
- * Copyright (C) 2010-2011 J.W.Marsden
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-package cc.plural.parser;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- *
- * @author openecho
- */
-public abstract class BaseReaderParser implements ReaderParser {
-
-    protected int peekValue;
-    protected boolean hasPeeked;
-    protected Position position;
-
-    public BaseReaderParser() {
-        this(null);
-    }
-
-    public BaseReaderParser(Reader reader) {
-        this.peekValue = -1;
-        this.hasPeeked = false;
-        this.position = new Position();
-    }
-    
-    /**
-     * @return the position
-     */
-    public Position getPosition() {
-        return position;
-    }
-
-    /**
-     * @param position the position to set
-     */
-    protected Position setPosition(Position position) {
-        return this.position = position;
-    }
-
-    /**
-     * Only here for POJO reasons.
-     * @return hasPeeked()
-     * @see hasPeeked()
-     */
-    public boolean isHasPeeked() {
-        return hasPeeked();
-    }
-
-    public boolean hasPeeked() {
-        return hasPeeked;
-    }
-
-    public void setHasPeeked(boolean hasPeeked) {
-        this.hasPeeked = hasPeeked;
-    }
-
-    public int getLineNumber() {
-        return getPosition().getLineNumber();
-    }
-
-    public int getPositionNumber() {
-        return getPosition().getPostionNumber();
-    }
-
-    public int peek() throws IOException, ParserException {
-        if (!hasPeeked) {
-            peekValue = readNext();
-            hasPeeked = true;
-        }
-        return peekValue;
-    }
-
-    public int read() throws IOException, ParserException {
-        if (hasPeeked) {
-            hasPeeked = false;
-            return peekValue;
-        }
-        return readNext();
-    }
-
-    /**
-     * Reads from the reader.
-     *
-     * @param targetReader The reader to be read from.
-     * @return The read byte if found otherwise -1 if the end of the stream is reached.
-     * @throws IOException Java IO Exception.
-     */
-    protected abstract int readNext() throws IOException, ParserException;
-
-    public void close() {
-
-    }
-
-
-    protected void handleNewLine() throws IOException {
-        getPosition().newLine();
-    }
-
-    @Override
-    public String toString() {
-        String state = "";
-        try {
-            state = String.format("Next Char %s", (char) peek());
-        } catch (IOException e) {
-            state = String.format("Unknown State: %s", e.toString());
-        } catch (BaseParserException e) {
-            state = String.format("Unknown State: %s", e.toString());
-        }
-        return String.format("Reader %s: %s", getPosition(), state);
-    }
-}

File src/main/java/cc/plural/parser/ParserException.java

-/**
- * Copyright (C) 2010-2011 J.W.Marsden
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-package cc.plural.parser;
-
-import java.lang.reflect.Array;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-/**
- * Internationised Parser Exception.
- * 
- * @author J.W.Marsden
- * @version 1.0.0
- */
-public abstract class ParserException extends BaseParserException {
-    /**
-	 * Serial UID
-	 */
-	private static final long serialVersionUID = 470719429874019122L;
-	/**
-     * Exception Key
-     */
-    protected String key;
-    /**
-     * Exception Locale
-     */
-    protected Locale locale;
-
-    /**
-     * Basic Constructor.
-     *
-     * @param key Exception key
-     * @param args Additional Arguments for Exception
-     */
-    public ParserException(String key, Object... args) {
-        this(key, -1, -1, null, args);
-    }
-
-    /**
-     * Constructor Including Line Number and Position Number of Exception
-     *
-     * @param key Exception Key
-     * @param line Exception Line
-     * @param position Exception Position
-     * @param args Additional Arguments for Exception
-     */
-    public ParserException(String key, int line, int position, Object... args) {
-        this(key, line, position, null, args);
-    }
-
-    /**
-     * Constructor Including Line Number, Position Number and Locale of Exception.
-     *
-     * @param key Exception Key
-     * @param line Exception Line
-     * @param position Exception Position
-     * @param locale Valid Locale for the exception
-     * @param args Additional Arguments for Exception
-     */
-    public ParserException(String key, int line, int position, Locale locale, Object... args) {
-        this.line = line;
-        this.position = position;
-        this.key = key;
-
-        /**
-         * TODO:
-         * Fix this. Dont force it to be English!
-         */
-        this.locale = ((locale == null) ? Locale.ENGLISH : locale);
-        if (this.locale != null) {
-            try {
-                String messageFormat = ResourceBundle.getBundle(getBundleName()).getString(this.key);
-                this.message = String.format(messageFormat, args);
-            } catch (Exception ex) {
-                StringBuilder argumentStringBuilder = new StringBuilder();
-                Object argValue;
-                int argCount;
-                if (( argCount = Array.getLength(args) ) > 0) {
-                    for (int i = 0; i < argCount - 1; i++) {
-                        argValue = args[i];
-                        if (argValue != null) {
-                            argumentStringBuilder.append(args.toString()).append(',');
-                        } else {
-                            argumentStringBuilder.append("null").append(',');
-                        }
-                    }
-                    argValue = args[argCount - 1];
-                    if (argValue != null) {
-                        argumentStringBuilder.append(argValue.toString());
-                    } else {
-                        argumentStringBuilder.append("null");
-                    }
-                }
-                String messageFormat = "Message Format Not Found (%s#%s[%s]): %s";
-                this.message = String.format(messageFormat, getBundleName(), this.key, argumentStringBuilder.toString(), ex);
-            }
-        } else {
-            this.message = String.format("Undefined Exception %s %s", key, locale);
-        }
-    }
-
-    public abstract String getBundleName();
-}

File src/main/java/cc/plural/parser/Position.java

-/**
- * Copyright (C) 2010-2011 J.W.Marsden
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-package cc.plural.parser;
-
-public class Position {
-
-    //protected int readCount;
-    protected int lineNumber;
-    protected int postionNumber;
-
-    public Position() {
-        //this.readCount = 0;
-        this.lineNumber = 1;
-        this.postionNumber = 0;
-    }
-/*
-    public int getReadCount() {
-        return readCount;
-    }
-
-    public int setReadCount(int readCount) {
-        return this.readCount = readCount;
-    }
-
-    public int tickReadCount() {
-        return this.readCount++;
-    }
-*/
-    public int getLineNumber() {
-        return lineNumber;
-    }
-
-    public int setLineNumber(int lineNumber) {
-        return this.lineNumber = lineNumber;
-    }
-
-    public int newLine() {
-        postionNumber = 0;
-        return lineNumber++;
-    }
-
-    public int getPostionNumber() {
-        return postionNumber;
-    }
-
-    public int setPostionNumber(int postionNumber) {
-        return this.postionNumber = postionNumber;
-    }
-
-    final public int movePosition() {
-        return postionNumber++;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("(%s,%s)", getLineNumber(), getPostionNumber());
-    }
-}

File src/main/java/cc/plural/parser/ReaderParser.java

-/**
- * Copyright (C) 2010-2011 J.W.Marsden
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-package cc.plural.parser;
-
-import java.io.IOException;
-
-/**
- *
- * @author openecho
- */
-public interface ReaderParser {
-
-    /**
-     * @return the position
-     */
-    public Position getPosition();
-
-    /**
-     * Only here for POJO reasons.
-     * @return hasPeeked()
-     * @see hasPeeked()
-     */
-    public boolean isHasPeeked();
-
-    public boolean hasPeeked();
-
-    public void setHasPeeked(boolean hasPeeked);
-
-    public int getLineNumber();
-
-    public int getPositionNumber();
-
-    public int peek() throws IOException, ParserException;
-
-    public int read() throws IOException, ParserException;
-
-    public void close();
-}

File src/test/java/cc/plural/jsonij/marshal/JSONDocumentMarshalerTest.java

 import cc.plural.jsonij.JSONMarshaler;
 import cc.plural.jsonij.marshal.JSONMarshalerException;
 import cc.plural.jsonij.marshal.helpers.JSONObject;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/cc/plural/jsonij/profile/Harness.java

 import java.io.IOException;
 
 import cc.plural.jsonij.JSON;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 /**
  *

File src/test/java/jsonij/legacy/JPathAllPredicateTest.java

 import cc.plural.jsonij.JSON;
 import cc.plural.jsonij.Value;
 import cc.plural.jsonij.jpath.Component;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/jsonij/legacy/JPathTest.java

 import cc.plural.jsonij.Value;
 import cc.plural.jsonij.jpath.JPathParser;
 import cc.plural.jsonij.jpath.JPathParserException;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/jsonij/legacy/JSONParserTest.java

 import cc.plural.jsonij.JSON;
 import cc.plural.jsonij.JSONParser;
 import cc.plural.jsonij.Value;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 
 import junit.framework.TestCase;
 

File src/test/java/jsonij/legacy/JSONReaderTest.java

 import org.junit.Test;
 
 import cc.plural.jsonij.StringJSONReader;
-import cc.plural.parser.ParserException;
-import cc.plural.parser.ReaderParser;
+import cc.plural.jsonij.parser.ParserException;
+import cc.plural.jsonij.parser.ReaderParser;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/jsonij/legacy/JSONStringParserTest.java

 import cc.plural.jsonij.JSONReader;
 import cc.plural.jsonij.ReaderJSONReader;
 import cc.plural.jsonij.StringJSONReader;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/jsonij/legacy/ParserEqualsTest.java

 import org.junit.Test;
 
 import cc.plural.jsonij.JSON;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 /**

File src/test/java/jsonij/legacy/PerformanceTests.java

 import org.junit.Test;
 
 import cc.plural.jsonij.JSON;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 

File src/test/java/jsonij/legacy/SJTest.java

 import org.junit.Test;
 
 import cc.plural.jsonij.JSON;
-import cc.plural.parser.ParserException;
+import cc.plural.jsonij.parser.ParserException;
 import static org.junit.Assert.*;
 
 public class SJTest {