com.ibm.commons.util.io.json
Interface JsonFactory

All Known Implementing Classes:
JsonEmptyFactory, JsonFactoryDelegator, JsonJavaFactory

public interface JsonFactory

JSON factory.

This factory links the JSON classes with the actual physical objects. It is used by both the parser and the generator to access object properties and create new instance. Any kind of object hierarchy can be handled through implementations of the factory.


Method Summary
 java.lang.Object createArray(java.lang.Object parent, java.lang.String propertyName, java.util.List<java.lang.Object> values)
           
 java.lang.Object createBoolean(boolean value)
           
 java.lang.Object createNull()
           
 java.lang.Object createNumber(double value)
           
 java.lang.Object createObject(java.lang.Object parent, java.lang.String propertyName)
           
 java.lang.Object createString(java.lang.String value)
           
 java.util.List<java.lang.Object> createTemporaryArray(java.lang.Object parent)
           
 boolean getBoolean(java.lang.Object value)
           
 double getNumber(java.lang.Object value)
           
 java.lang.Object getProperty(java.lang.Object parent, java.lang.String propertyName)
           
 java.lang.String getString(java.lang.Object value)
           
 boolean isArray(java.lang.Object value)
           
 boolean isBoolean(java.lang.Object value)
           
 boolean isNull(java.lang.Object value)
           
 boolean isNumber(java.lang.Object value)
           
 boolean isObject(java.lang.Object value)
           
 boolean isString(java.lang.Object value)
           
 java.util.Iterator<java.lang.Object> iterateArrayValues(java.lang.Object array)
           
 java.util.Iterator<java.lang.String> iterateObjectProperties(java.lang.Object object)
           
 void setProperty(java.lang.Object parent, java.lang.String propertyName, java.lang.Object value)
           
 

Method Detail

createNull

java.lang.Object createNull()
                            throws JsonException
Throws:
JsonException

createString

java.lang.Object createString(java.lang.String value)
                              throws JsonException
Throws:
JsonException

createNumber

java.lang.Object createNumber(double value)
                              throws JsonException
Throws:
JsonException

createBoolean

java.lang.Object createBoolean(boolean value)
                               throws JsonException
Throws:
JsonException

createObject

java.lang.Object createObject(java.lang.Object parent,
                              java.lang.String propertyName)
                              throws JsonException
Throws:
JsonException

createArray

java.lang.Object createArray(java.lang.Object parent,
                             java.lang.String propertyName,
                             java.util.List<java.lang.Object> values)
                             throws JsonException
Throws:
JsonException

setProperty

void setProperty(java.lang.Object parent,
                 java.lang.String propertyName,
                 java.lang.Object value)
                 throws JsonException
Throws:
JsonException

getProperty

java.lang.Object getProperty(java.lang.Object parent,
                             java.lang.String propertyName)
                             throws JsonException
Throws:
JsonException

isNull

boolean isNull(java.lang.Object value)
               throws JsonException
Throws:
JsonException

isString

boolean isString(java.lang.Object value)
                 throws JsonException
Throws:
JsonException

getString

java.lang.String getString(java.lang.Object value)
                           throws JsonException
Throws:
JsonException

isNumber

boolean isNumber(java.lang.Object value)
                 throws JsonException
Throws:
JsonException

getNumber

double getNumber(java.lang.Object value)
                 throws JsonException
Throws:
JsonException

isBoolean

boolean isBoolean(java.lang.Object value)
                  throws JsonException
Throws:
JsonException

getBoolean

boolean getBoolean(java.lang.Object value)
                   throws JsonException
Throws:
JsonException

isObject

boolean isObject(java.lang.Object value)
                 throws JsonException
Throws:
JsonException

iterateObjectProperties

java.util.Iterator<java.lang.String> iterateObjectProperties(java.lang.Object object)
                                                             throws JsonException
Throws:
JsonException

isArray

boolean isArray(java.lang.Object value)
                throws JsonException
Throws:
JsonException

iterateArrayValues

java.util.Iterator<java.lang.Object> iterateArrayValues(java.lang.Object array)
                                                        throws JsonException
Throws:
JsonException

createTemporaryArray

java.util.List<java.lang.Object> createTemporaryArray(java.lang.Object parent)
                                                      throws JsonException
Throws:
JsonException