|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AddressFactory
A collection of AddressSerializers. Addresss should register
themselves with this factory via the addSerializer() method at injection time.
| Method Summary | |
|---|---|
Address |
deserialize(String address)
turns a user-input String into an Address |
Address |
deserialize(String type,
byte[] serializedAddress)
Deserialize an address, typically as read from a network message |
AddressSerializer |
getSerializer(Class<? extends Address> addressClass)
|
AddressSerializer |
getSerializer(String addressType)
Looks up serializer by AddressSerializer.getAddressType(). |
void |
registerSerializer(AddressSerializer serializer)
Registers an AddressSerializer with this AddressFactory. |
| Method Detail |
|---|
void registerSerializer(AddressSerializer serializer)
serializer -
AddressSerializer getSerializer(Class<? extends Address> addressClass)
throws IllegalArgumentException
addressClass - cannot be null
IllegalArgumentException - if an AddressSerializer does not
exist for the specified classAddressSerializer getSerializer(String addressType)
AddressSerializer.getAddressType().
Address deserialize(String type,
byte[] serializedAddress)
throws IOException
type - the type of message contained in the byte array. Will match
AddressSerializer.getType() for the AddressSerialzer for the Address contained
in the byte []serializedAddress -
IOException - if there is an error deserializing the Address
Address deserialize(String address)
throws IOException
address -
IOException - if the input cannot be converted into an Address
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||