in ti/phase2/jars/core/src/java/org/apache/ti/compiler/internal/FlowControllerChecker.java [303:399]
private void checkInheritedRelativePaths(ClassDeclaration jclass)
throws FatalCompileTimeException {
for (ClassType type = jclass.getSuperclass();
(type != null) && CompilerUtils.isAssignableFrom(FLOWCONTROLLER_BASE_CLASS, type, getEnv());
type = type.getSuperclass()) {
TypeDeclaration decl = CompilerUtils.getDeclaration(type);
//
// Check simple actions in the Controller annotation.
//
List simpleActions = CompilerUtils.getAnnotationArrayValue(decl, CONTROLLER_TAG_NAME, SIMPLE_ACTIONS_ATTR, true);
if (simpleActions != null) {
for (Iterator j = simpleActions.iterator(); j.hasNext();) {
AnnotationInstance i = (AnnotationInstance) j.next();
checkRelativePath(i, PATH_ATTR, jclass, decl, false);
List conditionalForwards = CompilerUtils.getAnnotationArray(i, CONDITIONAL_FORWARDS_ATTR, true);
if (conditionalForwards != null) {
for (Iterator k = conditionalForwards.iterator(); k.hasNext();) {
AnnotationInstance ann = (AnnotationInstance) k.next();
checkRelativePath(ann, PATH_ATTR, jclass, decl, false);
}
}
}
}
//
// Check Forwards in the Controller annotation.
//
List forwards = CompilerUtils.getAnnotationArrayValue(decl, CONTROLLER_TAG_NAME, FORWARDS_ATTR, true);
if (forwards != null) {
for (Iterator ii = forwards.iterator(); ii.hasNext();) {
AnnotationInstance i = (AnnotationInstance) ii.next();
checkRelativePath(i, PATH_ATTR, jclass, decl, false);
}
}
//
// Check Catches in the Controller annotation.
//
List catches = CompilerUtils.getAnnotationArrayValue(decl, CONTROLLER_TAG_NAME, CATCHES_ATTR, true);
if (catches != null) {
for (Iterator j = catches.iterator(); j.hasNext();) {
AnnotationInstance i = (AnnotationInstance) j.next();
checkRelativePath(i, PATH_ATTR, jclass, decl, false);
}
}
//
// Check strutsMerge and validatorMerge in the Controller annotation.
//
AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation(decl, CONTROLLER_TAG_NAME);
if (controllerAnnotation != null) {
checkRelativePath(controllerAnnotation, VALIDATOR_MERGE_ATTR, jclass, decl, true);
}
//
// Check Forwards and Catches on action methods and exception-handler methods.
//
MethodDeclaration[] methods = decl.getMethods();
for (int i = 0; i < methods.length; i++) {
MethodDeclaration method = methods[i];
AnnotationInstance ann = CompilerUtils.getActionAnnotation(method, jclass, getEnv());
if (ann == null) {
ann = CompilerUtils.getAnnotation(method, EXCEPTION_HANDLER_TAG_NAME);
}
if (ann != null) {
List methodForwards = CompilerUtils.getAnnotationArray(ann, FORWARDS_ATTR, true);
String methodName = method.getSimpleName();
if (methodForwards != null) {
for (Iterator j = methodForwards.iterator(); j.hasNext();) {
AnnotationInstance methodForward = (AnnotationInstance) j.next();
checkRelativePath(methodName, methodForward, PATH_ATTR, jclass, decl, false);
}
}
List methodCatches = CompilerUtils.getAnnotationArray(ann, CATCHES_ATTR, true);
if (methodCatches != null) {
for (Iterator j = methodCatches.iterator(); j.hasNext();) {
AnnotationInstance methodCatch = (AnnotationInstance) j.next();
checkRelativePath(methodName, methodCatch, PATH_ATTR, jclass, decl, false);
}
}
}
}
}
}