Holger's
Java API

com.antelmann.db
Class EntryClassMapper.Adapter

java.lang.Object
  extended by com.antelmann.db.EntryClassMapper.Adapter
All Implemented Interfaces:
EntryClassMapper
Direct Known Subclasses:
SQLEntryClassMapper
Enclosing interface:
EntryClassMapper

public static class EntryClassMapper.Adapter
extends Object
implements EntryClassMapper

a default implementation (based on some other basic mapping like EntryClassMapper.STRING_MAPPER) which supports label customization per instance


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.db.EntryClassMapper
EntryClassMapper.Adapter
 
Field Summary
 
Fields inherited from interface com.antelmann.db.EntryClassMapper
DEFAULT_MAPPER, STRING_MAPPER
 
Constructor Summary
EntryClassMapper.Adapter()
          uses EntryClassMapper.STRING_MAPPER as the defaultMapper
EntryClassMapper.Adapter(EntryClassMapper defaultMapper)
           
 
Method Summary
 Object entryClassToObject(Class<? extends DBEntry> resourceClass)
          converts the given Class into an object that can easily be stored/exported elsewhere.
 String getLabelFor(Class<?> entryClass)
          allows to provide a user-friendly display name for a class independent of its mapping; the return value may not be mapped back to the given class.
static FormattedCellRenderer getRenderer(EntryClassMapper ecm)
           
 Class<? extends DBEntry> objectToEntryClass(Object referenceType)
          converts the given (maybe externally retrieved) Object into some DBEntry class to be used
 String setLabelFor(Class<?> entryClass, String label)
          allows to customize the label that is to be displayed for the given class
static Converter<Class<? extends DBEntry>,Object> toConverter(EntryClassMapper ecm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryClassMapper.Adapter

public EntryClassMapper.Adapter()
uses EntryClassMapper.STRING_MAPPER as the defaultMapper


EntryClassMapper.Adapter

public EntryClassMapper.Adapter(EntryClassMapper defaultMapper)
Method Detail

entryClassToObject

public Object entryClassToObject(Class<? extends DBEntry> resourceClass)
Description copied from interface: EntryClassMapper
converts the given Class into an object that can easily be stored/exported elsewhere. It is usually wise to have the return value be serializable.

Specified by:
entryClassToObject in interface EntryClassMapper
Parameters:
resourceClass - may be null (in which case null is usually expected as a return value)

objectToEntryClass

public Class<? extends DBEntry> objectToEntryClass(Object referenceType)
                                            throws ClassNotFoundException
Description copied from interface: EntryClassMapper
converts the given (maybe externally retrieved) Object into some DBEntry class to be used

Specified by:
objectToEntryClass in interface EntryClassMapper
Parameters:
referenceType - may be null (in which case null is usually expected as a return value)
Throws:
ClassNotFoundException

getLabelFor

public String getLabelFor(Class<?> entryClass)
Description copied from interface: EntryClassMapper
allows to provide a user-friendly display name for a class independent of its mapping; the return value may not be mapped back to the given class. The return value must never be null.

Specified by:
getLabelFor in interface EntryClassMapper

setLabelFor

public String setLabelFor(Class<?> entryClass,
                          String label)
Description copied from interface: EntryClassMapper
allows to customize the label that is to be displayed for the given class

Specified by:
setLabelFor in interface EntryClassMapper
Returns:
the label previously set (which may be null)

getRenderer

public static FormattedCellRenderer getRenderer(EntryClassMapper ecm)

toConverter

public static Converter<Class<? extends DBEntry>,Object> toConverter(EntryClassMapper ecm)


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads