|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.crm.SnailMailAddress
public class SnailMailAddress
represents a structured local address
ImmutableSnailMailAddress,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.Localizable |
|---|
Localizable.Adapter |
| Field Summary | |
|---|---|
static DataFlavor |
ADDRESS_FLAVOR
|
| Constructor Summary | |
|---|---|
SnailMailAddress()
|
|
SnailMailAddress(SnailMailAddress adr)
|
|
SnailMailAddress(String fullAddress)
the given String is used as the overriding fullAddress for the default locale |
|
| Method Summary | |
|---|---|
void |
clearAll()
allows to clear all fields of this address |
boolean |
equals(Object obj)
|
void |
exportXML(OutputStream out)
exports the entire object as XML and writes it to the given Writer, so that the object can be reconstructed with importXML(InputSource). |
String |
getAddressString()
returns the address string to be used for the current locale |
String |
getAddressString(Locale l)
returns the address for use in a document. |
String |
getCity()
|
String |
getCountry()
returns the ISO 3166 2-letter code |
String |
getCountryName()
|
String |
getCountryName(Locale l)
|
String |
getFormattedAddress()
calls getFormattedAddress(Locale) with the current locale |
String |
getFormattedAddress(Locale l)
constructs the address based on certain standards; a plain '\n' is used for line breaks. |
String |
getFullAddress()
calls getFullAddress([current locale]) |
String |
getFullAddress(Locale l)
a non-null return value is used to override how the address is constructed |
Map<Locale,String> |
getFullAddressMap()
returns an unmodifiable view of the embedded full address map |
Locale |
getLocale()
allows access to the Locale that this instance currently uses to localize its messages, |
String |
getState()
|
String |
getStreet()
may contain multiple lines |
String |
getStreetNumber()
|
String |
getTitle()
may contain multiple lines |
String |
getZip()
|
int |
hashCode()
|
void |
importXML(InputStream source)
The object is fully reinitialized with the XML data contained in the given ImputSource, so that the object has the same state as it had during export. |
boolean |
isEmpty()
returns true only if all fields are null |
void |
replaceEmptyStringsWithNull()
|
boolean |
requiresState()
|
static boolean |
requiresState(String countryCode)
|
boolean |
sameAs(SnailMailAddress adr)
|
void |
setAllFrom(SnailMailAddress adr)
copies the properties of the given object and applies them to this instance, so that its behavior in regards to the given object can be matched to the extend that the implementing class supports that behavior. |
void |
setCity(String city)
|
void |
setCountry(String country)
uses the ISO 3166 2-letter code |
String |
setFullAddress(String fullAddress)
sets the address for the current Locale |
String |
setFullAddress(String fullAddress,
Locale l)
a non-null parameter is used to override how the address is constructed |
void |
setFullAddressMap(Map<Locale,String> map)
|
void |
setLocale(Locale locale)
|
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values of method calls to this instance can be localized accordingly until a different Locale is set. |
void |
setState(String state)
|
void |
setStreet(String street)
may contain multiple lines |
void |
setStreetNumber(String sn)
|
void |
setTitle(String title)
may contain multiple lines |
void |
setZip(String zip)
|
String |
toDetailedString()
provides full details of this instance in a String. |
String |
toString()
returns the address title in a single line if available |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DataFlavor ADDRESS_FLAVOR
| Constructor Detail |
|---|
public SnailMailAddress()
public SnailMailAddress(String fullAddress)
public SnailMailAddress(SnailMailAddress adr)
| Method Detail |
|---|
public Locale getLocale()
Localizable
getLocale in interface LocalizableLocalizable.setLocale(Locale, Object)
public void setLocale(Locale locale,
Object context)
Localizable
setLocale in interface Localizablelocale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.Localizable.getLocale()public void setLocale(Locale locale)
public void exportXML(OutputStream out)
throws IOException
XMLSerializableimportXML(InputSource).
The given stream is neither flushed nor closed, so that other data may be
effectively written to the InputSource after the method returned.
exportXML in interface XMLSerializableIOExceptionXMLSerializable.importXML(InputStream)
public void importXML(InputStream source)
throws SAXException,
IOException
XMLSerializable
importXML in interface XMLSerializableSAXException
IOExceptionXMLSerializable.exportXML(OutputStream)public void clearAll()
public boolean isEmpty()
public void setAllFrom(SnailMailAddress adr)
throws NullPointerException
Forgeable
setAllFrom in interface Forgeable<SnailMailAddress>adr - the object whose behavior is to be copied to this instance
NullPointerException - if the given object parameter is nullpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic boolean sameAs(SnailMailAddress adr)
public String toString()
toString in class ObjectgetAddressString()public String toDetailedString()
DetailedString
toDetailedString in interface DetailedString@Localized public String getAddressString()
public String getAddressString(Locale l)
getFullAddress(Locale),
getFormattedAddress(Locale)public String getFullAddress()
public String getFullAddress(Locale l)
public String setFullAddress(String fullAddress)
public String setFullAddress(String fullAddress,
Locale l)
getAddressString(Locale)public Map<Locale,String> getFullAddressMap()
public void setFullAddressMap(Map<Locale,String> map)
public String getFormattedAddress()
getFormattedAddress(Locale)public String getFormattedAddress(Locale l)
public boolean requiresState()
public static boolean requiresState(String countryCode)
public String getTitle()
public void setTitle(String title)
public String getStreet()
public void setStreet(String street)
public String getStreetNumber()
public void setStreetNumber(String sn)
public String getCity()
public void setCity(String city)
public String getZip()
public void setZip(String zip)
public final String getCountry()
public String getCountryName()
public String getCountryName(Locale l)
public void setCountry(String country)
throws IllegalArgumentException
IllegalArgumentExceptionpublic String getState()
public void setState(String state)
public void replaceEmptyStringsWithNull()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||