Package org.btrplace.json.model.view
Class NamingServiceConverter
java.lang.Object
org.btrplace.json.model.view.NamingServiceConverter
- All Implemented Interfaces:
ModelViewConverter<NamingService>
public class NamingServiceConverter extends Object implements ModelViewConverter<NamingService>
Serialize/Un-serialize an
NamingService
.- Author:
- Fabien Hermenier
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NamingServiceConverter()
-
Method Summary
Modifier and Type Method Description NamingService<? extends Element>
fromJSON(Model mo, net.minidev.json.JSONObject o)
Convert a json-encoded view.String
getJSONId()
Get the JSON identifier for the view.Class<NamingService>
getSupportedView()
Get the className of the view that is supported by the converter.net.minidev.json.JSONObject
toJSON(NamingService rc)
Serialise a view.
-
Constructor Details
-
NamingServiceConverter
public NamingServiceConverter()
-
-
Method Details
-
getSupportedView
Description copied from interface:ModelViewConverter
Get the className of the view that is supported by the converter.- Specified by:
getSupportedView
in interfaceModelViewConverter<NamingService>
- Returns:
- The view class
-
getJSONId
Description copied from interface:ModelViewConverter
Get the JSON identifier for the view.- Specified by:
getJSONId
in interfaceModelViewConverter<NamingService>
- Returns:
- a non-empty string
-
toJSON
Description copied from interface:ModelViewConverter
Serialise a view.- Specified by:
toJSON
in interfaceModelViewConverter<NamingService>
- Parameters:
rc
- the view- Returns:
- the resulting encoded view
-
fromJSON
public NamingService<? extends Element> fromJSON(Model mo, net.minidev.json.JSONObject o) throws JSONConverterExceptionDescription copied from interface:ModelViewConverter
Convert a json-encoded view.- Specified by:
fromJSON
in interfaceModelViewConverter<NamingService>
- Parameters:
mo
- the model to rely ono
- the view to decode- Returns:
- the resulting view
- Throws:
JSONConverterException
- if the conversion failed
-