KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > grammar > ExternalPathOrActionType


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.compiler.grammar;
19
20 import org.apache.beehive.netui.compiler.AnnotationGrammar;
21 import org.apache.beehive.netui.compiler.FlowControllerInfo;
22 import org.apache.beehive.netui.compiler.CompilerUtils;
23 import org.apache.beehive.netui.compiler.FatalCompileTimeException;
24 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration;
25 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue;
26 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance;
27 import org.apache.beehive.netui.compiler.typesystem.declaration.MemberDeclaration;
28
29 public class ExternalPathOrActionType extends WebappPathOrActionType
30 {
31     public ExternalPathOrActionType( boolean pathMustBeRelative, String JavaDoc requiredRuntimeVersion,
32                                    AnnotationGrammar parentGrammar, FlowControllerInfo fcInfo )
33     {
34         super( pathMustBeRelative, requiredRuntimeVersion, parentGrammar, fcInfo );
35     }
36
37     
38     public Object JavaDoc onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue value,
39                            AnnotationInstance[] parentAnnotations, MemberDeclaration classMember,
40                            int annotationArrayIndex )
41             throws FatalCompileTimeException
42     {
43         AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
44         
45         // if we have an external redirect just bail
46
if ( CompilerUtils.getBoolean( parentAnnotation, EXTERNAL_REDIRECT_ATTR, false ).booleanValue() )
47         {
48             return null;
49         }
50         
51         return super.onCheck( valueDecl, value, parentAnnotations, classMember, annotationArrayIndex );
52     }
53 }
54
Popular Tags