Package org.ghotibeaun.json
Class JSONFactory
java.lang.Object
org.ghotibeaun.json.JSONFactory
public abstract class JSONFactory extends Object
Factory class used to instantiate a new
JSONParser
. For anyone
familiar with JAXP,
this API uses the same type of pattern.
Example
JSONFactory factory = JSONFactory.newFactory(); //Use the factory to create a new Parser JSONParser parser = factory.newParser(); //Now use the parser to create a new JSONObject, using one of its methods - we'll create an empty one here... JSONObject json = parser.newJSONObject();
- Author:
- jearley
-
Constructor Summary
Constructors Constructor Description JSONFactory()
-
Method Summary
Modifier and Type Method Description abstract JSONCSVParser
newCsvParser()
abstract JSONCSVParser
newCsvParser(CSVSettings settings)
static JSONFactory
newFactory()
Create a new factory implementation.static JSONFactory
newFactory(boolean useDefaultSettings)
abstract JSONParser
newParser()
Instantiate the underlyingJSONParser
implementation for this factoryabstract JSONSerializer
newSerializer()
Instantiate the underlyingJSONSerializer
implementation for this factory
-
Constructor Details
-
JSONFactory
public JSONFactory()
-
-
Method Details
-
newFactory
Create a new factory implementation. The factory will instantiate a newJSONParser
- Returns:
- a new factory
- Throws:
JSONFactoryException
-
newFactory
- Throws:
JSONFactoryException
-
newParser
Instantiate the underlyingJSONParser
implementation for this factory- Returns:
- the
JSONParser
- Throws:
JSONParserException
-
newSerializer
Instantiate the underlyingJSONSerializer
implementation for this factory- Returns:
- the
JSONSerializer
- Throws:
JSONSerializationException
-
newCsvParser
-
newCsvParser
-