1 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.FatalCompileTimeException; 23 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; 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.MemberDeclaration; 27 28 import java.util.List ; 29 import java.util.Iterator ; 30 31 public class TilesDefinitionsConfigsType extends WebappPathType 32 { 33 public TilesDefinitionsConfigsType( String requiredRuntimeVersion, AnnotationGrammar parentGrammar, 34 FlowControllerInfo fcInfo ) 35 { 36 super( false, requiredRuntimeVersion, parentGrammar, fcInfo ); 37 } 38 39 40 public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue value, 41 AnnotationInstance[] parentAnnotations, MemberDeclaration classMember, 42 int annotationArrayIndex ) 43 throws FatalCompileTimeException 44 { 45 List values = ( List ) value.getValue(); 46 47 if ( values != null ) 48 { 49 for ( Iterator ii = values.iterator(); ii.hasNext(); ) 50 { 51 AnnotationValue pathValue = ( AnnotationValue ) ii.next(); 52 53 if ( pathValue != null ) 54 { 55 String filePath = ( String ) pathValue.getValue(); 56 if ( filePath == null || filePath.length() == 0 || filePath.charAt( 0 ) != '/' ) 57 { 58 addError( value, "error.absolute-path-required-for-tiles-def" ); 59 } 60 } 61 62 super.onCheck( valueDecl, pathValue, parentAnnotations, classMember, annotationArrayIndex ); 63 } 64 } 65 66 return null; 67 } 68 69 protected boolean checkAnyExtension() 70 { 71 return true; 72 } 73 } 74 | Popular Tags |