Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

provide javadoc

  • Loading branch information...
commit 0ee0d4a24df68143608a5fe3a1f716aa6461b7f9 1 parent f377bd4
@ropalka ropalka authored
View
193 modules/api/src/main/java/org/fossnova/json/JsonArray.java
@@ -25,73 +25,258 @@
import org.fossnova.json.stream.JsonWriter;
/**
+ * JSON array.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonArray extends JsonValue, List< JsonValue > {
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON string
+ */
boolean add( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON number
+ */
boolean add( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON boolean
+ */
boolean add( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#add(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contained the specified JSON value
+ */
boolean add( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON string is to be inserted
+ * @param value string to wrap
+ */
void add( final int index, final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON number is to be inserted
+ * @param value number to wrap
+ */
void add( final int index, final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON boolean is to be inserted
+ * @param value boolean to wrap
+ */
void add( final int index, final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON value is to be inserted
+ * @param value JSON value
+ */
void add( final int index, final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON string
+ */
boolean contains( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON number
+ */
boolean contains( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON boolean
+ */
boolean contains( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#contains(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contains the specified JSON value
+ */
boolean contains( final JsonValue value );
- boolean contains( final Object value );
-
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value string to wrap
+ * @return the index of the first occurrence of the specified JSON string in
+ * this JSON array, or -1 if this JSON array does not contain the JSON string
+ */
int indexOf( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value number to wrap
+ * @return the index of the first occurrence of the specified JSON number in
+ * this JSON array, or -1 if this JSON array does not contain the JSON number
+ */
int indexOf( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value boolean to wrap
+ * @return the index of the first occurrence of the specified JSON boolean in
+ * this JSON array, or -1 if this JSON array does not contain the JSON boolean
+ */
int indexOf( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#indexOf(Object)} method.
+ * @param value JSON value
+ * @return the index of the first occurrence of the specified JSON value in
+ * this JSON array, or -1 if this JSON array does not contain the JSON value
+ */
int indexOf( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON string in
+ * this JSON array, or -1 if this JSON array does not contain the JSON string
+ */
int lastIndexOf( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON number in
+ * this JSON array, or -1 if this JSON array does not contain the JSON number
+ */
int lastIndexOf( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON boolean in
+ * this JSON array, or -1 if this JSON array does not contain the JSON boolean
+ */
int lastIndexOf( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value JSON value
+ * @return he index of the last occurrence of the specified JSON value in
+ * this JSON array, or -1 if this JSON array does not contain the JSON value
+ */
int lastIndexOf( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON string
+ */
boolean remove( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON number
+ */
boolean remove( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON boolean
+ */
boolean remove( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#remove(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contained the specified JSON value
+ */
boolean remove( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value string to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value number to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value boolean to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value JSON value
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final JsonValue value );
- JsonArray subList( final int fromIndex, final int toIndex );
-
+ /**
+ * Translates this JSON array to Java array.
+ * @return java array
+ */
JsonValue[] toArray();
+ /**
+ * Serializes this JSON array to the writer.
+ * @param writer to write to
+ * @throws IOException if some I/O error occurs.
+ */
void writeTo( JsonWriter writer ) throws IOException;
+ /**
+ * Clones this JSON array.
+ * @return new JSON array clone.
+ */
JsonArray clone();
}
View
17 modules/api/src/main/java/org/fossnova/json/JsonBoolean.java
@@ -20,13 +20,28 @@
package org.fossnova.json;
/**
+ * JSON boolean.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonBoolean extends JsonValue {
- void setBoolean( boolean b );
+ /**
+ * Sets new boolean value.
+ * @param value new boolean value
+ */
+ void setBoolean( boolean value );
+ /**
+ * Gets boolean value.
+ * @return boolean value
+ */
boolean getBoolean();
+ /**
+ * Clones this JSON boolean.
+ * @return new JSON boolean clone.
+ */
JsonBoolean clone();
}
View
111 modules/api/src/main/java/org/fossnova/json/JsonNumber.java
@@ -23,41 +23,120 @@
import java.math.BigInteger;
/**
+ * JSON number.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonNumber extends JsonValue {
- void setByte( byte b );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setByte( byte value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>byte</code>
+ */
byte getByte();
- void setShort( short s );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setShort( short value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>short</code>
+ */
short getShort();
- void setInt( int i );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setInt( int value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>int</code>
+ */
int getInt();
- void setLong( long l );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setLong( long value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>long</code>
+ */
long getLong();
- void setFloat( float f );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setFloat( float value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>float</code>
+ */
float getFloat();
- void setDouble( double d );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setDouble( double value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>double</code>
+ */
double getDouble();
- void setBigInteger( BigInteger bi );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setBigInteger( BigInteger value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>BigInteger</code>
+ */
BigInteger getBigInteger();
- void setBigDecimal( BigDecimal bd );
-
+ /**
+ * Sets new number value.
+ * @param value new number value
+ */
+ void setBigDecimal( BigDecimal value );
+
+ /**
+ * Gets number value.
+ * @return number value
+ * @exception NumberFormatException if JSON number is not convertible to <code>BigDecimal</code>
+ */
BigDecimal getBigDecimal();
+ /**
+ * Clones this JSON number.
+ * @return new JSON number clone.
+ */
JsonNumber clone();
}
View
76 modules/api/src/main/java/org/fossnova/json/JsonObject.java
@@ -25,31 +25,107 @@
import org.fossnova.json.stream.JsonWriter;
/**
+ * JSON object.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonObject extends JsonValue, Map< String, JsonValue > {
+ /**
+ * Delegates the call to {@link java.util.Map#containsKey(Object)} method.
+ * @param key JSON string
+ * @return <tt>true</tt> if this map contains a mapping for the specified key
+ */
boolean containsKey( final String key );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.Map#containsValue(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON object maps one or more keys to the specified value
+ */
boolean containsValue( final String value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.Map#containsValue(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON object maps one or more keys to the specified value
+ */
boolean containsValue( final Boolean value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.Map#containsValue(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON object maps one or more keys to the specified value
+ */
boolean containsValue( final Number value );
+ /**
+ * Delegates the call to {@link java.util.Map#containsValue(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON object maps one or more keys to the specified value
+ */
boolean containsValue( final JsonValue value );
+ /**
+ * Delegates the call to {@link java.util.Map#get(Object)} method.
+ * @param key JSON string
+ * @return the JSON value to which the specified key is mapped, or
+ * {@code null} if this JSON object contains no mapping for the key
+ */
JsonValue get( final String key );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.Map#put(Object, Object)} method.
+ * @param key JSON string
+ * @param value string to wrap
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>.
+ */
JsonValue put( final String key, final String value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.Map#put(Object, Object)} method.
+ * @param key JSON string
+ * @param value boolean to wrap
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>.
+ */
JsonValue put( final String key, final Boolean value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.Map#put(Object, Object)} method.
+ * @param key JSON string
+ * @param value number to wrap
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>.
+ */
JsonValue put( final String key, final Number value );
+ /**
+ * Delegates the call to {@link java.util.Map#remove(Object)} method.
+ * @param key JSON string
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>.
+ */
JsonValue remove( final String key );
+ /**
+ * Serializes this JSON object to the writer.
+ * @param writer to write to
+ * @throws IOException if some I/O error occurs.
+ */
void writeTo( JsonWriter writer ) throws IOException;
+ /**
+ * Clones this JSON object.
+ * @return new JSON object clone.
+ */
JsonObject clone();
}
View
17 modules/api/src/main/java/org/fossnova/json/JsonString.java
@@ -20,13 +20,28 @@
package org.fossnova.json;
/**
+ * JSON string.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonString extends JsonValue {
- void setString( String s );
+ /**
+ * Sets new string value.
+ * @param value new string value
+ */
+ void setString( String value );
+ /**
+ * Gets string value.
+ * @return string value
+ */
String getString();
+ /**
+ * Clones this JSON string.
+ * @return new JSON string clone.
+ */
JsonString clone();
}
View
5 modules/api/src/main/java/org/fossnova/json/JsonValue.java
@@ -22,9 +22,14 @@
import java.io.Serializable;
/**
+ * JSON value abstraction. All JSON values are serializable and cloneable.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
public interface JsonValue extends Cloneable, Serializable {
+ /**
+ * Clones this JSON value.
+ * @return new JSON value clone.
+ */
JsonValue clone();
}
View
43 modules/api/src/main/java/org/fossnova/json/JsonValueFactory.java
@@ -25,13 +25,28 @@
import org.fossnova.json.stream.JsonReader;
/**
+ * JSON values factory. Defines an abstract implementation of a factory for creating JSON values.
+ * All JSON values returned by this factory are not thread safe.
+ *
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonArray
+ * @see JsonBoolean
+ * @see JsonNumber
+ * @see JsonObject
+ * @see JsonString
*/
public abstract class JsonValueFactory {
+ /**
+ * All implementations must provide public default constructor overriding this one.
+ */
protected JsonValueFactory() {
}
+ /**
+ * Returns new JSON value factory instance.
+ * @return new JSON value factory instance
+ */
public static JsonValueFactory newInstance() {
final JsonValueFactory jsonFactoryImpl = FactoryFinder.find( JsonValueFactory.class );
if ( jsonFactoryImpl != null ) {
@@ -40,15 +55,43 @@ public static JsonValueFactory newInstance() {
throw new IllegalStateException( "Factory not configured: " + JsonValueFactory.class.getName() );
}
+ /**
+ * Creates new JSON object.
+ * @return JSON object instance
+ */
public abstract JsonObject newJsonObject();
+ /**
+ * Creates new JSON array.
+ * @return JSON array instance
+ */
public abstract JsonArray newJsonArray();
+ /**
+ * Creates new JSON boolean.
+ * @param value boolean value
+ * @return JSON boolean instance
+ */
public abstract JsonBoolean newJsonBoolean( Boolean value );
+ /**
+ * Creates new JSON number.
+ * @param value number value
+ * @return JSON number instance
+ */
public abstract JsonNumber newJsonNumber( Number value );
+ /**
+ * Creates new JSON string.
+ * @param value string value
+ * @return JSON string instance
+ */
public abstract JsonString newJsonString( String value );
+ /**
+ * Creates either JSON array or object instance.
+ * @param reader JSON reader
+ * @return JSON array or object instance
+ */
public abstract JsonValue readFrom( JsonReader reader ) throws IOException;
}
View
26 modules/api/src/main/java/org/fossnova/json/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2012, FOSS Nova Software foundation (FNSF),
+ * and individual contributors as indicated by the @author tags.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * <I>JSON Object Model (JOM)</I> for representing and interacting with <A href="http://www.json.org/">JSON</A> objects and arrays.
+ *
+ * @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ */
+package org.fossnova.json;
+
View
1  modules/api/src/main/java/org/fossnova/json/stream/JsonReader.java
@@ -29,7 +29,6 @@
*
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
* @see JsonStreamFactory
- * @see JsonWriter
*/
public interface JsonReader extends Closeable {
View
17 modules/api/src/main/java/org/fossnova/json/stream/JsonStreamFactory.java
@@ -28,10 +28,12 @@
import org.fossnova.finder.FactoryFinder;
/**
- * Defines an abstract implementation of a factory for getting JSON readers and
- * writers. All readers and writers returned by the factory are not thread safe.
+ * JSON streams factory. Defines an abstract implementation of a factory for getting JSON readers and
+ * writers. All readers and writers returned by this factory are not thread safe.
*
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonReader
+ * @see JsonWriter
*/
public abstract class JsonStreamFactory {
@@ -42,9 +44,8 @@ protected JsonStreamFactory() {
}
/**
- * Returns JSON factory instance.
- *
- * @return JSON factory instance
+ * Returns new JSON stream factory instance.
+ * @return new JSON stream factory instance
*/
public static JsonStreamFactory newInstance() {
final JsonStreamFactory jsonFactoryImpl = FactoryFinder.find( JsonStreamFactory.class );
@@ -56,7 +57,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON reader.
- *
* @param reader input
* @return JSON reader instance
*/
@@ -64,7 +64,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON writer.
- *
* @param writer output
* @return JSON writer instance
*/
@@ -72,7 +71,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON reader with default character set.
- *
* @param stream input
* @return JSON reader instance
* @throws UnsupportedEncodingException if default character set is not supported
@@ -81,7 +79,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON writer with default character set.
- *
* @param stream output
* @return JSON writer instance
* @throws UnsupportedEncodingException if default character set is not supported
@@ -90,7 +87,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON reader with specified character set.
- *
* @param stream input
* @param charsetName character set name
* @return JSON reader instance
@@ -100,7 +96,6 @@ public static JsonStreamFactory newInstance() {
/**
* Creates new JSON writer with specified character set.
- *
* @param stream output
* @param charsetName character set name
* @return JSON writer instance
View
1  modules/api/src/main/java/org/fossnova/json/stream/JsonWriter.java
@@ -29,7 +29,6 @@
*
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
* @see JsonStreamFactory
- * @see JsonReader
*/
public interface JsonWriter extends Closeable {
View
2  modules/api/src/main/java/org/fossnova/json/stream/package-info.java
@@ -18,7 +18,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
- * Streaming API for writing and reading <A href="http://www.json.org/">JSON</A>.
+ * <I>Streaming API for JSON (StAJ)</I> for reading and writing <A href="http://www.json.org/">JSON</A> documents.
*
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
*/
View
6 modules/impl/src/main/java/com/fossnova/json/JsonArrayImpl.java
@@ -269,10 +269,8 @@ public boolean retainAll( final Collection< ? > values ) {
return list.retainAll( values );
}
- public JsonArray subList( final int fromIndex, final int toIndex ) {
- final JsonArray jsonSubArray = new JsonArrayImpl();
- jsonSubArray.addAll( list.subList( fromIndex, toIndex ) );
- return jsonSubArray;
+ public List< JsonValue > subList( final int fromIndex, final int toIndex ) {
+ return list.subList( fromIndex, toIndex );
}
@Override
View
32 modules/impl/src/main/java/com/fossnova/json/JsonNumberImpl.java
@@ -37,36 +37,36 @@
this.value = value;
}
- JsonNumberImpl( final byte data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final byte value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final short data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final short value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final int data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final int value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final long data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final long value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final float data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final float value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final double data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final double value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final BigInteger data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final BigInteger value ) {
+ this.value = String.valueOf( value );
}
- JsonNumberImpl( final BigDecimal data ) {
- value = String.valueOf( data );
+ JsonNumberImpl( final BigDecimal value ) {
+ this.value = String.valueOf( value );
}
public void setByte( final byte value ) {
View
1  modules/tests/src/test/java/test/fossnova/json/JsonObjectTestCase.java
@@ -52,7 +52,6 @@
@Test
public void complexObject() throws IOException {
- System.out.println( serializeJson( COMPLEX_OBJECT ) );
assertJsonString( COMPLEX_OBJECT, "1", "b1" );
assertJsonNull( COMPLEX_OBJECT, "2" );
assertJsonBoolean( COMPLEX_OBJECT, "3", true );
Please sign in to comment.
Something went wrong with that request. Please try again.