net.sourceforge.jparam.conversion.creators
Class AbstractCreator

java.lang.Object
  |
  +--net.sourceforge.jparam.conversion.creators.AbstractCreator
All Implemented Interfaces:
ICreator
Direct Known Subclasses:
ConstructorCreator, MethodCreator

public abstract class AbstractCreator
extends java.lang.Object
implements ICreator


Field Summary
(package private)  java.lang.Class[] parameterTypes
           
(package private)  java.lang.Class returnType
           
 
Constructor Summary
AbstractCreator()
           
 
Method Summary
 boolean canCreate(java.lang.Object[] parameters)
           
 java.lang.Object create(java.lang.Object[] parameters)
          Returns an object of type getReturnClass using the given parameters as input
protected abstract  boolean creatorEquals(ICreator o)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Class[] getParameterTypes()
          Returns the type of parameters that this creator expects to recieve
 java.lang.Class getReturnClass()
          Return the Class of the expected object that this creator can create
protected abstract  java.lang.Object internalCreate(java.lang.Object[] parameters)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jparam.conversion.creators.ICreator
canBeNull
 

Field Detail

returnType

java.lang.Class returnType

parameterTypes

java.lang.Class[] parameterTypes
Constructor Detail

AbstractCreator

public AbstractCreator()
Method Detail

getReturnClass

public java.lang.Class getReturnClass()
Description copied from interface: ICreator
Return the Class of the expected object that this creator can create
Specified by:
getReturnClass in interface ICreator
Following copied from interface: net.sourceforge.jparam.conversion.creators.ICreator
Returns:
A Class the created object will be instanceof

getParameterTypes

public java.lang.Class[] getParameterTypes()
Description copied from interface: ICreator
Returns the type of parameters that this creator expects to recieve

If the parameters given to the create method do not conform to these an exception will be thrown

Specified by:
getParameterTypes in interface ICreator
Following copied from interface: net.sourceforge.jparam.conversion.creators.ICreator
Returns:
A Class[] representing the expected parameter types

create

public java.lang.Object create(java.lang.Object[] parameters)
                        throws JParamException
Description copied from interface: ICreator
Returns an object of type getReturnClass using the given parameters as input
Specified by:
create in interface ICreator
Following copied from interface: net.sourceforge.jparam.conversion.creators.ICreator
Parameters:
parameters - An array of object whose types should conform with getParameterTypes
Returns:
Object created with the parameters
Throws:
JParamException - if there was an error during construction of the object, or if the parameters do not conform to the requierment

internalCreate

protected abstract java.lang.Object internalCreate(java.lang.Object[] parameters)
                                            throws java.lang.Exception

creatorEquals

protected abstract boolean creatorEquals(ICreator o)

canCreate

public boolean canCreate(java.lang.Object[] parameters)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2004 SourceForge. All Rights Reserved.