Class Decoder
- java.lang.Object
-
- com.supermap.services.rest.decoders.Decoder
-
- Direct Known Subclasses:
- FastJsonDecoder, JsonDecoder, ObjectStreamDecoder, XMLDecoder
public abstract class Decoder extends java.lang.Object${services_rest_decoders_Decoder_Title}
${services_rest_decoders_Decoder_Description}
-
-
Constructor Summary
Constructors Constructor and Description Decoder()${services_rest_decoders_Decoder_constructor_Decoder_Title}
-
Method Summary
Methods Modifier and Type Method and Description protected abstract java.util.List<MediaType>createSupportedMediaTypes()${services_rest_decoders_Decoder_method_createSupportedMediaTypes_Title}java.util.List<MediaType>getSupportedMediaTypes()Creates a list of media types supported by this parser.booleanisDecoderAllow(MediaType acceptedMediaType)${services_rest_decoders_Decoder_method_isDecoderAllow_Title}abstract <T> java.util.List<T>toList(java.lang.String text, java.lang.Class<T> elementClass)Converts the parameter string to a java.util.List object of the specified element type.abstract java.util.Map<java.lang.String,java.lang.Object>toMap(java.lang.String str, java.util.Map<java.lang.String,java.lang.Class> nameClassMapping)Converts the parameter string to the specified type of java.util.Map mapping set.abstract <T> TtoObject(java.lang.String jsonStr, java.lang.Class<T> cl)Converts a parameter string to a specified type of Java object.abstract java.util.SettoSet(java.lang.String text, java.lang.Class elementClass)Converts the parameter string to a java.util.Set object of the specified element type.
-
-
-
Constructor Detail
-
Decoder
public Decoder()
${services_rest_decoders_Decoder_constructor_Decoder_Title}
${services_rest_decoders_Decoder_constructor_Decoder_Description}
-
-
Method Detail
-
getSupportedMediaTypes
public java.util.List<MediaType> getSupportedMediaTypes()
Creates a list of media types supported by this parser. That is, what type of parameters can be specified.
${services_rest_decoders_Decoder_method_getSupportedMediaTypes_Description}
- Returns:
- ${services_rest_decoders_Decoder_method_getSupportedMediaTypes_return}
-
isDecoderAllow
public boolean isDecoderAllow(MediaType acceptedMediaType)
${services_rest_decoders_Decoder_method_isDecoderAllow_Title}
${services_rest_decoders_Decoder_method_isDecoderAllow_Description}
- Parameters:
acceptedMediaType- ${services_rest_decoders_Decoder_method_isDecoderAllow_param_acceptedMediaType}- Returns:
- ${services_rest_decoders_Decoder_method_isDecoderAllow_return}
-
toObject
public abstract <T> T toObject(java.lang.String jsonStr, java.lang.Class<T> cl) throws java.lang.ExceptionConverts a parameter string to a specified type of Java object.
${services_rest_decoders_Decoder_method_toObject_Description}
- Parameters:
jsonStr- ${services_rest_decoders_Decoder_method_toObject_param_jsonStr}cl- ${services_rest_decoders_Decoder_method_toObject_param_cl}- Returns:
- ${services_rest_decoders_Decoder_method_toObject_return}
- Throws:
java.lang.Exception- ${services_rest_decoders_Decoder_method_toObject_throws_Exception}
-
toMap
public abstract java.util.Map<java.lang.String,java.lang.Object> toMap(java.lang.String str, java.util.Map<java.lang.String,java.lang.Class> nameClassMapping)Converts the parameter string to the specified type of java.util.Map mapping set.
${services_rest_decoders_Decoder_method_toMap_Description}
- Parameters:
str- wants to convert the parameter string.nameClassMapping- java.util.Map Mapping set. Where the key is the field name and the value is the type of the field.- Returns:
- java.util.Map Parameter mapping set. Where the key is the field name and the value is the corresponding Java object.
-
toList
public abstract <T> java.util.List<T> toList(java.lang.String text, java.lang.Class<T> elementClass) throws java.lang.ExceptionConverts the parameter string to a java.util.List object of the specified element type.- Parameters:
text- wants to convert the parameter string.elementClass- List specifies target element type.- Returns:
- java.util.List A list of parameters.
- Throws:
java.lang.Exception- An error has occurred in the decoding process, throwing a java.lang.Exception exception. For example, if the incoming string is not enough to build a Java object, or if the request is not met, an exception is thrown.
-
toSet
public abstract java.util.Set toSet(java.lang.String text, java.lang.Class elementClass) throws java.lang.ExceptionConverts the parameter string to a java.util.Set object of the specified element type.- Parameters:
text- wants to convert the parameter string.elementClass- Set specifies target element type.- Returns:
- java.util.Set type of parameter collection.
- Throws:
java.lang.Exception- An error has occurred in the decoding process, throwing a java.lang.Exception exception. For example, if the incoming string is not enough to build a Java object, or if the request is not met, an exception is thrown.
-
createSupportedMediaTypes
protected abstract java.util.List<MediaType> createSupportedMediaTypes()
${services_rest_decoders_Decoder_method_createSupportedMediaTypes_Title}
${services_rest_decoders_Decoder_method_createSupportedMediaTypes_Description}
- Returns:
- ${services_rest_decoders_Decoder_method_createSupportedMediaTypes_return}
-
-