Author: tchemit Date: 2008-08-11 09:51:33 +0000 (Mon, 11 Aug 2008) New Revision: 830 Modified: trunk/lutinjaxx/jaxx-swing-action/src/main/java/org/codelutin/jaxx/action/ActionAnnotationProcessing.java Log: javadoc Modified: trunk/lutinjaxx/jaxx-swing-action/src/main/java/org/codelutin/jaxx/action/ActionAnnotationProcessing.java =================================================================== --- trunk/lutinjaxx/jaxx-swing-action/src/main/java/org/codelutin/jaxx/action/ActionAnnotationProcessing.java 2008-08-11 08:43:07 UTC (rev 829) +++ trunk/lutinjaxx/jaxx-swing-action/src/main/java/org/codelutin/jaxx/action/ActionAnnotationProcessing.java 2008-08-11 09:51:33 UTC (rev 830) @@ -64,24 +64,31 @@ * @author chemit */ public class ActionAnnotationProcessing extends AbstractProcessor { - //protected ActionProviderAnnotation providerConfig; - + /** the {@link ActionProvider} service declaration relative path */ protected String providerDeclarationLocation = "META-INF/services/" + ActionProvider.class.getName(); + /** the relative path where to store actions mapping, will be complete with the name of base action to use */ protected String actionsFileLocation = ActionProviderFromProperties.actionsFileLocation; + /** verbose flag (can be activated by passing an annotation parameter to compiler via <code>-Ai18n.verbose</code>) */ protected boolean verbose; + /** the list of class processed by the processor */ protected java.util.List<String> processedClass; + /** the map of actions processed, keys are the action commaned and values are fqn of implementations */ protected Properties actions; + /** Extractor of values of annotations found */ protected AnnotationValueVisitor<Object, Void> annotationValueExtractor; + /** the type element of the base action to be used by {@link ActionProvider} */ protected TypeElement baseActionElement; + /** the fqn of the action provider to generate */ protected String providerFQN; + /** the fqn of the base action class to be used */ protected String baseFQN; @Override @@ -108,18 +115,16 @@ baseActionElement = (TypeElement) annotatedWith.iterator().next(); - //fixme CheckbaseActionElement is assigned from MyAbstractAction - //if (!baseActionElement.getSuperclass()) ... + //fixme it is not possible to know if baseActionElement is assigned from MyAbstractAction, since we + // can NOT garanted at this stage thaht the class was compiled... - //providerConfig = baseActionElement.getAnnotation(ActionProviderAnnotation.class); - baseFQN = baseActionElement.asType().toString(); - int index = baseFQN.lastIndexOf("."); - String baseSimpleName = baseFQN.substring(index + 1); - String packageName = baseFQN.substring(0, index + 1); + int index = baseFQN.lastIndexOf(".") + 1; + String baseSimpleName = baseFQN.substring(index); + String packageName = baseFQN.substring(0, index); providerFQN = packageName + baseSimpleName + "Provider"; - printInfo("providerFQN " + packageName + "," + baseSimpleName + "," + providerFQN); + printDebug("providerFQN " + providerFQN); actionsFileLocation = String.format(actionsFileLocation, baseSimpleName); continue; }