Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/Diagnostics.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/Diagnostics.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/Diagnostics.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/Diagnostics.java Mon Apr 11 23:42:11 2005 @@ -20,7 +20,7 @@ import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; import org.apache.beehive.netui.compiler.typesystem.declaration.Declaration; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; public abstract class Diagnostics { @@ -58,27 +58,27 @@ _hasErrors = true; } - public void addError( AnnotationMirror ann, String messageKey ) + public void addError( AnnotationInstance ann, String messageKey ) { addErrorArrayArgs( ann, messageKey, null ); } - public void addError( AnnotationMirror ann, String messageKey, Object arg ) + public void addError( AnnotationInstance ann, String messageKey, Object arg ) { addErrorArrayArgs( ann, messageKey, new Object[]{ arg } ); } - public void addError( AnnotationMirror ann, String messageKey, Object arg1, Object arg2 ) + public void addError( AnnotationInstance ann, String messageKey, Object arg1, Object arg2 ) { addErrorArrayArgs( ann, messageKey, new Object[]{ arg1, arg2 } ); } - public void addError( AnnotationMirror ann, String messageKey, Object arg1, Object arg2, Object arg3 ) + public void addError( AnnotationInstance ann, String messageKey, Object arg1, Object arg2, Object arg3 ) { addErrorArrayArgs( ann, messageKey, new Object[]{ arg1, arg2, arg3 } ); } - public void addErrorArrayArgs( AnnotationMirror ann, String messageKey, Object[] args ) + public void addErrorArrayArgs( AnnotationInstance ann, String messageKey, Object[] args ) { _env.getMessager().printError( ann.getPosition(), getResourceString( messageKey, args ) ); _hasErrors = true; @@ -135,27 +135,27 @@ _env.getMessager().printWarning( decl.getPosition(), getResourceString( messageKey, args ) ); } - public void addWarning( AnnotationMirror ann, String messageKey ) + public void addWarning( AnnotationInstance ann, String messageKey ) { addWarningArrayArgs( ann, messageKey, null ); } - public void addWarning( AnnotationMirror ann, String messageKey, Object arg ) + public void addWarning( AnnotationInstance ann, String messageKey, Object arg ) { addWarningArrayArgs( ann, messageKey, new Object[]{ arg } ); } - public void addWarning( AnnotationMirror ann, String messageKey, Object arg1, Object arg2 ) + public void addWarning( AnnotationInstance ann, String messageKey, Object arg1, Object arg2 ) { addWarningArrayArgs( ann, messageKey, new Object[]{ arg1, arg2 } ); } - public void addWarning( AnnotationMirror ann, String messageKey, Object arg1, Object arg2, Object arg3 ) + public void addWarning( AnnotationInstance ann, String messageKey, Object arg1, Object arg2, Object arg3 ) { addWarningArrayArgs( ann, messageKey, new Object[]{ arg1, arg2, arg3 } ); } - public void addWarningArrayArgs( AnnotationMirror ann, String messageKey, Object[] args ) + public void addWarningArrayArgs( AnnotationInstance ann, String messageKey, Object[] args ) { _env.getMessager().printWarning( ann.getPosition(), getResourceString( messageKey, args ) ); }
Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java Mon Apr 11 23:42:11 2005 @@ -18,10 +18,20 @@ package org.apache.beehive.netui.compiler; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; +import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; +import org.apache.beehive.netui.compiler.model.StrutsApp; +import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException; +import org.apache.xmlbeans.XmlException; + +import java.io.File; +import java.io.IOException; +import java.io.FileNotFoundException; public class FacesBackingGenerator extends BaseGenerator + implements JpfLanguageConstants { public FacesBackingGenerator( AnnotationProcessorEnvironment env, SourceFileInfo sourceFileInfo, Diagnostics diagnostics ) { @@ -30,6 +40,37 @@ public void generate( ClassDeclaration publicClass ) { - // do nothing + try + { + File sourceFile = CompilerUtils.getSourceFile( publicClass, true ); + File webappRoot = StrutsApp.getWebappRootFromSourceFile( sourceFile ); + AnnotationInstance facesBackingAnnotation = CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME ); + assert facesBackingAnnotation != null; // checker should enforce this + AnnotationToXML atx = new AnnotationToXML( publicClass ); + + // Add the class-level @Jpf.FacesBacking annotation. + atx.include( publicClass, facesBackingAnnotation ); + + // For each method, add the @Jpf.CommandHandler annotation. + MethodDeclaration[] methods = CompilerUtils.getClassMethods( publicClass, COMMAND_HANDLER_TAG_NAME ); + for ( int i = 0; i < methods.length; i++ ) + { + MethodDeclaration method = methods[i]; + AnnotationInstance commandHandlerAnn = CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ); + atx.include( method, commandHandlerAnn ); + } + + // Add @Jpf.SharedFlowField, @Jpf.PageFlowField, @Control. + FlowControllerGenerator.includeFieldAnnotations( atx, publicClass, PAGE_FLOW_FIELD_TAG_NAME ); + + // Write the file. + atx.writeXml( webappRoot, getDiagnostics() ); + } + catch ( NoWebInfDirectoryException e ) + { + e.printStackTrace(); // TODO: log + getDiagnostics().addError( publicClass, "error.could-not-generate", null, e.getMessage() ); + } + } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java Mon Apr 11 23:42:11 2005 @@ -22,7 +22,7 @@ import org.apache.beehive.netui.compiler.grammar.ExceptionHandlerGrammar; import org.apache.beehive.netui.compiler.grammar.WebappPathType; import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; @@ -33,7 +33,7 @@ import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; import org.apache.beehive.netui.compiler.typesystem.type.ClassType; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import org.apache.xmlbeans.XmlException; import java.io.File; @@ -199,7 +199,7 @@ for ( int i = 0; i < methods.length; i++ ) { MethodDeclaration method = methods[i]; - AnnotationMirror ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME ); + AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME ); if ( ann != null ) { @@ -217,13 +217,13 @@ { for ( Iterator ii = childAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror childAnnotation = ( AnnotationMirror ) ii.next(); + AnnotationInstance childAnnotation = ( AnnotationInstance ) ii.next(); enableNavigateTo( childAnnotation, fcInfo ); } } } - private static void enableNavigateTo( AnnotationMirror ann, FlowControllerInfo fcInfo ) + private static void enableNavigateTo( AnnotationInstance ann, FlowControllerInfo fcInfo ) { if ( ann == null ) return; String val = CompilerUtils.getEnumFieldName( ann, NAVIGATE_TO_ATTR, true ); @@ -312,7 +312,7 @@ // // Check the Jpf.Controller annotation on this class. // - AnnotationMirror controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME ); + AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME ); if ( controllerAnnotation != null ) _controllerGrammar.check( controllerAnnotation, null, jclass ); // @@ -336,7 +336,7 @@ { for ( Iterator ii = simpleActions.iterator(); ii.hasNext(); ) { - AnnotationMirror i = ( AnnotationMirror ) ii.next(); + AnnotationInstance i = ( AnnotationInstance ) ii.next(); checkRelativePath( i, PATH_ATTR, jclass, decl ); List conditionalForwards = CompilerUtils.getAnnotationArray( i, CONDITIONAL_FORWARDS_ATTR, true ); @@ -345,7 +345,7 @@ { for ( Iterator i2 = conditionalForwards.iterator(); i2.hasNext(); ) { - AnnotationMirror j = ( AnnotationMirror ) i2.next(); + AnnotationInstance j = ( AnnotationInstance ) i2.next(); checkRelativePath( j, PATH_ATTR, jclass, decl ); } } @@ -359,7 +359,7 @@ { for ( Iterator ii = forwards.iterator(); ii.hasNext(); ) { - AnnotationMirror i = ( AnnotationMirror ) ii.next(); + AnnotationInstance i = ( AnnotationInstance ) ii.next(); checkRelativePath( i, PATH_ATTR, jclass, decl ); } } @@ -371,12 +371,12 @@ { for ( Iterator ii = catches.iterator(); ii.hasNext(); ) { - AnnotationMirror i = ( AnnotationMirror ) ii.next(); + AnnotationInstance i = ( AnnotationInstance ) ii.next(); checkRelativePath( i, PATH_ATTR, jclass, decl ); } } - AnnotationMirror controllerAnnotation = CompilerUtils.getAnnotation( decl, CONTROLLER_TAG_NAME ); + AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( decl, CONTROLLER_TAG_NAME ); if ( controllerAnnotation != null ) { @@ -385,7 +385,7 @@ } } - private void checkRelativePath( AnnotationMirror ann, String memberName, TypeDeclaration jclass, TypeDeclaration baseType ) + private void checkRelativePath( AnnotationInstance ann, String memberName, TypeDeclaration jclass, TypeDeclaration baseType ) { if ( ann != null ) { @@ -413,7 +413,7 @@ // if ( CompilerUtils.typesAreEqual( jclass, field.getDeclaringType() ) ) { - TypeMirror type = field.getType(); + TypeInstance type = field.getType(); if ( ! field.hasModifier( Modifier.TRANSIENT ) && ! field.hasModifier( Modifier.STATIC ) && type instanceof ClassType @@ -426,11 +426,11 @@ protected void checkMethod( MethodDeclaration method, ClassDeclaration jclass ) { - AnnotationMirror[] annotations = method.getAnnotationMirrors(); + AnnotationInstance[] annotations = method.getAnnotationInstances(); for ( int i = 0; i < annotations.length; i++ ) { - AnnotationMirror annotation = annotations[i]; + AnnotationInstance annotation = annotations[i]; String annotationName = CompilerUtils.getDeclaration( annotation.getAnnotationType() ).getSimpleName(); if ( annotationName.equals( ACTION_TAG_NAME ) ) @@ -489,7 +489,7 @@ } else { - getDiagnostics().addError( method, "error.exception-method-wrong-arg-count", Integer.valueOf( 4 ) ); + getDiagnostics().addError( method, "error.exception-method-wrong-arg-count", new Integer( 4 ) ); } } @@ -498,7 +498,7 @@ { if ( ! CompilerUtils.isOfClass( parameters[ index ].getType(), className, getEnv() ) ) { - getDiagnostics().addError( method, "error.exception-method-wrong-arg-type", Integer.valueOf( index + 1 ), + getDiagnostics().addError( method, "error.exception-method-wrong-arg-type", new Integer( index + 1 ), className ); } } @@ -568,11 +568,11 @@ { if ( len > 3 ) { - getDiagnostics().addError( jpfClass, errorKey, overlapping.toArray() ); + getDiagnostics().addErrorArrayArgs( jpfClass, errorKey, overlapping.toArray() ); } else { - getDiagnostics().addError( jpfClass, errorKey + len, overlapping.toArray() ); + getDiagnostics().addErrorArrayArgs( jpfClass, errorKey + len, overlapping.toArray() ); } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java Mon Apr 11 23:42:11 2005 @@ -21,12 +21,17 @@ import org.apache.beehive.netui.compiler.genmodel.GenValidationModel; import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; +import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; +import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; import org.apache.xmlbeans.XmlException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.Collection; +import java.util.Iterator; abstract class FlowControllerGenerator @@ -34,6 +39,7 @@ { private static long _compilerJarTimestamp = -1; private static final boolean ALWAYS_GENERATE = true; // TODO: this turns stale checking off. Do we need it? + private static final String CONTROL_ANNOTATION = JpfLanguageConstants.BEEHIVE_PACKAGE + ".controls.api.bean.Control"; protected FlowControllerGenerator( AnnotationProcessorEnvironment env, FlowControllerInfo fcInfo, Diagnostics diagnostics ) @@ -51,6 +57,7 @@ try { + // Write the Struts config XML, and the Validator config XML if appropriate. app = createStrutsApp( publicClass ); GenValidationModel validationModel = new GenValidationModel( publicClass, app ); @@ -61,14 +68,17 @@ } generateStrutsConfig( app, publicClass ); + + // First, write out XML for any fields annotated with @Jpf.SharedFlowField or @Control. + writeFieldAnnotations( publicClass, app ); } catch ( Exception e ) { e.printStackTrace(); // @TODO log assert e instanceof NoWebInfDirectoryException || e instanceof XmlException || e instanceof IOException - || e instanceof FileNotFoundException; - getDiagnostics().addError( publicClass, "error.could-not-generate-struts-config", - app != null ? app.getStrutsConfigFile() : null ); + || e instanceof FileNotFoundException : e.getClass().getName(); + getDiagnostics().addError( publicClass, "error.could-not-generate", + app != null ? app.getStrutsConfigFile() : null, e.getMessage() ); } finally { @@ -76,6 +86,50 @@ } } + private void writeFieldAnnotations( ClassDeclaration classDecl, GenStrutsApp app ) + { + AnnotationToXML atx = new AnnotationToXML( classDecl ); + + if ( includeFieldAnnotations( atx, classDecl, null ) ) + { + atx.writeXml( app.getWebappRoot(), getDiagnostics() ); + } + } + + static boolean includeFieldAnnotations( AnnotationToXML atx, TypeDeclaration typeDecl, String additionalAnnotation ) + { + Collection fields = CompilerUtils.getClassFields( typeDecl ); + boolean hasFieldAnnotations = false; + + if ( fields.size() > 0 ) + { + for ( Iterator i = fields.iterator(); i.hasNext(); ) + { + FieldDeclaration field = ( FieldDeclaration ) i.next(); + AnnotationInstance fieldAnnotation = + CompilerUtils.getAnnotation( field, JpfLanguageConstants.SHARED_FLOW_FIELD_TAG_NAME ); + + if ( fieldAnnotation == null ) + { + fieldAnnotation = CompilerUtils.getAnnotationFullyQualified( field, CONTROL_ANNOTATION ); + } + + if ( fieldAnnotation == null && additionalAnnotation != null ) + { + fieldAnnotation = CompilerUtils.getAnnotation( field, additionalAnnotation ); + } + + if ( fieldAnnotation != null ) + { + atx.include( field, fieldAnnotation ); + hasFieldAnnotations = true; + } + } + } + + return hasFieldAnnotations; + } + protected void generateStrutsConfig( GenStrutsApp app, ClassDeclaration publicClass ) { File strutsConfigFile = null; @@ -106,12 +160,12 @@ assert e instanceof NoWebInfDirectoryException || e instanceof FileNotFoundException || e instanceof IOException - || e instanceof XmlException; + || e instanceof XmlException + : e.getClass().getName(); - getEnv().getMessager().printError( publicClass.getPosition(), "" ); - getDiagnostics().addError( publicClass, "error.could-not-generate-struts-config", + getDiagnostics().addError( publicClass, "error.could-not-generate", strutsConfigFile != null ? strutsConfigFile.getPath() : null, - null ); + e.getMessage() ); } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerInfo.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerInfo.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerInfo.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerInfo.java Mon Apr 11 23:42:11 2005 @@ -19,9 +19,9 @@ import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; @@ -38,9 +38,9 @@ private Set _actions = new HashSet(); private Set _returnActions = null; private File _webappRoot = null; - private Map _sharedFlowTypes = Collections.emptyMap(); - private Map _sharedFlowTypeNames = Collections.emptyMap(); - private Map _sharedFlowFiles = Collections.emptyMap(); + private Map _sharedFlowTypes = Collections.EMPTY_MAP; + private Map _sharedFlowTypeNames = Collections.EMPTY_MAP; + private Map _sharedFlowFiles = Collections.EMPTY_MAP; private List _referencedFiles = new ArrayList(); private boolean _isBuilding = false; private Map _messageBundlesByName = new HashMap(); @@ -219,9 +219,9 @@ { for ( java.util.Iterator ii = sharedFlowRefs.iterator(); ii.hasNext(); ) { - AnnotationMirror sharedFlowRef = ( AnnotationMirror ) ii.next(); + AnnotationInstance sharedFlowRef = ( AnnotationInstance ) ii.next(); String name = CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true ); - TypeMirror type = CompilerUtils.getTypeMirror( sharedFlowRef, TYPE_ATTR, true ); + TypeInstance type = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true ); if ( type instanceof DeclaredType ) // if it's not a DeclaredType, the error will be caught elsewhere. { @@ -342,9 +342,9 @@ * Add a return-action from an annotation. * @return the form bean type, or null</code> if there is no form bean. */ - public TypeMirror addReturnAction( String returnActionName, AnnotationMirror annotation, TypeDeclaration outerType ) + public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType ) { - TypeMirror formBeanType = CompilerUtils.getTypeMirror( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true ); + TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true ); if ( formBeanType == null ) { Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FormBeanChecker.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FormBeanChecker.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FormBeanChecker.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FormBeanChecker.java Mon Apr 11 23:42:11 2005 @@ -18,7 +18,7 @@ package org.apache.beehive.netui.compiler; import org.apache.beehive.netui.compiler.grammar.ValidatablePropertyGrammar; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; @@ -98,7 +98,7 @@ private boolean checkValidationAnnotation( MethodDeclaration method, String annotationTagName, AnnotationGrammar grammar ) { - AnnotationMirror annotation = CompilerUtils.getAnnotation( method, annotationTagName ); + AnnotationInstance annotation = CompilerUtils.getAnnotation( method, annotationTagName ); if ( annotation != null ) { @@ -130,7 +130,7 @@ } protected void onCheckMember( AnnotationTypeElementDeclaration memberDecl, AnnotationValue member, - AnnotationMirror annotation, AnnotationMirror[] parentAnnotations, + AnnotationInstance annotation, AnnotationInstance[] parentAnnotations, MemberDeclaration classMember ) { if ( memberDecl.getSimpleName().equals( PROPERTY_NAME_ATTR ) ) Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java Mon Apr 11 23:42:11 2005 @@ -21,7 +21,8 @@ public interface JpfLanguageConstants { - public static final String NETUI_PACKAGE = "org.apache.beehive.netui"; + public static final String BEEHIVE_PACKAGE = "org.apache.beehive"; + public static final String NETUI_PACKAGE = BEEHIVE_PACKAGE + ".netui"; public static final String PAGEFLOW_PACKAGE = NETUI_PACKAGE + ".pageflow"; public static final String PAGEFLOW_INTERNAL_PACKAGE = PAGEFLOW_PACKAGE + ".internal"; public static final String ANNOTATIONS_CLASSNAME = PAGEFLOW_PACKAGE + ".annotations.Jpf"; @@ -227,9 +228,9 @@ public static class ExtraInfoKeys { - public static final Integer flowControllerInfo = Integer.valueOf( 0 ); - public static final Integer facesBackingInfo = Integer.valueOf( 1 ); - public static final Integer overlappingPageFlowFiles = Integer.valueOf( 2 ); + public static final Integer flowControllerInfo = new Integer( 0 ); + public static final Integer facesBackingInfo = new Integer( 1 ); + public static final Integer overlappingPageFlowFiles = new Integer( 2 ); private Integer _val; Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MergedControllerAnnotation.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MergedControllerAnnotation.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MergedControllerAnnotation.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MergedControllerAnnotation.java Mon Apr 11 23:42:11 2005 @@ -17,7 +17,7 @@ */ package org.apache.beehive.netui.compiler; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.type.ClassType; @@ -54,7 +54,7 @@ mergeControllerAnnotations( jclass ); } - public void mergeAnnotation( AnnotationMirror controllerAnnotation ) + public void mergeAnnotation( AnnotationInstance controllerAnnotation ) { String strutsMerge = CompilerUtils.getString( controllerAnnotation, STRUTSMERGE_ATTR, true ); if ( strutsMerge != null ) _strutsMerge = strutsMerge; @@ -92,7 +92,7 @@ if ( multipartHandler != null ) _multipartHandler = multipartHandler; } - private static List mergeStringArray( List memberList, AnnotationMirror parentAnnotation, + private static List mergeStringArray( List memberList, AnnotationInstance parentAnnotation, String attr ) { List newList = CompilerUtils.getStringArray( parentAnnotation, attr, true ); @@ -107,7 +107,7 @@ } private static void mergeAnnotationArray( LinkedHashMap keyedList, - AnnotationMirror parentAnnotation, String attr, String keyAttr ) + AnnotationInstance parentAnnotation, String attr, String keyAttr ) { List annotations = CompilerUtils.getAnnotationArray( parentAnnotation, attr, true ); @@ -115,7 +115,7 @@ { for ( Iterator ii = annotations.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); Object key = CompilerUtils.getAnnotationValue( ann, keyAttr, true ); if ( key != null ) keyedList.put( key.toString(), ann ); } @@ -221,7 +221,7 @@ { ClassType superClass = ( ( ClassDeclaration ) jclass ).getSuperclass(); if ( superClass != null ) mergeControllerAnnotations( superClass.getDeclaration() ); - AnnotationMirror controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME ); + AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME ); if ( controllerAnnotation != null ) mergeAnnotation( controllerAnnotation ); } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/PageFlowChecker.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/PageFlowChecker.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/PageFlowChecker.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/PageFlowChecker.java Mon Apr 11 23:42:11 2005 @@ -21,7 +21,7 @@ import org.apache.beehive.netui.compiler.grammar.ControllerGrammar; import org.apache.beehive.netui.compiler.grammar.WebappPathOrActionType; import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.Modifier; @@ -29,7 +29,7 @@ import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import org.apache.xmlbeans.XmlException; import java.io.File; @@ -53,7 +53,7 @@ // Check to make sure that if this is a Shared Flow field, its type matches up with the type declared // for the shared flow of that name. // - AnnotationMirror sfFieldAnn = CompilerUtils.getAnnotation( field, SHARED_FLOW_FIELD_TAG_NAME ); + AnnotationInstance sfFieldAnn = CompilerUtils.getAnnotation( field, SHARED_FLOW_FIELD_TAG_NAME ); if ( sfFieldAnn != null ) { @@ -69,13 +69,13 @@ { for ( Iterator ii = sharedFlowRefs.iterator(); ii.hasNext(); ) { - AnnotationMirror sharedFlowRef = ( AnnotationMirror ) ii.next(); + AnnotationInstance sharedFlowRef = ( AnnotationInstance ) ii.next(); if ( sharedFlowName.equals( CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true ) ) ) { foundOne = true; - TypeMirror sfType = CompilerUtils.getTypeMirror( sharedFlowRef, TYPE_ATTR, true ); - TypeMirror ft = field.getType(); + TypeInstance sfType = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true ); + TypeInstance ft = field.getType(); if ( ! ( sfType instanceof DeclaredType ) || ! CompilerUtils.isAssignableFrom( ft, ( ( DeclaredType ) sfType ).getDeclaration() ) ) @@ -175,7 +175,7 @@ { for ( Iterator ii = forwardAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); String returnAction = CompilerUtils.getString( ann, RETURN_ACTION_ATTR, true ); if ( returnAction != null ) fcInfo.addReturnAction( returnAction, ann, outerType ); Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/RuntimeVersionChecker.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/RuntimeVersionChecker.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/RuntimeVersionChecker.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/RuntimeVersionChecker.java Mon Apr 11 23:42:11 2005 @@ -17,7 +17,7 @@ */ package org.apache.beehive.netui.compiler; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.declaration.Declaration; @@ -82,7 +82,7 @@ private static String getHighVersion() { - return Integer.valueOf( Integer.MAX_VALUE ).toString(); + return new Integer( Integer.MAX_VALUE ).toString(); } int getRuntimeVersion() @@ -124,7 +124,7 @@ return true; } - public boolean checkRuntimeVersion( String requiredRuntimeVersion, AnnotationMirror element, Diagnostics diags, + public boolean checkRuntimeVersion( String requiredRuntimeVersion, AnnotationInstance element, Diagnostics diags, String errMsg, Object[] errMsgParams ) { if ( requiredRuntimeVersion != null ) Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/SharedFlowChecker.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/SharedFlowChecker.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/SharedFlowChecker.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/SharedFlowChecker.java Mon Apr 11 23:42:11 2005 @@ -55,7 +55,7 @@ getDiagnostics().addError( jclass, "error.wrong-package", GLOBALAPP_PACKAGE ); } - if ( ! jclass.getPosition().file().getPath().contains( WEBINF_SRC_DIR ) ) + if ( ! jclass.getPosition().file().getParentFile().getName().endsWith( GLOBALAPP_PACKAGE ) ) { getDiagnostics().addError( jclass, "error.global-app-wrong-dir", GLOBALAPP_SOURCE_NAME, GLOBALAPP_PARENT_PATH ); Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties Mon Apr 11 23:42:11 2005 @@ -132,7 +132,7 @@ There is a list of {0} annotations defined for this class, but message key "{1}" is not present in it. error.duplicate-action = Duplicate action "{0}". -error.could-not-generate-struts-config = Could not generate output file {0}. +error.could-not-generate = Could not generate output file {0}. The error was: {1} error.invalid-member-form-type = Member field {0} is not a valid form bean class type. warning.validation-annotations-no-forward = \ Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/DefaultValidatorRuleFactory.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/DefaultValidatorRuleFactory.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/DefaultValidatorRuleFactory.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/DefaultValidatorRuleFactory.java Mon Apr 11 23:42:11 2005 @@ -29,7 +29,7 @@ import java.util.Iterator; // Constants -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.type.PrimitiveType; @@ -50,7 +50,7 @@ VALIDATE_TYPE_RULES.put( PrimitiveType.Kind.SHORT, RULENAME_SHORT ); } - public ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationMirror ruleAnnotation ) + public ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationInstance ruleAnnotation ) { ValidatorRule rule = null; String annName = CompilerUtils.getSimpleName( ruleAnnotation ); @@ -129,7 +129,7 @@ for ( Iterator ii = ruleVars.iterator(); ii.hasNext(); ) { - AnnotationMirror ruleVar = ( AnnotationMirror ) ii.next(); + AnnotationInstance ruleVar = ( AnnotationInstance ) ii.next(); rule.setVar( CompilerUtils.getString( ruleVar, NAME_ATTR, false ), CompilerUtils.getString( ruleVar, VALUE_ATTR, false ) ); } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java Mon Apr 11 23:42:11 2005 @@ -21,14 +21,14 @@ import org.apache.beehive.netui.compiler.JpfLanguageConstants; import org.apache.beehive.netui.compiler.model.ActionModel; import org.apache.beehive.netui.compiler.model.ForwardModel; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.Declaration; import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.ParameterDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import java.util.HashSet; import java.util.Iterator; @@ -49,13 +49,13 @@ setFormBeanName( getFormBean( sourceElement, parentApp ) ); } - protected GenActionModel( String actionName, AnnotationMirror ann, GenStrutsApp parentApp, ClassDeclaration jclass ) + protected GenActionModel( String actionName, AnnotationInstance ann, GenStrutsApp parentApp, ClassDeclaration jclass ) { super( parentApp ); init( actionName, ann, parentApp, jclass ); } - private void init( String actionName, AnnotationMirror annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) + private void init( String actionName, AnnotationInstance annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) { setPath( '/' + actionName ); @@ -109,7 +109,7 @@ // // validationErrorForward -- the forward used when validation fails // - AnnotationMirror validateErrFwd = CompilerUtils.getAnnotation( annotation, VALIDATION_ERROR_FORWARD_ATTR, true ); + AnnotationInstance validateErrFwd = CompilerUtils.getAnnotation( annotation, VALIDATION_ERROR_FORWARD_ATTR, true ); boolean doValidation = false; if ( validateErrFwd != null ) { @@ -131,7 +131,7 @@ GenExceptionModel.addCatches( annotation, this, jclass, parentApp, this ); } - private void setRolesAllowed( AnnotationMirror annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) + private void setRolesAllowed( AnnotationInstance annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) { List rolesAllowed = CompilerUtils.getStringArray( annotation, ROLES_ALLOWED_ATTR, true ); List classLevelRA = parentApp.getFlowControllerInfo().getMergedControllerAnnotation().getRolesAllowed(); @@ -191,14 +191,14 @@ if ( params.length > 0 ) { assert params.length == 1 : params.length; // checker should catch this - TypeMirror paramType = CompilerUtils.getGenericBoundsType( params[0].getType() ); + TypeInstance paramType = CompilerUtils.getGenericBoundsType( params[0].getType() ); formBeanName = addFormBean( paramType, parentApp ); } return formBeanName; } - protected String addFormBean( TypeMirror paramType, GenStrutsApp parentApp ) + protected String addFormBean( TypeInstance paramType, GenStrutsApp parentApp ) { paramType = CompilerUtils.getGenericBoundsType( paramType ); assert paramType instanceof DeclaredType : paramType.getClass().getName(); // checker should enforce this @@ -216,13 +216,13 @@ return formBeanName; } - protected AnnotationMirror getActionAnnotation( Declaration sourceElement ) + protected AnnotationInstance getActionAnnotation( Declaration sourceElement ) { assert sourceElement instanceof MethodDeclaration : sourceElement.getClass().getName(); return CompilerUtils.getAnnotation( sourceElement, ACTION_TAG_NAME ); } - protected void getForwards( AnnotationMirror annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) + protected void getForwards( AnnotationInstance annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) { GenForwardModel.addForwards( annotation, this, jclass, parentApp, null ); } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionOutputModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionOutputModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionOutputModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenActionOutputModel.java Mon Apr 11 23:42:11 2005 @@ -20,10 +20,10 @@ import org.apache.beehive.netui.compiler.model.ActionOutputModel; import org.apache.beehive.netui.compiler.JpfLanguageConstants; import org.apache.beehive.netui.compiler.CompilerUtils; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.type.ArrayType; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; import org.apache.beehive.netui.compiler.typesystem.type.PrimitiveType; @@ -32,7 +32,7 @@ extends ActionOutputModel implements JpfLanguageConstants { - public GenActionOutputModel( AnnotationMirror annotation, ClassDeclaration jclass ) + public GenActionOutputModel( AnnotationInstance annotation, ClassDeclaration jclass ) { setName( CompilerUtils.getString( annotation, NAME_ATTR, true ) ); @@ -45,7 +45,7 @@ // // Get the base type, and add "[]" to it for arrays. // - TypeMirror baseType = CompilerUtils.getReferenceType( annotation, TYPE_ATTR, true ); + TypeInstance baseType = CompilerUtils.getReferenceType( annotation, TYPE_ATTR, true ); StringBuffer arrayDimensions = new StringBuffer(); while ( baseType instanceof ArrayType ) { Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenExceptionModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenExceptionModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenExceptionModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenExceptionModel.java Mon Apr 11 23:42:11 2005 @@ -22,7 +22,7 @@ import org.apache.beehive.netui.compiler.model.ExceptionContainer; import org.apache.beehive.netui.compiler.JpfLanguageConstants; import org.apache.beehive.netui.compiler.CompilerUtils; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; @@ -35,7 +35,7 @@ extends ExceptionModel implements JpfLanguageConstants { - public GenExceptionModel( GenStrutsApp parentApp, AnnotationMirror annotation, ClassDeclaration jclass, + public GenExceptionModel( GenStrutsApp parentApp, AnnotationInstance annotation, ClassDeclaration jclass, ForwardContainer forwardContainer ) { super( parentApp ); @@ -55,7 +55,7 @@ if ( methodName != null ) { MethodDeclaration method = CompilerUtils.getClassMethod( jclass, methodName, EXCEPTION_HANDLER_TAG_NAME ); - AnnotationMirror exHandlerAnnotation = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME ); + AnnotationInstance exHandlerAnnotation = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME ); GenForwardModel.addForwards( exHandlerAnnotation, forwardContainer, jclass, parentApp, " from exception-handler " + methodName ); // @TODO I18N the comment @@ -71,7 +71,7 @@ } } - static void addCatches( AnnotationMirror annotation, ExceptionContainer container, ClassDeclaration jclass, + static void addCatches( AnnotationInstance annotation, ExceptionContainer container, ClassDeclaration jclass, GenStrutsApp strutsApp, ForwardContainer forwardContainer ) { List catches = CompilerUtils.getAnnotationArray( annotation, CATCHES_ATTR, true ); @@ -84,7 +84,7 @@ { for ( Iterator ii = catches.iterator(); ii.hasNext(); ) { - AnnotationMirror i = ( AnnotationMirror ) ii.next(); + AnnotationInstance i = ( AnnotationInstance ) ii.next(); container.addException( new GenExceptionModel( strutsApp, i, jclass, forwardContainer ) ); } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java Mon Apr 11 23:42:11 2005 @@ -21,7 +21,7 @@ import org.apache.beehive.netui.compiler.model.ForwardContainer; import org.apache.beehive.netui.compiler.CompilerUtils; import org.apache.beehive.netui.compiler.JpfLanguageConstants; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; @@ -34,7 +34,7 @@ extends ForwardModel implements JpfLanguageConstants { - public GenForwardModel( GenStrutsApp parent, AnnotationMirror annotation, ClassDeclaration jclass, + public GenForwardModel( GenStrutsApp parent, AnnotationInstance annotation, ClassDeclaration jclass, String commentSuffix ) { super( parent ); @@ -144,7 +144,7 @@ } } - static void addForwards( AnnotationMirror annotation, ForwardContainer container, ClassDeclaration jclass, + static void addForwards( AnnotationInstance annotation, ForwardContainer container, ClassDeclaration jclass, GenStrutsApp strutsApp, String commentSuffix ) { List forwards = CompilerUtils.getAnnotationArray( annotation, FORWARDS_ATTR, true ); @@ -158,13 +158,13 @@ { for ( Iterator ii = forwards.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); container.addForward( new GenForwardModel( strutsApp, ann, jclass, commentSuffix ) ); } } } - protected void addActionOutputs( AnnotationMirror annotation, ClassDeclaration jclass ) + protected void addActionOutputs( AnnotationInstance annotation, ClassDeclaration jclass ) { List actionOutputs = CompilerUtils.getAnnotationArray( annotation, ACTION_OUTPUTS_ATTR, true ); @@ -173,7 +173,7 @@ { for ( Iterator ii = actionOutputs.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); addActionOutput( new GenActionOutputModel( ann, jclass ) ); } } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenMessageBundleModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenMessageBundleModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenMessageBundleModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenMessageBundleModel.java Mon Apr 11 23:42:11 2005 @@ -21,14 +21,14 @@ import org.apache.beehive.netui.compiler.model.MessageResourcesModel; import org.apache.beehive.netui.compiler.CompilerUtils; import org.apache.beehive.netui.compiler.JpfLanguageConstants; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; public class GenMessageBundleModel extends MessageResourcesModel implements JpfLanguageConstants { - public GenMessageBundleModel( StrutsApp parent, AnnotationMirror annotation ) + public GenMessageBundleModel( StrutsApp parent, AnnotationInstance annotation ) { super( parent ); Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java Mon Apr 11 23:42:11 2005 @@ -23,8 +23,8 @@ import org.apache.beehive.netui.compiler.typesystem.declaration.Declaration; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDeclaration; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import java.util.List; import java.util.Iterator; @@ -34,7 +34,7 @@ extends GenActionModel implements JpfLanguageConstants { - public GenSimpleActionModel( AnnotationMirror annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) + public GenSimpleActionModel( AnnotationInstance annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) { super( CompilerUtils.getString( annotation, NAME_ATTR, true ), annotation, parentApp, jclass ); @@ -52,7 +52,7 @@ { setReadonly( true ); // can't modify member state; mark as read-only - TypeMirror formBeanType = CompilerUtils.getTypeMirror( annotation, USE_FORM_BEAN_TYPE_ATTR, true ); + TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, USE_FORM_BEAN_TYPE_ATTR, true ); if ( formBeanType != null ) { @@ -66,11 +66,11 @@ return null; } - protected void getForwards( AnnotationMirror annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) + protected void getForwards( AnnotationInstance annotation, ClassDeclaration jclass, GenStrutsApp parentApp ) { } - private void addForwards( AnnotationMirror annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) + private void addForwards( AnnotationInstance annotation, GenStrutsApp parentApp, ClassDeclaration jclass ) { // // First add the default forward -- the one that is parsed from the simple action annotation itself. @@ -100,7 +100,7 @@ for ( Iterator ii = conditionalFwdAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror conditionalFwdAnnotation = ( AnnotationMirror ) ii.next(); + AnnotationInstance conditionalFwdAnnotation = ( AnnotationInstance ) ii.next(); ForwardModel conditionalFwd = new SimpleActionForward( parentApp, conditionalFwdAnnotation, jclass ); String expression = CompilerUtils.getString( conditionalFwdAnnotation, CONDITION_ATTR, true ); assert expression != null; @@ -114,18 +114,18 @@ private static class SimpleActionForward extends GenForwardModel { - public SimpleActionForward( GenStrutsApp parent, AnnotationMirror annotation, ClassDeclaration jclass ) + public SimpleActionForward( GenStrutsApp parent, AnnotationInstance annotation, ClassDeclaration jclass ) { super( parent, annotation, jclass, null ); } - public SimpleActionForward( String name, GenStrutsApp parent, AnnotationMirror annotation, ClassDeclaration jclass ) + public SimpleActionForward( String name, GenStrutsApp parent, AnnotationInstance annotation, ClassDeclaration jclass ) { super( parent, annotation, jclass, null ); setName( name ); } - protected void addActionOutputs( AnnotationMirror annotation, ClassDeclaration jclass ) + protected void addActionOutputs( AnnotationInstance annotation, ClassDeclaration jclass ) { // do nothing -- there are no action outputs on simple actions } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java Mon Apr 11 23:42:11 2005 @@ -27,7 +27,7 @@ import org.apache.beehive.netui.compiler.model.MessageResourcesModel; import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException; import org.apache.beehive.netui.compiler.model.StrutsApp; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.Modifier; @@ -36,7 +36,7 @@ import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; -import org.apache.beehive.netui.compiler.typesystem.type.TypeMirror; +import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; import org.apache.xmlbeans.XmlCursor; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; @@ -85,7 +85,7 @@ _jclass = jclass; _containingPackage = jclass.getPackage().getQualifiedName(); _sourceFile = sourceFile; - _webappRoot = getWebappRootFromJpf( sourceFile ).getAbsoluteFile(); + _webappRoot = getWebappRootFromSourceFile( sourceFile ).getAbsoluteFile(); _env = env; assert fcInfo != null; _fcInfo = fcInfo; @@ -163,12 +163,13 @@ // we'll just use it; otherwise, we need to create it. // boolean usesPageFlowScopedFormBean = usedByAction != null ? usedByAction.getFormMember() != null : false; - FormBeanModel existingBean = getFormBeanByActualType( actualType, usesPageFlowScopedFormBean ); + List existingBeans = getFormBeansByActualType( actualType, Boolean.valueOf( usesPageFlowScopedFormBean ) ); String formBeanName; - if ( existingBean != null ) + if ( existingBeans != null ) { - formBeanName = existingBean.getName(); + assert existingBeans.size() > 0; + formBeanName = ( ( FormBeanModel ) existingBeans.get( 0 ) ).getName(); } else { @@ -186,7 +187,7 @@ { for ( Iterator ii = messageResources.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); addMessageResources( new GenMessageBundleModel( this, ann ) ); } } @@ -198,7 +199,7 @@ { for ( Iterator ii = messageBundles.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); addMessageResources( new GenMessageBundleModel( this, ann ) ); } } @@ -210,7 +211,7 @@ { for ( Iterator ii = simpleActionAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); addActionMapping( new GenSimpleActionModel( ann, this, _jclass ) ); } } @@ -260,7 +261,7 @@ private String getStrutsModulePath() { - StringBuilder modulePath = new StringBuilder( '/' ); + StringBuffer modulePath = new StringBuffer( '/' ); if ( isSharedFlow() ) modulePath.append( STRUTS_CONFIG_SEPARATOR ); if ( _containingPackage != null ) modulePath.append( _containingPackage.replace( '.', '/' ) ); return modulePath.toString(); @@ -283,7 +284,7 @@ if ( params.length > 0 ) { ParameterDeclaration param1 = params[0]; - TypeMirror paramType = param1.getType(); + TypeInstance paramType = param1.getType(); if ( paramType instanceof DeclaredType ) { @@ -296,7 +297,7 @@ private void getMessageResourcesFromForm( TypeDeclaration formClassType, ActionModel actionModel ) { - AnnotationMirror ann = CompilerUtils.getAnnotation( formClassType, FORM_BEAN_TAG_NAME ); + AnnotationInstance ann = CompilerUtils.getAnnotation( formClassType, FORM_BEAN_TAG_NAME ); if ( ann != null ) { Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java Mon Apr 11 23:42:11 2005 @@ -25,7 +25,7 @@ import org.apache.beehive.netui.compiler.model.validation.ValidationModel; import org.apache.beehive.netui.compiler.model.validation.ValidatorConstants; import org.apache.beehive.netui.compiler.model.validation.ValidatorRule; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; @@ -44,6 +44,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.ArrayList; public class GenValidationModel extends ValidationModel @@ -90,52 +91,40 @@ private void addRulesFromBeanClass( ClassDeclaration beanClass ) { - Collection properties = - CompilerUtils.getBeanProperties( beanClass, true ); + Collection properties = CompilerUtils.getBeanProperties( beanClass, true ); for ( Iterator ii = properties.iterator(); ii.hasNext(); ) { CompilerUtils.BeanPropertyDeclaration property = ( CompilerUtils.BeanPropertyDeclaration ) ii.next(); MethodDeclaration getter = property.getGetter(); String propertyName = property.getPropertyName(); - String formName = getFormBeanName( beanClass ); if ( getter != null ) { // // Parse validation annotations on each getter. // - AnnotationMirror[] annotations = getter.getAnnotationMirrors(); + AnnotationInstance[] annotations = getter.getAnnotationInstances(); if ( annotations != null ) { - for ( int i = 0; i < annotations.length; i++ ) + List formNames = getFormBeanNames( beanClass ); + + for ( Iterator j = formNames.iterator(); j.hasNext(); ) { - AnnotationMirror ann = annotations[i]; + String formName = ( String ) j.next(); - if ( CompilerUtils.isJpfAnnotation( ann, VALIDATABLE_PROPERTY_TAG_NAME ) ) + for ( int i = 0; i < annotations.length; i++ ) { - // - // Add field rules from the Jpf.ValidationLocaleRules annotation. - // - addRulesFromAnnotation( ann, formName, propertyName ); - } - else - { - // We don't currently support rule annotations directly on getters. - - /* - // - // Add a field rule (which will apply to all locales. - // - ValidatorRule rule = getFieldRule( formName, propertyName, ann ); + AnnotationInstance ann = annotations[i]; - if ( rule != null ) + if ( CompilerUtils.isJpfAnnotation( ann, VALIDATABLE_PROPERTY_TAG_NAME ) ) { - addFieldRuleForAllLocales( formName, propertyName, rule ); - setEmpty( false ); + // + // Add field rules from the Jpf.ValidationLocaleRules annotation. + // + addRulesFromAnnotation( ann, formName, propertyName ); } - */ } } } @@ -144,7 +133,7 @@ } - private void addRulesFromAnnotation( AnnotationMirror validationFieldAnn, String entityName, String propertyName ) + private void addRulesFromAnnotation( AnnotationInstance validationFieldAnn, String entityName, String propertyName ) { // // Add rules from the FieldValidationRules annotations in the "localeRules" member. @@ -158,7 +147,7 @@ for ( Iterator ii = localeRulesAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); addFieldRules( ann, ruleInfo, false ); } @@ -172,7 +161,7 @@ for ( int i = 0; i < methods.length; i++ ) { MethodDeclaration method = methods[i]; - AnnotationMirror actionAnnotation = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME ); + AnnotationInstance actionAnnotation = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME ); assert actionAnnotation != null; addRulesFromActionAnnotation( actionAnnotation, method.getSimpleName() ); } @@ -184,7 +173,7 @@ { for ( Iterator ii = simpleActions.iterator(); ii.hasNext(); ) { - AnnotationMirror simpleAction = ( AnnotationMirror ) ii.next(); + AnnotationInstance simpleAction = ( AnnotationInstance ) ii.next(); String actionName = CompilerUtils.getString( simpleAction, NAME_ATTR, true ); assert actionName != null; //checker should enforce this. addRulesFromActionAnnotation( simpleAction, actionName ); @@ -192,14 +181,14 @@ } } - private void addRulesFromActionAnnotation( AnnotationMirror actionAnnotation, String actionName ) + private void addRulesFromActionAnnotation( AnnotationInstance actionAnnotation, String actionName ) { Collection validatablePropertyAnnotations = CompilerUtils.getAnnotationArray( actionAnnotation, VALIDATABLE_PROPERTIES_ATTR, false ); for ( Iterator ii = validatablePropertyAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror validationFieldAnnotation = ( AnnotationMirror ) ii.next(); + AnnotationInstance validationFieldAnnotation = ( AnnotationInstance ) ii.next(); String propertyName = CompilerUtils.getString( validationFieldAnnotation, PROPERTY_NAME_ATTR, true ); assert propertyName != null; // TODO: checker must enforce this assert ! propertyName.equals( "" ); // TODO: checker must enforce this @@ -212,20 +201,33 @@ } } - private String getFormBeanName( TypeDeclaration beanType ) + /** + * Returns a list of String names. + */ + private List getFormBeanNames( TypeDeclaration beanType ) { String actualType = CompilerUtils.getLoadableName( beanType ); - FormBeanModel formBean = _strutsApp.getFormBeanByActualType( actualType, false ); + List formBeans = _strutsApp.getFormBeansByActualType( actualType, null ); + ArrayList formBeanNames = new ArrayList(); - if ( formBean == null ) + if ( formBeans == null ) { String beanClassName = CompilerUtils.getFormClassName( beanType, _strutsApp.getEnv() ); String formName = _strutsApp.getFormNameForType( actualType, false ); - formBean = new FormBeanModel( formName, beanClassName, actualType, false, _strutsApp ); + FormBeanModel formBean = new FormBeanModel( formName, beanClassName, actualType, false, _strutsApp ); _strutsApp.addFormBean( formBean ); + formBeanNames.add( formBean.getName() ); + } + else + { + for ( Iterator i = formBeans.iterator(); i.hasNext(); ) + { + FormBeanModel formBeanModel = ( FormBeanModel ) i.next(); + formBeanNames.add( formBeanModel.getName() ); + } } - return formBean.getName(); + return formBeanNames; } private void addRulesFromClass( MergedControllerAnnotation mca ) @@ -234,7 +236,7 @@ for ( Iterator ii = validationBeanAnnotations.iterator(); ii.hasNext(); ) { - AnnotationMirror validationBeanAnnotation = ( AnnotationMirror ) ii.next(); + AnnotationInstance validationBeanAnnotation = ( AnnotationInstance ) ii.next(); DeclaredType beanType = CompilerUtils.getDeclaredType( validationBeanAnnotation, TYPE_ATTR, true ); assert beanType != null; // checker should enforce this @@ -243,7 +245,7 @@ for ( Iterator i2 = validationFieldAnnotations.iterator(); i2.hasNext(); ) { - AnnotationMirror validationFieldAnnotation = ( AnnotationMirror ) i2.next(); + AnnotationInstance validationFieldAnnotation = ( AnnotationInstance ) i2.next(); String propName = CompilerUtils.getString( validationFieldAnnotation, PROPERTY_NAME_ATTR, true ); assert propName != null; // checker should enforce this assert ! propName.equals( "" ); // TODO: get checker to enforce this @@ -252,8 +254,13 @@ // Add the rules. If the bean is derived from ActionForm, associate the rules with the *name* of // the form; otherwise, associate them with the classname of the bean type. // - String formName = getFormBeanName( CompilerUtils.getDeclaration( beanType ) ); - addRulesFromAnnotation( validationFieldAnnotation, formName, propName ); + List formNames = getFormBeanNames( CompilerUtils.getDeclaration( beanType ) ); + + for ( Iterator j = formNames.iterator(); j.hasNext(); ) + { + String formName = ( String ) j.next(); + addRulesFromAnnotation( validationFieldAnnotation, formName, propName ); + } } } } @@ -261,7 +268,7 @@ /** * Add field rules from either a Jpf.ValidationField or a Jpf.ValidationLocaleRules annotation. */ - private void addFieldRules( AnnotationMirror rulesContainerAnnotation, RuleInfo ruleInfo, + private void addFieldRules( AnnotationInstance rulesContainerAnnotation, RuleInfo ruleInfo, boolean applyToAllLocales ) { // @@ -300,9 +307,9 @@ AnnotationValue value = ( AnnotationValue ) entry.getValue(); Object val = value.getValue(); - if ( val instanceof AnnotationMirror ) + if ( val instanceof AnnotationInstance ) { - addFieldRuleFromAnnotation( ruleInfo, ( AnnotationMirror ) val, locale, applyToAllLocales ); + addFieldRuleFromAnnotation( ruleInfo, ( AnnotationInstance ) val, locale, applyToAllLocales ); } else if ( val instanceof List ) { @@ -310,7 +317,7 @@ for ( Iterator i3 = annotations.iterator(); i3.hasNext(); ) { - AnnotationMirror i = ( AnnotationMirror ) i3.next(); + AnnotationInstance i = ( AnnotationInstance ) i3.next(); addFieldRuleFromAnnotation( ruleInfo, i, locale, applyToAllLocales ); } } @@ -319,7 +326,7 @@ setEmpty( false ); // this ValidationModel is only "empty" if there are no rules. } - private void addFieldRuleFromAnnotation( RuleInfo ruleInfo, AnnotationMirror annotation, Locale locale, + private void addFieldRuleFromAnnotation( RuleInfo ruleInfo, AnnotationInstance annotation, Locale locale, boolean applyToAllLocales ) { @@ -338,7 +345,7 @@ } } - private static ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationMirror ruleAnnotation ) + private static ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationInstance ruleAnnotation ) { ValidatorRule rule = VALIDATOR_RULE_FACTORY.getFieldRule( entityName, propertyName, ruleAnnotation ); @@ -361,7 +368,7 @@ return rule; } - protected static void addMessageArgs( ValidatorRule rule, AnnotationMirror annotation ) + protected static void addMessageArgs( ValidatorRule rule, AnnotationInstance annotation ) { List messageArgs = CompilerUtils.getAnnotationArray( annotation, MESSAGE_ARGS_ATTR, true ); @@ -371,14 +378,14 @@ int inferredPosition = 0; for ( Iterator ii = messageArgs.iterator(); ii.hasNext(); ) { - AnnotationMirror ann = ( AnnotationMirror ) ii.next(); + AnnotationInstance ann = ( AnnotationInstance ) ii.next(); String arg = CompilerUtils.getString( ann, ARG_ATTR, true ); String bundle = CompilerUtils.getString( ann, BUNDLE_NAME_ATTR, true ); Integer position = CompilerUtils.getInteger( ann, POSITION_ATTR, true ); if ( position == null ) { - position = Integer.valueOf( inferredPosition ); + position = new Integer( inferredPosition ); } if ( arg != null ) Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ValidatorRuleFactory.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ValidatorRuleFactory.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ValidatorRuleFactory.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ValidatorRuleFactory.java Mon Apr 11 23:42:11 2005 @@ -18,11 +18,11 @@ package org.apache.beehive.netui.compiler.genmodel; import org.apache.beehive.netui.compiler.model.validation.ValidatorRule; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; public interface ValidatorRuleFactory { - public ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationMirror ruleAnnotation ); + public ValidatorRule getFieldRule( String entityName, String propertyName, AnnotationInstance ruleAnnotation ); } Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/AbsolutePathType.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/AbsolutePathType.java?view=diff&r1=161024&r2=161025 ============================================================================== --- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/AbsolutePathType.java (original) +++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/AbsolutePathType.java Mon Apr 11 23:42:11 2005 @@ -20,7 +20,7 @@ import org.apache.beehive.netui.compiler.AnnotationGrammar; import org.apache.beehive.netui.compiler.AnnotationMemberType; import org.apache.beehive.netui.compiler.CompilerUtils; -import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationMirror; +import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration; import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; import org.apache.beehive.netui.compiler.typesystem.declaration.MemberDeclaration; @@ -34,10 +34,10 @@ public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue member, - AnnotationMirror[] parentAnnotations, MemberDeclaration classMember, + AnnotationInstance[] parentAnnotations, MemberDeclaration classMember, int annotationArrayIndex ) { - AnnotationMirror parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ]; + AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ]; String path = CompilerUtils.getString( parentAnnotation, PATH_ATTR, false ); if ( ! path.startsWith("/") ) addError( member, "error.absolute-path-required-for-external-redirect", null ); return null;
