Package jsonStorage
Class JSONObjectDataSource<DataSource extends JSONObjectData>
java.lang.Object
jsonStorage.JSONObjectDataSource<DataSource>
- Direct Known Subclasses:
ClickBackgroundJSONDataSource
,ClickJSONDataSource
,WhistleJSONDataSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataSource
The data object to load parameters into - this is what will be used to generate the JSON string. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Don't do anything in the generic constructor, but the subclass that extends this class MUST INSTANTIATE A CONCRETE VERSION OF THE objectData FIELD USING THE CLASS-SPECIFIC JSONOBJECTDATA. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addClassSpecificFields
(PamDataUnit pamDataUnit) Add fields specific to this subclassgetPackedObject
(PamDataUnit dataUnit) Return a json-formatted string generated from the fields in this objectprotected abstract void
setObjectType
(PamDataUnit pamDataUnit) Set the object type specific to this subclass.
-
Field Details
-
Constructor Details
-
JSONObjectDataSource
protected JSONObjectDataSource()Don't do anything in the generic constructor, but the subclass that extends this class MUST INSTANTIATE A CONCRETE VERSION OF THE objectData FIELD USING THE CLASS-SPECIFIC JSONOBJECTDATA.
Example: for the Whistle invalid input: '&' Moan Detector...
- the class WhistleJSONData extends JSONObjectData
- the class WhistleJSONDataSource extends JSONObjectDataSource
... - ...and in it's constructor, it sets objectData = new WhistleJSONData();
-
-
Method Details
-
getPackedObject
Return a json-formatted string generated from the fields in this object- Returns:
-
addClassSpecificFields
Add fields specific to this subclass -
setObjectType
Set the object type specific to this subclass. This is typically the objectType field from the subclass' implementation of the BInaryObjectData class. BinaryObjectData is often created in the subclass' BinaryDataSource.getPackedData() method.- Parameters:
pamDataUnit
-
-