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.voidencode(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.JsonElementencodeToJson(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, waitMethods inherited from interface com.inductiveautomation.ignition.gateway.config.JsonResourceCodec
decode, decodeFromJsonMethods 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:ResourceCodecEncodes a resource's config object, and stores it in the resource in the appropriate location.- Specified by:
encodein interfaceResourceCodec<P extends ExtensionPointProfileConfig>
-
encodeToJson
public com.inductiveautomation.ignition.common.gson.JsonElement encodeToJson(ExtensionPointConfig<P, ?> resource) Description copied from interface:JsonResourceCodecConverts a resource config object instance to a JSON representation.- Specified by:
encodeToJsonin 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:JsonResourceCodecSimilar toJsonResourceCodec.decode(Resource), but decodes the resource's config from a JSON element.- Specified by:
decodeFromJsonin interfaceJsonResourceCodec<P extends ExtensionPointProfileConfig>- Throws:
DecodingException
-