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
ConstructorsConstructorDescriptionConstruct 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 customAddressParserAddressDeserializer(org.bitcoinj.base.Network network) Construct an address deserializer that validates addresses for the specifiedNetwork. -
Method Summary
Modifier and TypeMethodDescriptionorg.bitcoinj.base.Addressdeserialize(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. SeeNetworkto 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 aInvalidFormatExceptionto 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:
deserializein classJsonDeserializer<org.bitcoinj.base.Address>- Throws:
IOExceptionJsonProcessingException
-