org.apache.commons.clazz
Class ModelClazzLoader

java.lang.Object
  extended by org.apache.commons.clazz.ClazzLoader
      extended by org.apache.commons.clazz.common.GroupClazzLoader
          extended by org.apache.commons.clazz.ModelClazzLoader

public class ModelClazzLoader
extends GroupClazzLoader

An implementation of ClazzLoader that functions as the top- level clazz loader for a model and caches all clazzes by name.

Version:
$Id: ModelClazzLoader.java 155436 2005-02-26 13:17:48Z dirkv $
Author:
Dmitri Plotnikov

Field Summary
 
Fields inherited from class org.apache.commons.clazz.common.GroupClazzLoader
loaders
 
Constructor Summary
ModelClazzLoader(String model)
           
 
Method Summary
 Clazz defineClazz(String name, Class clazzType, Class instanceClass)
          Defines a new Clazz with the supplied name.
 Clazz getClazzForName(String name)
          Given a Clazz name, produces the corresponding Clazz by invoking member loaders one by one until the clazz is found.
 String getModel()
          Returns the name of the model this clazz loader belongs to.
 
Methods inherited from class org.apache.commons.clazz.common.GroupClazzLoader
addClazzLoader, canAddClazzLoader, getClazzLoaders, getClazzName, isMember
 
Methods inherited from class org.apache.commons.clazz.ClazzLoader
enableLogging, getClazz, getModelClazzLoader, isLoggingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelClazzLoader

public ModelClazzLoader(String model)
Method Detail

getModel

public String getModel()
Description copied from class: ClazzLoader
Returns the name of the model this clazz loader belongs to.

Overrides:
getModel in class ClazzLoader

getClazzForName

public Clazz getClazzForName(String name)
Description copied from class: GroupClazzLoader
Given a Clazz name, produces the corresponding Clazz by invoking member loaders one by one until the clazz is found.

Overrides:
getClazzForName in class GroupClazzLoader
See Also:
ClazzLoader.getClazzForName(String)

defineClazz

public Clazz defineClazz(String name,
                         Class clazzType,
                         Class instanceClass)
Description copied from class: ClazzLoader
Defines a new Clazz with the supplied name. If it cannot define a clazz of the supplied type or if it cannot define clazzes at all, returns null.

Overrides:
defineClazz in class GroupClazzLoader
Parameters:
name - the name of the clazz, should be unique within the scope of the top-level ClazzLoader
clazzType - the Class of the Clazz that this method needs to produce.
instanceClass - the Class of the instances the new Clazz will be able to create using the newInstance() method.
Returns:
Clazz
See Also:
ClazzLoader.defineClazz(String, Class, Class)


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.