net.sourceforge.jparam.conversion.creators
Interface ICreator

All Known Implementing Classes:
AbstractCreator

public interface ICreator

This interface represents a creator object, creator object can create a specific objects given a specific set of parameters

Author:
Ron_Sidi

Method Summary
 boolean canBeNull(int index)
          Tests if the given argument index can be null, if the argument type is a primitive one, it should be converted to its wrapper class, but it will not support null as a value
 java.lang.Object create(java.lang.Object[] parameters)
          Returns an object of type getReturnClass using the given parameters as input
 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
 

Method Detail

getReturnClass

public java.lang.Class getReturnClass()
Return the Class of the expected object that this creator can create
Returns:
A Class the created object will be instanceof

getParameterTypes

public java.lang.Class[] getParameterTypes()
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

Returns:
A Class[] representing the expected parameter types

create

public java.lang.Object create(java.lang.Object[] parameters)
                        throws JParamException
Returns an object of type getReturnClass using the given parameters as input
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

canBeNull

public boolean canBeNull(int index)
Tests if the given argument index can be null, if the argument type is a primitive one, it should be converted to its wrapper class, but it will not support null as a value
Parameters:
index - The index of the argument to be tested
Returns:
false if the argument represents a primitive type false otherwise


Copyright © 2004 SourceForge. All Rights Reserved.