org.apache.commons.clazz.bean
Class BeanClazz

java.lang.Object
  extended by org.apache.commons.clazz.common.ClazzElementSupport
      extended by org.apache.commons.clazz.Clazz
          extended by org.apache.commons.clazz.bean.BeanClazz
All Implemented Interfaces:
ClazzElement

public class BeanClazz
extends Clazz

Dynamically constructed Clazz. BeanClazzes are created by invoking clazzLoader.defineClazz (name, clazzClass, instanceClass).

Version:
$Id: BeanClazz.java 155436 2005-02-26 13:17:48Z dirkv $
Author:
Stephen Colebourne, Dmitri Plotnikov

Field Summary
 
Fields inherited from class org.apache.commons.clazz.Clazz
EXTENDED_CLAZZ_MODEL, STANDARD_CLAZZ_MODEL
 
Constructor Summary
BeanClazz(ClazzLoader loader, String name, Class instanceClass)
          Constructor for BeanClazz.
 
Method Summary
 void addDeclaredOperation(ClazzOperation operation)
           
 void addDeclaredProperty(ClazzProperty property)
           
 void addInstanceFactory(ClazzInstanceFactory factory)
           
protected  void addOperation(ClazzOperation operation)
          Called indirectly when declared operations are manipulated.
protected  void addProperty(ClazzProperty property)
          Called indirectly when declared properties are manipulated.
 List getDeclaredOperations()
          Returns all Operations declared by this clazz, not its superclazzes.
 List getDeclaredProperties()
          Returns properties declared by this Clazz, not its superclazzes
 Class getInstanceClass()
          Returns the class of instances created by the newInstance() method.
 List getInstanceFactories()
          Returns all InstanceFactories for this clazz.
 ClazzInstanceFactory getInstanceFactory(String signature)
          Returns ClazzInstanceFactory for the given signature.
 ClazzOperation getOperation(String signature)
          Returns the Operation for the given signature.
 List getOperations()
          Returns all Operations for this clazz.
 List getProperties()
          Returns all properties for this clazz, including those declared by superclazzes.
 ClazzProperty getProperty(String name)
          Returns a ClazzProperty for the given name
 Clazz getSuperclazz()
          Returns the superclazz for this Clazz, or null if there is none.
protected  void refreshAllCaches()
           
protected  void refreshOperationCache()
           
protected  void refreshPropertyCache()
           
 void removeDeclaredOperation(ClazzOperation operation)
           
 void removeDeclaredProperty(ClazzProperty property)
           
 void removeInstanceFactory(ClazzInstanceFactory factory)
           
protected  void removeOperation(ClazzOperation operation)
          Called indirectly when declared operations are manipulated.
protected  void removeProperty(ClazzProperty property)
          Called indirectly when declared properties are manipulated.
 void setSuperclazz(Clazz clazz)
           
 
Methods inherited from class org.apache.commons.clazz.Clazz
addClazzChangeListener, addClazzLoaderFactory, constructSignature, constructSignature, fireInstanceFactoryAdded, fireInstanceFactoryRemoved, fireOperationAdded, fireOperationRemoved, firePropertyAdded, firePropertyRemoved, getCanonicalClassName, getClazz, getClazz, getClazzLoader, getClazzLoader, getClazzLoaderFactory, getDefaultClazzLoader, getDefaultClazzModel, getName, getPackageName, getShortClassName, isAssignableFrom, newInstance, newInstance, removeClazzChangeListener, setDefaultClazzModel
 
Methods inherited from class org.apache.commons.clazz.common.ClazzElementSupport
getAttribute, getAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.clazz.ClazzElement
getAttribute, getAttributes
 

Constructor Detail

BeanClazz

public BeanClazz(ClazzLoader loader,
                 String name,
                 Class instanceClass)
Constructor for BeanClazz.

Parameters:
loader -
name -
instanceClass -
Method Detail

getInstanceClass

public Class getInstanceClass()
Description copied from class: Clazz
Returns the class of instances created by the newInstance() method.

Specified by:
getInstanceClass in class Clazz

getSuperclazz

public Clazz getSuperclazz()
Description copied from class: Clazz
Returns the superclazz for this Clazz, or null if there is none.

Specified by:
getSuperclazz in class Clazz
See Also:
Clazz.getSuperclazz()

setSuperclazz

public void setSuperclazz(Clazz clazz)

refreshAllCaches

protected void refreshAllCaches()

refreshPropertyCache

protected void refreshPropertyCache()

refreshOperationCache

protected void refreshOperationCache()

getDeclaredProperties

public List getDeclaredProperties()
Description copied from class: Clazz
Returns properties declared by this Clazz, not its superclazzes

Specified by:
getDeclaredProperties in class Clazz
See Also:
Clazz.getDeclaredProperties()

addDeclaredProperty

public void addDeclaredProperty(ClazzProperty property)

addProperty

protected void addProperty(ClazzProperty property)
Called indirectly when declared properties are manipulated.


removeDeclaredProperty

public void removeDeclaredProperty(ClazzProperty property)

removeProperty

protected void removeProperty(ClazzProperty property)
Called indirectly when declared properties are manipulated.


getProperties

public List getProperties()
Description copied from class: Clazz
Returns all properties for this clazz, including those declared by superclazzes.

Specified by:
getProperties in class Clazz
See Also:
Clazz.getProperties()

getProperty

public ClazzProperty getProperty(String name)
Description copied from class: Clazz
Returns a ClazzProperty for the given name

Specified by:
getProperty in class Clazz
See Also:
Clazz.getProperty(java.lang.String)

getDeclaredOperations

public List getDeclaredOperations()
Description copied from class: Clazz
Returns all Operations declared by this clazz, not its superclazzes.

Specified by:
getDeclaredOperations in class Clazz
See Also:
Clazz.getDeclaredOperations()

addDeclaredOperation

public void addDeclaredOperation(ClazzOperation operation)

addOperation

protected void addOperation(ClazzOperation operation)
Called indirectly when declared operations are manipulated.


removeDeclaredOperation

public void removeDeclaredOperation(ClazzOperation operation)

removeOperation

protected void removeOperation(ClazzOperation operation)
Called indirectly when declared operations are manipulated.


getOperations

public List getOperations()
Description copied from class: Clazz
Returns all Operations for this clazz.

Specified by:
getOperations in class Clazz
See Also:
Clazz.getOperations()

getOperation

public ClazzOperation getOperation(String signature)
Description copied from class: Clazz
Returns the Operation for the given signature. The signature should be formatted as follows: "name(paramClazzName1,...)"

Specified by:
getOperation in class Clazz
See Also:
Clazz.getOperation(java.lang.String)

getInstanceFactories

public List getInstanceFactories()
Description copied from class: Clazz
Returns all InstanceFactories for this clazz.

Specified by:
getInstanceFactories in class Clazz
See Also:
Clazz.getInstanceFactories()

getInstanceFactory

public ClazzInstanceFactory getInstanceFactory(String signature)
Description copied from class: Clazz
Returns ClazzInstanceFactory for the given signature. The signature should be formatted as follows: "(paramClazzName1,...)". You can pass null in place of "()".

Specified by:
getInstanceFactory in class Clazz
See Also:
Clazz.getInstanceFactory(java.lang.String)

addInstanceFactory

public void addInstanceFactory(ClazzInstanceFactory factory)

removeInstanceFactory

public void removeInstanceFactory(ClazzInstanceFactory factory)


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