Class ExtensionPointResourceCodec<P extends ExtensionPointProfileConfig>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.ExtensionPointResourceCodec<P>
- All Implemented Interfaces:
JsonResourceCodec<ExtensionPointConfig<P,
,?>> ResourceCodec<ExtensionPointConfig<P,
?>>
public class ExtensionPointResourceCodec<P extends ExtensionPointProfileConfig>
extends Object
implements JsonResourceCodec<ExtensionPointConfig<P,?>>
This ResourceCodec is used to encode and decode ExtensionPointConfig objects, which are pairs of a "profile"
object and a "settings" object. The profile object is a configuration object that is common to all instances of
a particular extension point category. The settings object is a configuration object that is specific to a particular
extension point type.
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionPointResourceCodec
(Class<P> profileType, ExtensionPointCollection<? extends ExtensionPoint<?>> extensionPointCollection, com.inductiveautomation.ignition.common.gson.Gson gson, ResourceValidator<P> profileValidator) -
Method Summary
Modifier and TypeMethodDescriptiondecodeFromJson
(com.inductiveautomation.ignition.common.gson.JsonElement json) Similar toJsonResourceCodec.decode(Resource)
, but decodes the resource's config from a JSON element.void
encode
(ExtensionPointConfig<P, ?> config, ResourceBuilder builder) Encodes a resource's config object, and stores it in the resource in the appropriate location.com.inductiveautomation.ignition.common.gson.JsonElement
encodeToJson
(ExtensionPointConfig<P, ?> resource) Converts a resource config object instance to a JSON representation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.gateway.config.JsonResourceCodec
decode, decodeFromJson
Methods inherited from interface com.inductiveautomation.ignition.gateway.config.ResourceCodec
decodeIfValid
-
Constructor Details
-
ExtensionPointResourceCodec
public ExtensionPointResourceCodec(@Nonnull Class<P> profileType, @Nonnull ExtensionPointCollection<? extends ExtensionPoint<?>> extensionPointCollection, @Nonnull com.inductiveautomation.ignition.common.gson.Gson gson, @Nullable ResourceValidator<P> profileValidator)
-
-
Method Details
-
encode
Description copied from interface:ResourceCodec
Encodes a resource's config object, and stores it in the resource in the appropriate location.- Specified by:
encode
in interfaceResourceCodec<P extends ExtensionPointProfileConfig>
-
encodeToJson
public com.inductiveautomation.ignition.common.gson.JsonElement encodeToJson(ExtensionPointConfig<P, ?> resource) Description copied from interface:JsonResourceCodec
Converts a resource config object instance to a JSON representation.- Specified by:
encodeToJson
in interfaceJsonResourceCodec<P extends ExtensionPointProfileConfig>
- Parameters:
resource
- The resource to convert.- Returns:
- A JSON representation of the resource.
-
decodeFromJson
public ExtensionPointConfig<P,?> decodeFromJson(com.inductiveautomation.ignition.common.gson.JsonElement json) throws DecodingException Description copied from interface:JsonResourceCodec
Similar toJsonResourceCodec.decode(Resource)
, but decodes the resource's config from a JSON element.- Specified by:
decodeFromJson
in interfaceJsonResourceCodec<P extends ExtensionPointProfileConfig>
- Throws:
DecodingException
-