JMMF API
pre-release v0.7

fr.umlv.jmmf.reflect
Class MultiFactory

java.lang.Object
  |
  +--fr.umlv.jmmf.reflect.MultiFactory

public class MultiFactory
extends java.lang.Object

Factory class for multi-method implementation.

Version:
0.7.1
Author:
Remi Forax

Constructor Summary
MultiFactory(MultiModel model)
          Construct a multi-method factory with a multi-method model.
MultiFactory(MultiModel model, fr.umlv.jmmf.reflect.impls.MMImplFactory implFactory)
          Construct a multi-method factory with a multi-method model.
 
Method Summary
 MultiConstructor create(java.lang.Class clazz, int length)
          construct a multi-constructor by taking all constructors with argLength parameter(s) in class clazz.
 MultiMethod create(java.lang.Class clazz, java.lang.String name, int length)
          construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
static MultiFactory getDefaultFactory()
          return the default factory instance.
 fr.umlv.jmmf.reflect.impls.MMImplFactory getImplFactory()
          return the multi-method implementation factory.
 MultiModel getModel()
          return the model of all multi-methods created with this factory.
 MultiMethod[] getMultiMethods(java.lang.Class clazz)
          return all the multi-methods contains in the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiFactory

public MultiFactory(MultiModel model)
Construct a multi-method factory with a multi-method model. All multi-method created with this factory have the same multi-method model. The construction scheme use the property "fr.umlv.jmmf.implFactory" to determine the implementation factory.
Parameters:
model - model of all multi-method created with this factory.

MultiFactory

public MultiFactory(MultiModel model,
                    fr.umlv.jmmf.reflect.impls.MMImplFactory implFactory)
Construct a multi-method factory with a multi-method model. All multi-method created with this factory have the same multi-method model.
Parameters:
model - model of all multi-method created with this factory.
Method Detail

getModel

public MultiModel getModel()
return the model of all multi-methods created with this factory.

getImplFactory

public fr.umlv.jmmf.reflect.impls.MMImplFactory getImplFactory()
return the multi-method implementation factory.

create

public MultiMethod create(java.lang.Class clazz,
                          java.lang.String name,
                          int length)
construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
Parameters:
clazz - class which owns the named methods.
name - name of the methods.
argLenth - number of parameters.
Throws:
java.lang.IllegalArgumentException - if the class clazz contains no method named name or all methods found don't have the same number of parameters.

create

public MultiConstructor create(java.lang.Class clazz,
                               int length)
construct a multi-constructor by taking all constructors with argLength parameter(s) in class clazz.
Parameters:
clazz - class which owns the named methods.
argLenth - number of parameters.
Throws:
java.lang.IllegalArgumentException - if the class clazz contains no constructor with argLength parameters.

getMultiMethods

public MultiMethod[] getMultiMethods(java.lang.Class clazz)
return all the multi-methods contains in the class.
Parameters:
clazz - hosted class of all multi-methods.
See Also:
MultiMethod

getDefaultFactory

public static MultiFactory getDefaultFactory()
return the default factory instance.

JMMF API
pre-release v0.7

Rémi Forax 1999,2000 Université de Marne la Vallée