org.apache.avalon.meta.info.verifier
Class TypeVerifier

java.lang.Object
  extended byorg.apache.avalon.meta.info.verifier.TypeVerifier

public class TypeVerifier
extends Object

Utility class to help verify that component respects the rules of an Avalon component.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/09/24 08:15:46 $
Author:
Avalon Development Team

Constructor Summary
TypeVerifier()
           
 
Method Summary
 void verifyClass(String name, Class clazz)
          Verify that the supplied class is a valid class for a Component.
 void verifyImplementsServices(String name, Class implementation, Class[] services)
          Verify that the supplied implementation implements the specified services.
 void verifyLifecycles(String name, Class implementation)
          Verify that the implementation class does not implement incompatible lifecycle interfaces.
 void verifyNoArgConstructor(String name, Class clazz)
          Verify that the component has a no-arg aka default constructor.
 void verifyNonAbstract(String name, Class clazz)
          Verify that the component is not represented by abstract class.
 void verifyNonArray(String name, Class clazz)
          Verify that the component is not represented by an array class.
 void verifyNonInterface(String name, Class clazz)
          Verify that the component is not represented by interface class.
 void verifyNonPrimitive(String name, Class clazz)
          Verify that the component is not represented by primitive class.
 void verifyPublic(String name, Class clazz)
          Verify that the component is not represented by abstract class.
 void verifyService(String name, Class clazz)
          Verify that the supplied class is a valid class for a service.
 void verifyServiceIsaInterface(String name, Class clazz)
          Verify that the service implemented by specified component is an interface.
 void verifyServiceIsPublic(String name, Class clazz)
          Verify that the service implemented by specified component is public.
 void verifyServiceNotALifecycle(String name, Class clazz)
          Verify that the service implemented by specified component does not extend any lifecycle interfaces.
 void verifyServices(String name, Class[] classes)
          Verify that the supplied classes are valid classes for a service.
 void verifyType(String name, Class implementation, Class[] services)
          Verify that the supplied implementation class and service classes are valid for a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeVerifier

public TypeVerifier()
Method Detail

verifyType

public void verifyType(String name,
                       Class implementation,
                       Class[] services)
                throws VerifyException
Verify that the supplied implementation class and service classes are valid for a component.

Parameters:
name - the name of component
implementation - the implementation class of component
services - the classes representing services
Throws:
VerifyException - if error thrown on failure and component fails check

verifyImplementsServices

public void verifyImplementsServices(String name,
                                     Class implementation,
                                     Class[] services)
                              throws VerifyException
Verify that the supplied implementation implements the specified services.

Parameters:
name - the name of component
implementation - the class representign component
services - the services that the implementation must provide
Throws:
VerifyException - if error thrown on failure and component fails check

verifyClass

public void verifyClass(String name,
                        Class clazz)
                 throws VerifyException
Verify that the supplied class is a valid class for a Component.

Parameters:
name - the name of component
clazz - the class representing component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyServices

public void verifyServices(String name,
                           Class[] classes)
                    throws VerifyException
Verify that the supplied classes are valid classes for a service.

Parameters:
name - the name of component
classes - the classes representign services
Throws:
VerifyException - if error thrown on failure and component fails check

verifyService

public void verifyService(String name,
                          Class clazz)
                   throws VerifyException
Verify that the supplied class is a valid class for a service.

Parameters:
name - the name of component
clazz - the class representign service
Throws:
VerifyException - if error thrown on failure and component fails check

verifyLifecycles

public void verifyLifecycles(String name,
                             Class implementation)
                      throws VerifyException
Verify that the implementation class does not implement incompatible lifecycle interfaces.

Parameters:
name - the name of component
implementation - the implementation class
Throws:
VerifyException - if error thrown on failure and component fails check

verifyServiceIsaInterface

public void verifyServiceIsaInterface(String name,
                                      Class clazz)
                               throws VerifyException
Verify that the service implemented by specified component is an interface.

Parameters:
name - the name of component
clazz - the class representign service
Throws:
VerifyException - if error thrown on failure and component fails check

verifyServiceIsPublic

public void verifyServiceIsPublic(String name,
                                  Class clazz)
                           throws VerifyException
Verify that the service implemented by specified component is public.

Parameters:
name - the name of component
clazz - the class representign service
Throws:
VerifyException - if error thrown on failure and component fails check

verifyServiceNotALifecycle

public void verifyServiceNotALifecycle(String name,
                                       Class clazz)
                                throws VerifyException
Verify that the service implemented by specified component does not extend any lifecycle interfaces.

Parameters:
name - the name of component
clazz - the class representign service
Throws:
VerifyException - if error thrown on failure and component fails check

verifyNoArgConstructor

public void verifyNoArgConstructor(String name,
                                   Class clazz)
                            throws VerifyException
Verify that the component has a no-arg aka default constructor.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyNonAbstract

public void verifyNonAbstract(String name,
                              Class clazz)
                       throws VerifyException
Verify that the component is not represented by abstract class.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyPublic

public void verifyPublic(String name,
                         Class clazz)
                  throws VerifyException
Verify that the component is not represented by abstract class.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyNonPrimitive

public void verifyNonPrimitive(String name,
                               Class clazz)
                        throws VerifyException
Verify that the component is not represented by primitive class.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyNonInterface

public void verifyNonInterface(String name,
                               Class clazz)
                        throws VerifyException
Verify that the component is not represented by interface class.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check

verifyNonArray

public void verifyNonArray(String name,
                           Class clazz)
                    throws VerifyException
Verify that the component is not represented by an array class.

Parameters:
name - the name of component
clazz - the class representign component
Throws:
VerifyException - if error thrown on failure and component fails check


Copyright © Apache Software Foundation. All Rights Reserved.