Class AddressDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<org.bitcoinj.base.Address>
org.consensusj.bitcoin.json.conversion.AddressDeserializer
- All Implemented Interfaces:
NullValueProvider
Deserialize bitcoinj (family) addresses
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
JsonDeserializer.None
-
Constructor Summary
ConstructorDescriptionConstruct an address deserializer that will deserialize addresses for any of the default supported networks.AddressDeserializer
(org.bitcoinj.base.AddressParser addressParser) Construct an address deserializer with a customAddressParser
AddressDeserializer
(org.bitcoinj.base.Network network) Construct an address deserializer that validates addresses for the specifiedNetwork
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bitcoinj.base.Address
deserialize
(JsonParser p, DeserializationContext ctxt) Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
AddressDeserializer
public AddressDeserializer()Construct an address deserializer that will deserialize addresses for any of the default supported networks. SeeNetwork
to understand what the supported networks are. -
AddressDeserializer
Construct an address deserializer that validates addresses for the specifiedNetwork
. When deserializing addresses, addresses that are not from the specified network will cause aInvalidFormatException
to be thrown during deserialization.- Parameters:
network
- Network id to specify the only network we will deserialize addresses for.
-
AddressDeserializer
Construct an address deserializer with a customAddressParser
- Parameters:
addressParser
- parser to convert a string to an address
-
-
Method Details
-
deserialize
public org.bitcoinj.base.Address deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException - Specified by:
deserialize
in classJsonDeserializer<org.bitcoinj.base.Address>
- Throws:
IOException
JsonProcessingException
-