| java.lang.Object org.codehaus.dna.tools.verifier.ComponentVerifier
ComponentVerifier | public class ComponentVerifier (Code) | | Utility class to help verify that component respects the
rules of an DNA component.
author: Peter Donald version: $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $ |
Method Summary | |
protected Method | getComposeMethod(Class type) Return the method via which component is passed services. | protected Attribute | getConfigurationMetaData(Class type) Return the configuration metadata for component if any. | protected Method | getConfigurationMethod(Class type) Return the method used to pass configuration to component. | protected Attribute[] | getDependencyAttributes(Class type) Return the dependency attributes for component. | String | getMessage(String key) Get message out of resource bundle with specified key. | String | getMessage(String key, Object[] args) Get message out of resource bungle with specified key
and format wit specified arguments. | Class[] | getServiceClasses(Class type, List issues) Retrieve an array of Classes for all the services that a Component
offers. | void | verifyClass(Class type, List issues) Verify that the supplied class is a valid type for
a component. | void | verifyConfigurationMetaData(Class type, List issues) Verify that the configuration metadata for component is valid. | void | verifyDependencyKeyConforms(String typeName, String key, List issues) | void | verifyDependencyMetaData(Class type, List issues) Verify that the dependency metadata for component is valid. | void | verifyDependencyMetaData(Class type, Attribute attribute, List issues) Verify that the dependency metadata tag is valid. | void | verifyDependencyOptionalValid(String optional, List issues) Verify that value of optional value is valid. | void | verifyDependencyType(Class type, String typeName, List issues) Verify that the type specified dependency can be loaded. | void | verifyImplementsServices(Class implementation, Class[] services, List issues) Verify that the supplied implementation implements the specified
services. | void | verifyLocation(Class type, String location, List issues) Verify that the location specified for the schema actually exists. | void | verifyMetaData(Class type, List issues) Verify that the component is annotated with the
dna.component metadata. | void | verifyNoArgConstructor(Class clazz, List issues) Verify that the component has a no-arg aka default
constructor. | void | verifyNonAbstract(Class clazz, List issues) Verify that the component is not represented by
abstract class. | void | verifyNonArray(Class clazz, List issues) Verify that the component is not represented by
an array class. | void | verifyNonInterface(Class clazz, List issues) Verify that the component is not represented by
interface class. | void | verifyNonPrimitive(Class clazz, List issues) Verify that the component is not represented by
primitive class. | void | verifyOptionalParameter(String optional, List issues) Verify optional parameter for dependency metadata. | void | verifyPublic(Class clazz, List issues) Verify that the component is not represented by
abstract class. | void | verifyService(Class clazz, List issues) Verify that the supplied class is a valid class for
a service. | void | verifyServiceIsPublic(Class clazz, List issues) Verify that the service implemented by
specified component is public. | void | verifyServiceIsaInterface(Class clazz, List issues) Verify that the service implemented by
specified component is an interface. | void | verifyServiceNotALifecycle(Class clazz, List issues) Verify that the service implemented by
specified component does not extend any lifecycle interfaces. | public VerifyIssue[] | verifyType(Class type) Verfiy that specified components designate classes that implement the
advertised interfaces. |
getComposeMethod | protected Method getComposeMethod(Class type) throws NoSuchMethodException(Code) | | Return the method via which component is passed services.
This method is protected so can overload in subclasses
and get alternative methods.
Parameters: type - the components type the method throws: NoSuchMethodException - if can not locate method |
getConfigurationMetaData | protected Attribute getConfigurationMetaData(Class type)(Code) | | Return the configuration metadata for component if any.
Protected to allow overiding in subclasses.
Parameters: type - the component type the metadata if any |
getDependencyAttributes | protected Attribute[] getDependencyAttributes(Class type)(Code) | | Return the dependency attributes for component.
Made protected so that it is possible to overload
in subclasses.
Parameters: type - the component type the dependency attributes |
getMessage | String getMessage(String key)(Code) | | Get message out of resource bundle with specified key.
Parameters: key - the key the message |
getMessage | String getMessage(String key, Object[] args)(Code) | | Get message out of resource bungle with specified key
and format wit specified arguments.
Parameters: key - the keys Parameters: args - the arguments the message |
getServiceClasses | Class[] getServiceClasses(Class type, List issues)(Code) | | Retrieve an array of Classes for all the services that a Component
offers. This method also makes sure all services offered are
interfaces.
Parameters: type - the component type Parameters: issues - the list of issues an array of Classes for all the services |
verifyClass | void verifyClass(Class type, List issues)(Code) | | Verify that the supplied class is a valid type for
a component.
Parameters: type - the class representing component Parameters: issues - the list of issues |
verifyConfigurationMetaData | void verifyConfigurationMetaData(Class type, List issues)(Code) | | Verify that the configuration metadata for component is valid.
Parameters: type - the type Parameters: issues - the list of issues |
verifyDependencyKeyConforms | void verifyDependencyKeyConforms(String typeName, String key, List issues)(Code) | | Verify that the key conforms to the expectation
of being (type)[/(qualifier)]
Parameters: typeName - the name of dependency type Parameters: key - the dependency key Parameters: issues - the list of issues |
verifyDependencyMetaData | void verifyDependencyMetaData(Class type, List issues)(Code) | | Verify that the dependency metadata for component is valid.
Parameters: type - the type Parameters: issues - the list of issues |
verifyDependencyMetaData | void verifyDependencyMetaData(Class type, Attribute attribute, List issues)(Code) | | Verify that the dependency metadata tag is valid.
Parameters: type - the component type Parameters: attribute - the metadata tag Parameters: issues - the list of issues |
verifyDependencyOptionalValid | void verifyDependencyOptionalValid(String optional, List issues)(Code) | | Verify that value of optional value is valid.
Parameters: optional - the optional value Parameters: issues - the list of issues |
verifyDependencyType | void verifyDependencyType(Class type, String typeName, List issues)(Code) | | Verify that the type specified dependency can be loaded.
Parameters: type - the component type Parameters: typeName - the type of dependency Parameters: issues - the list of issues |
verifyImplementsServices | void verifyImplementsServices(Class implementation, Class[] services, List issues)(Code) | | Verify that the supplied implementation implements the specified
services.
Parameters: implementation - the class representign component Parameters: services - the services that the implementation must provide Parameters: issues - the list of issues |
verifyLocation | void verifyLocation(Class type, String location, List issues)(Code) | | Verify that the location specified for the schema actually exists.
Parameters: type - the component type Parameters: location - the location of schmea Parameters: issues - the list of issues |
verifyMetaData | void verifyMetaData(Class type, List issues)(Code) | | Verify that the component is annotated with the
dna.component metadata.
Parameters: type - the type Parameters: issues - the list of issues |
verifyNoArgConstructor | void verifyNoArgConstructor(Class clazz, List issues)(Code) | | Verify that the component has a no-arg aka default
constructor.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyNonAbstract | void verifyNonAbstract(Class clazz, List issues)(Code) | | Verify that the component is not represented by
abstract class.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyNonArray | void verifyNonArray(Class clazz, List issues)(Code) | | Verify that the component is not represented by
an array class.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyNonInterface | void verifyNonInterface(Class clazz, List issues)(Code) | | Verify that the component is not represented by
interface class.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyNonPrimitive | void verifyNonPrimitive(Class clazz, List issues)(Code) | | Verify that the component is not represented by
primitive class.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyOptionalParameter | void verifyOptionalParameter(String optional, List issues)(Code) | | Verify optional parameter for dependency metadata.
Parameters: optional - the value of parameter Parameters: issues - the list of issues |
verifyPublic | void verifyPublic(Class clazz, List issues)(Code) | | Verify that the component is not represented by
abstract class.
Parameters: clazz - the class representign component Parameters: issues - the list of issues |
verifyService | void verifyService(Class clazz, List issues)(Code) | | Verify that the supplied class is a valid class for
a service.
Parameters: clazz - the class representign service Parameters: issues - the list of issues |
verifyServiceIsPublic | void verifyServiceIsPublic(Class clazz, List issues)(Code) | | Verify that the service implemented by
specified component is public.
Parameters: clazz - the class representign service Parameters: issues - the list of issues |
verifyServiceIsaInterface | void verifyServiceIsaInterface(Class clazz, List issues)(Code) | | Verify that the service implemented by
specified component is an interface.
Parameters: clazz - the class representign service Parameters: issues - the list of issues |
verifyServiceNotALifecycle | void verifyServiceNotALifecycle(Class clazz, List issues)(Code) | | Verify that the service implemented by
specified component does not extend any lifecycle interfaces.
Parameters: clazz - the class representign service Parameters: issues - the list of issues |
verifyType | public VerifyIssue[] verifyType(Class type)(Code) | | Verfiy that specified components designate classes that implement the
advertised interfaces.
Parameters: type - the component type an array of issues |
|
|