Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Re-organization:

Samples:

	- Service Product Treasury Futures API - Horizon Change Attribution #1 (1, 2, 3)
	- Service Product Treasury Futures API - Horizon Change Attribution #2 (4, 5, 6)
	- Service Product Treasury Futures API - Horizon Change Attribution #3 (7, 8)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #1 (9, 10, 11)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #2 (12, 13, 14)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #3 (15, 16, 17)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #4 (18, 19, 20)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #5 (21, 22, 23)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #6 (24, 25, 26)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #7 (27, 28, 29)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #8 (30, 31, 32)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #9 (33, 34, 35)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #10 (36, 37, 38)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #11 (39, 40, 41)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #12 (42, 43, 44)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #13 (45, 46, 47)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #14 (48, 49, 50)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #15 (51, 52, 53)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #16 (54, 55, 56)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #17 (57, 58, 59)
	- Service Product Treasury Futures API - Horizon Key Rate Attribution #18 (60, 61, 62)
	- Service Product Treasury Futures API #1 (63, 64)
	- Service Product Treasury Futures API #2 (65, 66)
	- Service JSON Parser Container Factory #1 (67, 68, 69)
	- Service JSON Parser Container Factory - Create Object Container (70)
	- Service JSON Parser Container Factory - Create Array Container (71)
	- Service JSON Parser Container Factory #2 (72, 73)
	- Service JSON Parser Content Handler #1 (74, 75, 76)
	- Service JSON Parser Content Handler - Start (77)
	- Service JSON Parser Content Handler - End (78)
	- Service JSON Parser Content Handler - Start Object (79)
	- Service JSON Parser Content Handler - End Object (80)
	- Service JSON Parser Content Handler - Start Object Entry (81)
	- Service JSON Parser Content Handler - End Object Entry (82)
	- Service JSON Parser Content Handler - Start Array (83)
	- Service JSON Parser Content Handler - End Array (84)
	- Service JSON Parser Content Handler - Primitive (85)
	- Service JSON Parser Content Handler #2 (86, 87, 88)
	- Service JSON Parser Content Handler #3 (89, 90, 91)
	- Service JSON Parser Content Handler #4 (92, 93, 94)
	- Service JSON Parser Converter #1 (95, 96, 97)
	- Service JSON Parser Converter - String Entry #1 (98, 99)
	- Service JSON Parser Converter - String Entry #2 (100, 101, 102)
	- Service JSON Parser Converter - String Entry Array #1 (103, 104, 105)
	- Service JSON Parser Converter - String Entry Array #2 (106, 107, 108)
	- Service JSON Parser Converter - String Entry Array #3 (109, 110, 111)
	- Service JSON Parser Converter - Date Entry (112, 113)
	- Service JSON Parser Converter - Date Entry Array #1 (114, 115)
	- Service JSON Parser Converter - Date Entry Array #2 (116, 117)
	- Service JSON Parser Converter - Date Entry Array #3 (118, 119, 120)


IdeaDRIP:
  • Loading branch information
Lakshmik committed Jan 18, 2025
1 parent 08e94b3 commit 5773551
Show file tree
Hide file tree
Showing 5 changed files with 500 additions and 277 deletions.
60 changes: 60 additions & 0 deletions ReleaseNotes/05_07_2024.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

Features:

Bug Fixes/Re-organization:

Samples:

- Service Product Treasury Futures API - Horizon Change Attribution #1 (1, 2, 3)
- Service Product Treasury Futures API - Horizon Change Attribution #2 (4, 5, 6)
- Service Product Treasury Futures API - Horizon Change Attribution #3 (7, 8)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #1 (9, 10, 11)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #2 (12, 13, 14)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #3 (15, 16, 17)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #4 (18, 19, 20)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #5 (21, 22, 23)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #6 (24, 25, 26)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #7 (27, 28, 29)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #8 (30, 31, 32)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #9 (33, 34, 35)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #10 (36, 37, 38)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #11 (39, 40, 41)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #12 (42, 43, 44)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #13 (45, 46, 47)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #14 (48, 49, 50)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #15 (51, 52, 53)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #16 (54, 55, 56)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #17 (57, 58, 59)
- Service Product Treasury Futures API - Horizon Key Rate Attribution #18 (60, 61, 62)
- Service Product Treasury Futures API #1 (63, 64)
- Service Product Treasury Futures API #2 (65, 66)
- Service JSON Parser Container Factory #1 (67, 68, 69)
- Service JSON Parser Container Factory - Create Object Container (70)
- Service JSON Parser Container Factory - Create Array Container (71)
- Service JSON Parser Container Factory #2 (72, 73)
- Service JSON Parser Content Handler #1 (74, 75, 76)
- Service JSON Parser Content Handler - Start (77)
- Service JSON Parser Content Handler - End (78)
- Service JSON Parser Content Handler - Start Object (79)
- Service JSON Parser Content Handler - End Object (80)
- Service JSON Parser Content Handler - Start Object Entry (81)
- Service JSON Parser Content Handler - End Object Entry (82)
- Service JSON Parser Content Handler - Start Array (83)
- Service JSON Parser Content Handler - End Array (84)
- Service JSON Parser Content Handler - Primitive (85)
- Service JSON Parser Content Handler #2 (86, 87, 88)
- Service JSON Parser Content Handler #3 (89, 90, 91)
- Service JSON Parser Content Handler #4 (92, 93, 94)
- Service JSON Parser Converter #1 (95, 96, 97)
- Service JSON Parser Converter - String Entry #1 (98, 99)
- Service JSON Parser Converter - String Entry #2 (100, 101, 102)
- Service JSON Parser Converter - String Entry Array #1 (103, 104, 105)
- Service JSON Parser Converter - String Entry Array #2 (106, 107, 108)
- Service JSON Parser Converter - String Entry Array #3 (109, 110, 111)
- Service JSON Parser Converter - Date Entry (112, 113)
- Service JSON Parser Converter - Date Entry Array #1 (114, 115)
- Service JSON Parser Converter - Date Entry Array #2 (116, 117)
- Service JSON Parser Converter - Date Entry Array #3 (118, 119, 120)


IdeaDRIP:
43 changes: 32 additions & 11 deletions src/main/java/org/drip/service/jsonparser/ContainerFactory.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

package org.drip.service.jsonparser;

import java.util.List;
import java.util.Map;

/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -81,31 +87,46 @@

/**
* <i>ContainerFactory</i> is an Adaptation of the ContainerFactory Interface from the RFC4627 compliant JSON
* Simple (https://code.google.com/p/json-simple/).
* Simple (https://code.google.com/p/json-simple/). It provides the following Functionality:
*
* <br><br>
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationSupportLibrary.md">Computation Support</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/README.md">Environment, Product/Definition Containers, and Scenario/State Manipulation APIs</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/jsonparser">RFC4627 Compliant JSON Message Parser</a></li>
* <li>Retrieve the Map instance to store JSON object, or null if you want to use <code>org.json.simple.JSONObject</code></li>
* <li>Retrieve the Map instance to store JSON array, or null if you want to use <code>org.json.simple.JSONArray</code></li>
* </ul>
*
* <br>
* <table style="border:1px solid black;margin-left:auto;margin-right:auto;">
* <tr><td><b>Module </b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></td></tr>
* <tr><td><b>Library</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationSupportLibrary.md">Computation Support</a></td></tr>
* <tr><td><b>Project</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/README.md">Environment, Product/Definition Containers, and Scenario/State Manipulation APIs</a></td></tr>
* <tr><td><b>Package</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/jsonparser/README.md">RFC4627 Compliant JSON Message Parser</a></td></tr>
* </table>
* <br>
*
* @author Fang Yidong
* @author Lakshmi Krishnamurthy
*/

public interface ContainerFactory {
public interface ContainerFactory
{

/**
* @return A Map instance to store JSON object, or null if you want to use org.json.simple.JSONObject.
* Retrieve the Map instance to store JSON object, or null if you want to use
* <code>org.json.simple.JSONObject</code>
*
* @return A Map instance to store JSON object, or null if you want to use
* <code>org.json.simple.JSONObject</code>.
*/

@SuppressWarnings ("rawtypes") java.util.Map createObjectContainer();
@SuppressWarnings ("rawtypes") Map createObjectContainer();

/**
* @return A List instance to store JSON array, or null if you want to use org.json.simple.JSONArray.
* Retrieve the List instance to store JSON array, or null if you want to use
* <code>org.json.simple.JSONArray</code>
*
* @return A List instance to store JSON array, or null if you want to use
* <code>org.json.simple.JSONArray</code>.
*/

@SuppressWarnings ("rawtypes") java.util.List creatArrayContainer();
@SuppressWarnings ("rawtypes") List creatArrayContainer();
}
142 changes: 98 additions & 44 deletions src/main/java/org/drip/service/jsonparser/ContentHandler.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

package org.drip.service.jsonparser;

import java.io.IOException;

/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -81,39 +86,68 @@

/**
* <i>ContentHandler</i> is an Adaptation of the ContentHandler Interface from the RFC4627 compliant JSON
* Simple (https://code.google.com/p/json-simple/).
* Simple (https://code.google.com/p/json-simple/). It provides the following Functionality:
*
* <br><br>
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationSupportLibrary.md">Computation Support</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/README.md">Environment, Product/Definition Containers, and Scenario/State Manipulation APIs</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/jsonparser">RFC4627 Compliant JSON Message Parser</a></li>
* <li>Receive notification of the beginning of JSON processing. The parser will invoke this method only once</li>
* <li>Receive notification of the end of JSON processing</li>
* <li>Receive notification of the beginning of a JSON object</li>
* <li>Receive notification of the end of a JSON object</li>
* <li>Receive notification of the beginning of a JSON object entry</li>
* <li>Receive notification of the end of the value of previous object entry</li>
* <li>Receive notification of the beginning of a JSON array</li>
* <li>Receive notification of the end of a JSON array</li>
* <li>Receive notification of the JSON primitive values:</li>
* <ul>
* <li>java.lang.String</li>
* <li>java.lang.Number</li>
* <li>java.lang.Boolean</li>
* <li>null</li>
* </ul>
* </ul>
*
* <br>
* <table style="border:1px solid black;margin-left:auto;margin-right:auto;">
* <tr><td><b>Module </b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></td></tr>
* <tr><td><b>Library</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationSupportLibrary.md">Computation Support</a></td></tr>
* <tr><td><b>Project</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/README.md">Environment, Product/Definition Containers, and Scenario/State Manipulation APIs</a></td></tr>
* <tr><td><b>Package</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/jsonparser/README.md">RFC4627 Compliant JSON Message Parser</a></td></tr>
* </table>
* <br>
*
* @author Fang Yidong
* @author Lakshmi Krishnamurthy
*/

public interface ContentHandler {
/**
* Receive notification of the beginning of JSON processing.
* The parser will invoke this method only once.
public interface ContentHandler
{

/**
* Receive notification of the beginning of JSON processing. The parser will invoke this method only
* once.
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*/
void startJSON() throws ParseException, java.io.IOException;

void startJSON()
throws ParseException, IOException;

/**
* Receive notification of the end of JSON processing.
* Receive notification of the end of JSON processing
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*/
void endJSON() throws ParseException, java.io.IOException;

void endJSON()
throws ParseException, IOException;

/**
* Receive notification of the beginning of a JSON object.
Expand All @@ -122,23 +156,29 @@ public interface ContentHandler {
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @see #endJSON
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @see #endJSON
*/
boolean startObject() throws ParseException, java.io.IOException;

boolean startObject()
throws ParseException, IOException;

/**
* Receive notification of the end of a JSON object.
*
* @return false if the handler wants to stop parsing after return.
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #startObject
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @see #startObject
*/
boolean endObject() throws ParseException, java.io.IOException;

boolean endObject()
throws ParseException, IOException;

/**
* Receive notification of the beginning of a JSON object entry.
Expand All @@ -147,13 +187,18 @@ public interface ContentHandler {
*
* @return false if the handler wants to stop parsing after return.
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #endObjectEntry
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving
* this exception.
*
* @see #endObjectEntry
*/
boolean startObjectEntry(String key) throws ParseException, java.io.IOException;

boolean startObjectEntry (
final String key)
throws ParseException, IOException;

/**
* Receive notification of the end of the value of previous object entry.
Expand All @@ -162,11 +207,13 @@ public interface ContentHandler {
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #startObjectEntry
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #startObjectEntry
*/
boolean endObjectEntry() throws ParseException, java.io.IOException;

boolean endObjectEntry()
throws ParseException, IOException;

/**
* Receive notification of the beginning of a JSON array.
Expand All @@ -175,11 +222,13 @@ public interface ContentHandler {
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #endArray
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #endArray
*/
boolean startArray() throws ParseException, java.io.IOException;

boolean startArray()
throws ParseException, IOException;

/**
* Receive notification of the end of a JSON array.
Expand All @@ -188,11 +237,13 @@ public interface ContentHandler {
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #startArray
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @see #startArray
*/
boolean endArray() throws ParseException, java.io.IOException;

boolean endArray()
throws ParseException, IOException;

/**
* Receive notification of the JSON primitive values:
Expand All @@ -211,7 +262,10 @@ public interface ContentHandler {
*
* @throws ParseException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*
* @throws java.io.IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
* @throws IOException JSONParser will stop and throw the same exception to the caller when receiving this exception.
*/
boolean primitive(Object value) throws ParseException, java.io.IOException;

boolean primitive (
final Object value)
throws ParseException, IOException;
}
Loading

0 comments on commit 5773551

Please sign in to comment.