public class Validator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Validator.MethodResult |
| Modifier and Type | Field and Description |
|---|---|
private ComponentContainer |
container |
private IssueLog |
iLog |
private Options |
options |
private Project |
project |
private static java.lang.String |
TYPE_BUNDLE_CONTEXT |
private static java.lang.String |
TYPE_COMPONENT_CONTEXT |
private static java.lang.String |
TYPE_INT |
private static java.lang.String |
TYPE_INTEGER |
private static java.lang.String |
TYPE_MAP |
private static java.lang.String |
TYPE_SERVICE_REFERENCE |
| Constructor and Description |
|---|
Validator(ComponentContainer container,
Project project,
Options options,
IssueLog iLog) |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkLifecycleMethod(java.lang.String methodName,
boolean isActivate,
boolean isSpecified)
Check for existence of lifecycle methods.
|
static Validator.MethodResult |
findLifecycleMethod(Project project,
ComponentContainer container,
java.lang.String methodName,
boolean isActivate)
Find a lifecycle methods.
|
static Validator.MethodResult |
findMethod(Project project,
Options options,
ClassDescription cd,
ReferenceDescription ref,
java.lang.String methodName)
Find the method and the required spec version
|
private static java.lang.reflect.Method |
getMethod(ClassDescription cd,
java.lang.String name,
java.lang.Class<?>[] sig) |
private static java.lang.reflect.Method |
getMethod(Project project,
ComponentContainer container,
java.lang.String name,
java.lang.String[] sig) |
private void |
logError(AbstractDescription desc,
java.lang.String message) |
private void |
logWarn(AbstractDescription desc,
java.lang.String message) |
void |
validate()
Validate the component description.
|
private java.lang.String |
validateMethod(ReferenceDescription ref,
java.lang.String methodName,
boolean componentIsAbstract) |
private void |
validateProperty(PropertyDescription property)
Validate the property.
|
private void |
validateReference(ReferenceDescription ref,
boolean componentIsAbstract)
Validate the reference.
|
private void |
validateService(ServiceDescription service)
Validate the service and its interfaces
If errors occur a message is added to the issues list,
warnings can be added to the warnings list.
|
private final ComponentContainer container
private final Options options
private final Project project
private final IssueLog iLog
private static final java.lang.String TYPE_COMPONENT_CONTEXT
private static final java.lang.String TYPE_BUNDLE_CONTEXT
private static final java.lang.String TYPE_MAP
private static final java.lang.String TYPE_INT
private static final java.lang.String TYPE_INTEGER
private static final java.lang.String TYPE_SERVICE_REFERENCE
public Validator(ComponentContainer container, Project project, Options options, IssueLog iLog)
private void logWarn(AbstractDescription desc, java.lang.String message)
private void logError(AbstractDescription desc, java.lang.String message)
public void validate()
throws SCRDescriptorException
SCRDescriptorExceptionprivate static java.lang.reflect.Method getMethod(Project project, ComponentContainer container, java.lang.String name, java.lang.String[] sig) throws SCRDescriptorException
SCRDescriptorExceptionpublic static Validator.MethodResult findLifecycleMethod(Project project, ComponentContainer container, java.lang.String methodName, boolean isActivate) throws SCRDescriptorException
methodName - The method name.isActivate - Whether this is the activate or deactivate method.SCRDescriptorExceptionprivate void checkLifecycleMethod(java.lang.String methodName,
boolean isActivate,
boolean isSpecified)
throws SCRDescriptorException
methodName - The method name.isActivate - Whether this is the activate or deactivate method.isSpecified - Whether this method has explicitely been specified or is just
the defaultSCRDescriptorExceptionprivate void validateService(ServiceDescription service) throws SCRDescriptorException
SCRDescriptorExceptionprivate void validateProperty(PropertyDescription property)
private void validateReference(ReferenceDescription ref, boolean componentIsAbstract) throws SCRDescriptorException
SCRDescriptorExceptionprivate java.lang.String validateMethod(ReferenceDescription ref, java.lang.String methodName, boolean componentIsAbstract) throws SCRDescriptorException
SCRDescriptorExceptionprivate static java.lang.reflect.Method getMethod(ClassDescription cd, java.lang.String name, java.lang.Class<?>[] sig)
public static Validator.MethodResult findMethod(Project project, Options options, ClassDescription cd, ReferenceDescription ref, java.lang.String methodName) throws SCRDescriptorException
SCRDescriptorException - If the class can't be found