com.serotonin.m2m2.module
Class EmportDefinition
java.lang.Object
com.serotonin.m2m2.module.ModuleElementDefinition
com.serotonin.m2m2.module.EmportDefinition
public abstract class EmportDefinition
- extends ModuleElementDefinition
Import/Export functionality (aka 'emport') is a powerful feature that allows configuration to be imported or exported
via JSON files. An emport definition provides the information necessary to add new elements to the available emport
list.
- Author:
- Matthew Lohbihler
Method Summary |
abstract void |
doImport(com.serotonin.json.JsonValue json,
com.serotonin.m2m2.web.dwr.emport.ImportContext importContext)
Import the given JSON data. |
abstract java.lang.String |
getDescriptionKey()
|
abstract java.lang.String |
getElementId()
|
abstract java.lang.Object |
getExportData()
|
boolean |
importAsList()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmportDefinition
public EmportDefinition()
getElementId
public abstract java.lang.String getElementId()
- Returns:
- the emport element id. Required to be unique within the m2m2 instance.
getDescriptionKey
public abstract java.lang.String getDescriptionKey()
- Returns:
- a reference key to the brief description to be used for this emport element.
getExportData
public abstract java.lang.Object getExportData()
- Returns:
- the data to be converted to JSON. Can be a Map, a
JsonSerializable
, or a
JsonRemoteEntity
importAsList
public boolean importAsList()
doImport
public abstract void doImport(com.serotonin.json.JsonValue json,
com.serotonin.m2m2.web.dwr.emport.ImportContext importContext)
throws com.serotonin.json.JsonException
- Import the given JSON data.
- Parameters:
json
- the JSON data to importimportContext
- the import context
- Throws:
com.serotonin.json.JsonException