|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBEntry
com.antelmann.db.PropertyEntryImpl
com.antelmann.crm.PropertyEntryWithAddress
public class PropertyEntryWithAddress
implements a PropertyEntry that stores a GlobalAddress through its properties;
this class can also serve as a configuration helper for a mapper that embeds storing a GlobalAddress.
GlobalAddress,
AddressKey,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.Converter |
|---|
Converter.Adapter<T1,T2> |
| Field Summary |
|---|
| Fields inherited from class com.antelmann.db.PropertyEntryImpl |
|---|
propertyChangeSupport, props, um, vcs |
| Fields inherited from interface com.antelmann.db.DBEntry |
|---|
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR |
| Constructor Summary | |
|---|---|
PropertyEntryWithAddress()
convenience constructor when used only as a configuration object |
|
PropertyEntryWithAddress(InputStream in)
loads Properties from the given stream and uses that to configure this instance |
|
PropertyEntryWithAddress(Map<?,?> keyMap)
constructs an instance that can be used as a configuration for mapping |
|
PropertyEntryWithAddress(Object id)
|
|
PropertyEntryWithAddress(Object id,
Map<String,?> map)
|
|
PropertyEntryWithAddress(Object id,
PropertyEntry pe)
|
|
| Method Summary | |
|---|---|
void |
addressToProperties(boolean useChangePropertyMethod)
transfers the embedded address into the properties (to be called before this instance is stored back into the database) |
void |
addressToProperties(GlobalAddress address,
Map<String,Object> props)
this transformation is strictly based solely on Strings or Double (not PhoneNumber, URL, or the alike); the given map must support mapping to null values |
void |
addressToProperties(GlobalAddress address,
PropertyEntry entry)
this transformation is strictly based solely on Strings or Double (not PhoneNumber, URL, or the alike) |
protected void |
checkPropertyChange(String key,
Object value)
determines whether a property can be changed as given. |
void |
clearAddressKeys()
|
GlobalAddress |
convert(Map<?,?> map)
|
HashMap<String,Object> |
convertBack(GlobalAddress address)
|
GlobalAddress |
getAddress()
always returns a non-null value referring directly to the embedded main Address instance, which provides a way to 'address' the implementing instance |
String |
getAddressKey(AddressKey key)
|
String |
getAddressKey(String addressKeyName)
|
Map<AddressKey,String> |
getAddressMap()
returns an unmodifiable view of the embedded map |
Set<AddressKey> |
getMissingKeys()
|
protected void |
propertiesToAddress()
transfers the properties to the embedded address and also clears the properties, so that the data is not in there twice (to be called after initialization, before the address can be used). |
void |
propertiesToAddress(Map<String,Object> props,
GlobalAddress address)
this transformation is strictly based solely on Strings (not PhoneNumber, URL, or the alike) |
void |
removeAddressKey(AddressKey key)
|
void |
removeAddressKey(String key)
|
void |
setAddressKey(AddressKey key,
String columnName)
|
void |
setAddressKey(Object key,
String columnName)
|
void |
setAddressKey(String key,
String columnName)
|
void |
setAddressKeyMap(Hashtable<AddressKey,String> map)
sets the embedded map with this instance, i.e. subsequent changes, like setAddressKey(AddressKey, String), will be reflected in the given map. |
void |
setAddressKeyMap(MappingInfo mi)
|
void |
setAddressKeys(Map<AddressKey,String> template)
|
void |
verifyProperties()
This default implementation simply runs all existing properties through checkPropertyChange(String, Object). |
| Methods inherited from class com.antelmann.db.AbstractDBEntry |
|---|
equals, getID, hashCode, hashEntry, sameEntry, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.antelmann.db.DBEntry |
|---|
getID |
| Constructor Detail |
|---|
public PropertyEntryWithAddress()
public PropertyEntryWithAddress(Object id)
public PropertyEntryWithAddress(Object id,
PropertyEntry pe)
public PropertyEntryWithAddress(Object id,
Map<String,?> map)
public PropertyEntryWithAddress(InputStream in)
throws IOException
IOExceptionPropertyEntryWithAddress(Map)public PropertyEntryWithAddress(Map<?,?> keyMap)
keyMap - maps all keys to their column namesAddressKey| Method Detail |
|---|
public void verifyProperties()
throws IllegalArgumentException
PropertyEntryImplcheckPropertyChange(String, Object).
If any implementation requires to check for more (e.g. for missing properties),
this method is to be overridden to provide this functionality.
Within the implementation of PropertyEntryImpl, this method is never called.
verifyProperties in class PropertyEntryImplIllegalArgumentException
protected void checkPropertyChange(String key,
Object value)
PropertyEntryImpl
checkPropertyChange in class PropertyEntryImplPropertyEntryImpl.setProperty(String, Object),
PropertyEntryImpl.removeProperty(String)public Map<AddressKey,String> getAddressMap()
public String getAddressKey(String addressKeyName)
public String getAddressKey(AddressKey key)
public void removeAddressKey(String key)
public void removeAddressKey(AddressKey key)
public void setAddressKey(Object key,
String columnName)
throws IllegalArgumentException
IllegalArgumentException
public void setAddressKey(String key,
String columnName)
throws IllegalArgumentException
IllegalArgumentException
public void setAddressKey(AddressKey key,
String columnName)
public void clearAddressKeys()
public void setAddressKeys(Map<AddressKey,String> template)
public void setAddressKeyMap(Hashtable<AddressKey,String> map)
setAddressKey(AddressKey, String), will be reflected in the given map.
public void setAddressKeyMap(MappingInfo mi)
public Set<AddressKey> getMissingKeys()
public GlobalAddress convert(Map<?,?> map)
throws IllegalArgumentException
convert in interface Converter<Map<?,?>,GlobalAddress>IllegalArgumentException
public HashMap<String,Object> convertBack(GlobalAddress address)
throws IllegalArgumentException
convertBack in interface Converter<Map<?,?>,GlobalAddress>IllegalArgumentException
public void addressToProperties(GlobalAddress address,
PropertyEntry entry)
public void addressToProperties(GlobalAddress address,
Map<String,Object> props)
public void addressToProperties(boolean useChangePropertyMethod)
useChangePropertyMethod - if true, the setProperty method is used; if false,
the properties are set directly via the put method on the protected member propspublic GlobalAddress getAddress()
Addressable
getAddress in interface Addressable
public void propertiesToAddress(Map<String,Object> props,
GlobalAddress address)
protected void propertiesToAddress()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||