|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.reflect.base.MappedClassResolver
public class MappedClassResolver
This is an implementation of the ClassResolver interface that uses an
internal Map to define specific mappings. If no mapping is found for
the requested type the default strategy
Class.forName(String) is used.
| Field Summary | |
|---|---|
private Map<String,Class<?>> |
name2classMap
|
| Fields inherited from interface net.sf.mmm.util.reflect.api.ClassResolver |
|---|
CLASS_FOR_NAME_RESOLVER |
| Constructor Summary | |
|---|---|
MappedClassResolver()
The constructor. |
|
MappedClassResolver(MapFactory<? extends Map> mapFactory)
The constructor. |
|
| Method Summary | |
|---|---|
void |
addClassMapping(Class<?> type)
This method adds a mapping for the given type using the
simple-name. |
void |
addClassMapping(String name,
Class<?> type)
This method adds a mapping for the given type using the given
name. |
Class<?> |
resolveClass(String name)
This method resolves the class with the given name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Map<String,Class<?>> name2classMap
resolveClass(String)| Constructor Detail |
|---|
public MappedClassResolver()
public MappedClassResolver(MapFactory<? extends Map> mapFactory)
mapFactory - the factory used to create the underlying Map.| Method Detail |
|---|
public void addClassMapping(Class<?> type)
type using the
simple-name.
type - is the type to add.
public void addClassMapping(String name,
Class<?> type)
type using the given
name.
name - is the name under which the class is
mapped.type - is the mapped class.public Class<?> resolveClass(String name)
name. In
addition to a ClassLoader this method may also find types via a
logical alias name.name can be the physical (fully qualified) classname (e.g.
org.foo.BlobImpl) but this may also be a logical name
depending on the implementation of this interface (e.g. Blob
may point to the same type).
resolveClass in interface ClassResolvername - is the logical or physical name of the requested type.
name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||