public abstract class JSONDecoder<T> extends Object implements Decoder<T,com.fasterxml.jackson.databind.JsonNode>
Modifier and Type | Field and Description |
---|---|
private Set<DecoderKey> |
decoderKeys |
Constructor and Description |
---|
JSONDecoder(Class<T> type) |
JSONDecoder(Set<DecoderKey> keys) |
Modifier and Type | Method and Description |
---|---|
T |
decode(com.fasterxml.jackson.databind.JsonNode objectToDecode)
Decode a object to another representation.
|
abstract T |
decodeJSON(com.fasterxml.jackson.databind.JsonNode node,
boolean validate) |
protected <T> T |
decodeJsonToObject(com.fasterxml.jackson.databind.JsonNode json,
Class<T> type) |
protected <T> List<T> |
decodeJsonToObjectList(com.fasterxml.jackson.databind.JsonNode node,
Class<T> type) |
Set<String> |
getConformanceClasses() |
private <T> Decoder<T,com.fasterxml.jackson.databind.JsonNode> |
getDecoder(Class<T> type) |
Set<DecoderKey> |
getDecoderKeyTypes() |
Map<ServiceConstants.SupportedTypeKey,Set<String>> |
getSupportedTypes()
Get the ServiceConstants.SupportedTypeKey in the case of having only generic
java types, e.g.
|
protected CodeType |
parseCodeType(com.fasterxml.jackson.databind.JsonNode node) |
protected CodeWithAuthority |
parseCodeWithAuthority(com.fasterxml.jackson.databind.JsonNode node) |
protected org.joda.time.DateTime |
parseDateTime(String time) |
protected Time |
parseTime(com.fasterxml.jackson.databind.JsonNode node) |
protected TimeInstant |
parseTimeInstant(com.fasterxml.jackson.databind.JsonNode node) |
protected TimePeriod |
parseTimePeriod(com.fasterxml.jackson.databind.JsonNode node) |
private final Set<DecoderKey> decoderKeys
public JSONDecoder(Set<DecoderKey> keys)
private <T> Decoder<T,com.fasterxml.jackson.databind.JsonNode> getDecoder(Class<T> type) throws NoDecoderForKeyException
NoDecoderForKeyException
protected <T> T decodeJsonToObject(com.fasterxml.jackson.databind.JsonNode json, Class<T> type) throws OwsExceptionReport
OwsExceptionReport
protected <T> List<T> decodeJsonToObjectList(com.fasterxml.jackson.databind.JsonNode node, Class<T> type) throws OwsExceptionReport
OwsExceptionReport
public Set<DecoderKey> getDecoderKeyTypes()
getDecoderKeyTypes
in interface Decoder<T,com.fasterxml.jackson.databind.JsonNode>
DecoderKey
) is able to decodepublic T decode(com.fasterxml.jackson.databind.JsonNode objectToDecode) throws OwsExceptionReport
Decoder
decode
in interface Decoder<T,com.fasterxml.jackson.databind.JsonNode>
objectToDecode
- the object to encodeOwsExceptionReport
- if an error occursUnsupportedDecoderInputException
- if the supplied type (or any of it's contents) is not
supported by this decoderpublic Map<ServiceConstants.SupportedTypeKey,Set<String>> getSupportedTypes()
Decoder
getSupportedTypes
in interface Decoder<T,com.fasterxml.jackson.databind.JsonNode>
public Set<String> getConformanceClasses()
getConformanceClasses
in interface ConformanceClass
protected TimeInstant parseTimeInstant(com.fasterxml.jackson.databind.JsonNode node) throws DateTimeParseException
DateTimeParseException
protected TimePeriod parseTimePeriod(com.fasterxml.jackson.databind.JsonNode node) throws DateTimeParseException
DateTimeParseException
protected org.joda.time.DateTime parseDateTime(String time) throws DateTimeParseException
DateTimeParseException
protected Time parseTime(com.fasterxml.jackson.databind.JsonNode node) throws DateTimeParseException
DateTimeParseException
protected CodeWithAuthority parseCodeWithAuthority(com.fasterxml.jackson.databind.JsonNode node)
protected CodeType parseCodeType(com.fasterxml.jackson.databind.JsonNode node)
public abstract T decodeJSON(com.fasterxml.jackson.databind.JsonNode node, boolean validate) throws OwsExceptionReport
OwsExceptionReport
Copyright © 2012-2015 52north.org. All Rights Reserved.