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 JSONCSVParsernewCsvParser()abstract JSONCSVParsernewCsvParser(CSVSettings settings)static JSONFactorynewFactory()Create a new factory implementation.static JSONFactorynewFactory(boolean useDefaultSettings)abstract JSONParsernewParser()Instantiate the underlyingJSONParserimplementation for this factoryabstract JSONSerializernewSerializer()Instantiate the underlyingJSONSerializerimplementation 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 underlyingJSONParserimplementation for this factory- Returns:
- the
JSONParser - Throws:
JSONParserException
-
newSerializer
Instantiate the underlyingJSONSerializerimplementation for this factory- Returns:
- the
JSONSerializer - Throws:
JSONSerializationException
-
newCsvParser
-
newCsvParser
-