Trail:

Changeset 71

Show
Ignore:
Timestamp:
09/21/09 13:16:45 (2 years ago)
Author:
harald
Message:
  • update to velocity 1.6
  • add support for method level annotations
  • add support to map java annotations to target annotations
  • fix override handling
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk

    • Property svn:ignore changed from
      *.iml
      *.iws
      *.jar
      test
      sample
      to
      *.iws
      *.jar
      *.iml
  • trunk/asdoclet.ipr

    r66 r71  
    33  <component name="AntConfiguration"> 
    44    <defaultAnt bundledAnt="true" /> 
     5    <buildFile url="file://$PROJECT_DIR$/build.xml"> 
     6      <additionalClassPath /> 
     7      <antReference projectDefault="true" /> 
     8      <customJdkName value="" /> 
     9      <maximumHeapSize value="128" /> 
     10      <maximumStackSize value="32" /> 
     11      <properties /> 
     12    </buildFile> 
    513  </component> 
    614  <component name="BuildJarProjectSettings"> 
     
    290298    </modules> 
    291299  </component> 
    292   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK"> 
     300  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6.0.16" project-jdk-type="JavaSDK"> 
    293301    <output url="file://$PROJECT_DIR$/out" /> 
    294302  </component> 
     
    507515      </CLASSES> 
    508516      <JAVADOC /> 
    509       <SOURCES> 
    510         <root url="file://C:/Users/harald/Documents/Development/metaas/src/main/java" /> 
    511       </SOURCES> 
     517      <SOURCES /> 
    512518      <jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" /> 
    513519    </library> 
  • trunk/src/org/fluffnstuff/asdoclet/AsDoclet.java

    r64 r71  
    22 
    33import java.lang.annotation.Annotation; 
     4import java.util.Arrays; 
    45 
    56import org.fluffnstuff.asdoclet.generator.AsGenerator; 
     
    2627        private static final String PARAM_MAP = "-map"; 
    2728        private static final String PARAM_GENERIC_MAP = "-genericmap"; 
    28         private static final String PARAM_ANNOTATION_MAP = "-annotationmap"; 
     29        private static final String PARAM_ANNOTATION_MAP = "-annotation"; 
     30        private static final String PARAM_ANNOTATION_TYPE_MAP = "-annotationmap"; 
    2931 
    3032        public static boolean start(RootDoc root) throws Exception { 
     
    5557                ClassTypeMap typeMap = new ClassTypeMap(); 
    5658                TypeMap annotationMap = new TypeMap(); 
     59                TypeMap annotationTypeMap = new TypeMap(); 
    5760 
    5861                for (String[] opt : options) { 
    59                         if (opt[0].equals(PARAM_DESTINATION)) destination = opt[1]; 
    60                         if (opt[0].equals(PARAM_NAMESPACE)) namespace = opt[1]; 
    61                         if (opt[0].equals(PARAM_GENERATOR)) generator = opt[1]; 
    62                         if (opt[0].equals(PARAM_ENUM)) enumAnnotation = (Class<? extends Annotation>) Class.forName(opt[1]); 
    63                         if (opt[0].equals(PARAM_MAP)) { 
     62                        if (opt[0].equals(PARAM_DESTINATION)) { 
     63                                destination = opt[1]; 
     64                        } else if (opt[0].equals(PARAM_NAMESPACE)) { 
     65                                namespace = opt[1]; 
     66                        } else if (opt[0].equals(PARAM_GENERATOR)) { 
     67                                generator = opt[1]; 
     68                        } else if (opt[0].equals(PARAM_ENUM)) { 
     69                                enumAnnotation = (Class<? extends Annotation>) Class.forName(opt[1]); 
     70                        } else if (opt[0].equals(PARAM_MAP)) { 
    6471                                String[] strings = opt[1].split(":"); 
    6572                                if (strings.length == 2) typeMap.addTypeMapping(strings[0], strings[1]); 
    66                         } 
    67                         if (opt[0].equals(PARAM_GENERIC_MAP)) { 
     73                        } else if (opt[0].equals(PARAM_GENERIC_MAP)) { 
    6874                                String[] strings = opt[1].split(":"); 
    6975                                if (strings.length == 2) typeMap.addGenericTypeMapping(strings[0], strings[1]); 
    70                         } 
    71                         if (opt[0].equals(PARAM_ANNOTATION_MAP)) { 
     76                        } else if (opt[0].equals(PARAM_ANNOTATION_MAP)) { 
    7277                                String[] strings = opt[1].split(":"); 
    7378                                if (strings.length == 2) annotationMap.addTypeMapping(strings[0], strings[1]); 
     79                        } else if (opt[0].equals(PARAM_ANNOTATION_TYPE_MAP)) { 
     80                                String[] strings = opt[1].split(":"); 
     81                                if (strings.length == 2) annotationTypeMap.addTypeMapping(strings[0], strings[1]); 
    7482                        } 
    7583                } 
    7684 
    7785                if ("actionscript".equals(generator)) { 
    78                         return new AsGenerator(destination, namespace, enumAnnotation, typeMap, annotationMap); 
     86                        return new AsGenerator(destination, namespace, enumAnnotation, typeMap, annotationTypeMap, annotationMap); 
    7987                } else if ("cs".equals(generator)) { 
    80                         return new VelocityGenerator(destination, namespace, "cs", enumAnnotation, typeMap, annotationMap); 
     88                        return new VelocityGenerator(destination, namespace, "cs", enumAnnotation, typeMap, annotationTypeMap, annotationMap); 
    8189                } 
    8290                return null; 
     
    100108                int length = 0; 
    101109 
    102                 if (PARAM_DESTINATION.equals(option)) length = 2; 
    103                 if (PARAM_NAMESPACE.equals(option)) length = 2; 
    104                 if (PARAM_GENERATOR.equals(option)) length = 2; 
    105                 if (PARAM_ENUM.equals(option)) length = 2; 
    106                 if (PARAM_MAP.equals(option)) length = 2; 
    107                 if (PARAM_GENERIC_MAP.equals(option)) length = 2; 
    108                 if (PARAM_ANNOTATION_MAP.equals(option)) length = 2; 
     110                if (Arrays.asList( 
     111                                PARAM_DESTINATION, 
     112                                PARAM_NAMESPACE, 
     113                                PARAM_GENERATOR, 
     114                                PARAM_ENUM, 
     115                                PARAM_MAP, 
     116                                PARAM_GENERIC_MAP, 
     117                                PARAM_ANNOTATION_MAP, 
     118                                PARAM_ANNOTATION_TYPE_MAP 
     119                ).contains(option)) length = 2; 
    109120 
    110121                return length; 
  • trunk/src/org/fluffnstuff/asdoclet/generator/AsGenerator.java

    r68 r71  
    3939        private ASMethod proxyMethod; 
    4040 
     41        private final TypeMap annotationMap; 
     42        private final TypeMap annotationTypeMap; 
    4143        private final TypeMap typeMap; 
    42         private final TypeMap annotationMap; 
    4344        private final Class<? extends Annotation> enumAnnotation; 
    4445 
     
    4647        private Collection<String> proxyImports; 
    4748 
    48         public AsGenerator(String destination, String namespace, Class<? extends Annotation> enumAnnotation, TypeMap typeMap, TypeMap annotationMap) { 
     49        public AsGenerator(String destination, String namespace, Class<? extends Annotation> enumAnnotation, TypeMap typeMap, TypeMap annotationTypeMap, TypeMap annotationMap) { 
     50                this.enumAnnotation = enumAnnotation; 
    4951                this.typeMap = typeMap; 
     52                this.annotationTypeMap = annotationTypeMap; 
    5053                this.annotationMap = annotationMap; 
    51                 this.enumAnnotation = enumAnnotation; 
    5254 
    5355                project = factory.newEmptyASProject(destination); 
     
    5759 
    5860        private void initTypeMap() { 
     61                annotationMap.addTypeMapping("java.lang.Deprecated", "Deprecated"); 
     62 
    5963                typeMap.setEnumType("String"); 
    6064 
     
    8791        } 
    8892 
     93        @Override 
    8994        public TypeMap getAnnotationMap() { 
    9095                return annotationMap; 
    9196        } 
    9297 
     98        @Override 
     99        public TypeMap getAnnotationTypeMap() { 
     100                return annotationTypeMap; 
     101        } 
     102 
     103        @Override 
    93104        public Class<? extends Annotation> getEnumAnnotation() { 
    94105                return enumAnnotation; 
    95106        } 
    96107 
     108        @Override 
    97109        public TypeMap getTypeMap() { 
    98110                return typeMap; 
     
    101113// --------------------- Interface Generator --------------------- 
    102114 
     115        @Override 
     116        public void addAnnotation(Type tag) { 
     117                if (method != null) { 
     118                        method.newMetaTag(tag.getName()); 
     119                } else { 
     120                        type.newMetaTag(tag.getName()); 
     121                } 
     122        } 
     123 
     124        @Override 
    103125        public void addBody(String body) { 
    104126        } 
    105127 
     128        @Override 
    106129        public void addConstant(Type classType, Type constantType, String name, String initializer, String comment) { 
    107130                createConst((ASClassType) type, name, initializer, constantType.getName(), comment); 
    108131        } 
    109132 
     133        @Override 
    110134        public void addEnumField(Type classType, Type fieldType, String name, Object value, String comment) { 
    111135                if (value == null) value = name; 
     
    114138        } 
    115139 
     140        @Override 
    116141        public void addField(Type classType, int modifier, Type fieldType, String fieldName, Object value, String comment) { 
    117142                fieldType = resolveTypeArguments(classType, null, fieldType); 
     
    121146        } 
    122147 
    123         public void addGetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override) { 
     148        @Override 
     149        public void beginGetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override) { 
    124150                fieldType = resolveTypeArguments(classType, methodType, fieldType); 
    125151 
    126152                if (type instanceof ASClassType) { 
    127153                        addField(classType, Modifier.PRIVATE, fieldType, "_" + propertyName, null, null); 
    128                         beginMethod(classType, Type.EMPTY, modifier, fieldType, "get " + propertyName, false); 
    129                         method.setOverride(override); 
     154                        beginMethod(classType, Type.EMPTY, modifier, fieldType, "get " + propertyName, false, override); 
    130155                        method.addStmt("return _" + propertyName + ";"); 
    131156                } else { 
    132                         beginMethod(classType, Type.EMPTY, modifier, fieldType, "get " + propertyName, false); 
     157                        beginMethod(classType, Type.EMPTY, modifier, fieldType, "get " + propertyName, false, override); 
    133158                } 
    134159 
     
    136161        } 
    137162 
     163        @Override 
    138164        public void addInterface(Type name) { 
    139165                if (type instanceof ASInterfaceType) { 
     
    147173        } 
    148174 
     175        @Override 
    149176        public void addParameter(Type classType, Type methodType, Type type, String name) { 
    150177                type = resolveTypeArguments(classType, methodType, type); 
     
    156183        } 
    157184 
    158         public void addSetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override) { 
     185        @Override 
     186        public void beginSetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override) { 
    159187                fieldType = resolveTypeArguments(classType, methodType, fieldType); 
    160188 
    161189                if (type instanceof ASClassType) { 
    162190                        addField(classType, Modifier.PRIVATE, fieldType, "_" + propertyName, null, null); 
    163                         beginMethod(classType, Type.EMPTY, modifier, Type.VOID, "set " + propertyName, false); 
    164                         method.setOverride(override); 
     191                        beginMethod(classType, Type.EMPTY, modifier, Type.VOID, "set " + propertyName, false, override); 
    165192                        method.addParam("value", fieldType.getName()); 
    166193                        method.addStmt("_" + propertyName + "=value;"); 
    167194                } else { 
    168                         beginMethod(classType, Type.EMPTY, modifier, Type.VOID, "set " + propertyName, false); 
     195                        beginMethod(classType, Type.EMPTY, modifier, Type.VOID, "set " + propertyName, false, override); 
    169196                        method.addParam("value", fieldType.getName()); 
    170197                } 
     
    173200        } 
    174201 
    175         public void addTypeAnnotation(Type tag) { 
    176                 type.newMetaTag(tag.getName()); 
    177         } 
    178  
     202        @Override 
    179203        public void beginClass(Type classType) { 
    180204                System.out.println("Creating ActionScript class " + classType); 
    181205 
    182206                newClass(classType, false); 
    183                 addTypeAnnotation(GeneratorUtils.getType("RemoteClass(alias=\"" + classType.getName() + "\")", this)); 
    184         } 
    185  
     207                addAnnotation(GeneratorUtils.getType("RemoteClass(alias=\"" + classType.getName() + "\")", this)); 
     208        } 
     209 
     210        @Override 
    186211        public void beginEnum(Type name) { 
    187212                System.out.println("Creating ActionScript enumeration " + name); 
     
    190215        } 
    191216 
     217        @Override 
    192218        public void beginInterface(Type name) { 
    193219                System.out.println("Creating ActionScript interface " + name); 
     
    198224        } 
    199225 
    200         public void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean asnyc) { 
     226        @Override 
     227        public void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean asnyc, boolean override) { 
    201228                returnType = resolveTypeArguments(classType, methodType, returnType); 
    202229 
    203230                if (unit != null) { 
    204231                        method = type.newMethod(methodName, getVisibility(modifier), returnType.getName()); 
     232                        method.setOverride(override); 
    205233                } 
    206234 
     
    215243        } 
    216244 
     245        @Override 
    217246        public void beginProxy(Type proxy, Type baseType, Type interfaceType) { 
    218247                System.out.println("Creating ActionScript proxy " + proxy.getName()); 
     
    246275        } 
    247276 
     277        @Override 
    248278        public void endClass() { 
    249279                end(); 
    250280        } 
    251281 
     282        @Override 
    252283        public void endEnum() { 
    253284                end(); 
    254285        } 
    255286 
     287        @Override 
     288        public void endGetter() { 
     289                endMethod(Type.EMPTY); 
     290        } 
     291 
     292        @Override 
    256293        public void endInterface() { 
    257294                end(); 
    258295        } 
    259296 
     297        @Override 
    260298        public void endMethod(Type asyncType) { 
    261299                if (proxyUnit != null) { 
     
    279317        } 
    280318 
     319        @Override 
    281320        public void endProxy() { 
    282321                for (String imp : proxyImports) proxyUnit.getPackage().addImport(imp); 
     
    285324        } 
    286325 
     326        @Override 
     327        public void endSetter() { 
     328                endMethod(Type.EMPTY); 
     329        } 
     330 
     331        @Override 
    287332        public void generate() throws IOException { 
    288333                //project.performAutoImport(); // todo this is buggy 
     
    290335        } 
    291336 
     337        @Override 
    292338        public String getName() { 
    293339                return "actionscript"; 
    294340        } 
    295341 
     342        @Override 
    296343        public boolean hasEnumSupport() { 
    297344                return false; 
    298345        } 
    299346 
     347        @Override 
    300348        public boolean isDebug() { 
    301349                return false; 
    302350        } 
    303351 
     352        @Override 
    304353        public Type postProcessType(Type type) { 
    305354                if (type.getDimensions() > 0) return GeneratorUtils.getType(Collection.class.getCanonicalName(), this); 
     
    307356        } 
    308357 
     358        @Override 
    309359        public void setMethodDescription(String description) { 
    310360                if (unit != null && !StringUtils.isEmpty(description)) method.setDescription(description.trim()); 
    311361        } 
    312362 
     363        @Override 
    313364        public void setSuperclass(Type name, boolean exception) { 
    314365                ((ASClassType) type).setSuperclass(name.getName()); 
     
    316367        } 
    317368 
     369        @Override 
    318370        public void setTypeDescription(String description) { 
    319371                if (!StringUtils.isEmpty(description)) type.setDescription(description.trim()); 
  • trunk/src/org/fluffnstuff/asdoclet/generator/Generator.java

    r68 r71  
    66 
    77public interface Generator { 
     8        void addAnnotation(Type annotation); 
     9 
    810        void addBody(String body); 
    911 
     
    1416        void addField(Type classType, int modifier, Type fieldType, String fieldName, Object value, String comment); 
    1517 
    16         void addGetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override); 
     18        void beginGetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override); 
    1719 
    1820        void addInterface(Type type); 
     
    2022        void addParameter(Type classType, Type methodType, Type type, String name); 
    2123 
    22         void addSetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override); 
    23  
    24         void addTypeAnnotation(Type annotation); 
     24        void beginSetter(Type classType, Type methodType, int modifier, Type fieldType, String propertyName, String comment, boolean override); 
    2525 
    2626        void beginClass(Type type); 
     
    3030        void beginInterface(Type type); 
    3131 
    32         void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean async); 
     32        void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean asnyc, boolean override); 
    3333 
    3434        void beginProxy(Type type, Type baseType, Type interfaceType); 
     
    3838        void endEnum(); 
    3939 
     40        void endGetter(); 
     41 
    4042        void endInterface(); 
    4143 
     
    4446        void endProxy(); 
    4547 
     48        void endSetter(); 
     49 
    4650        void generate() throws Exception; 
    4751 
    4852        TypeMap getAnnotationMap(); 
     53 
     54        TypeMap getAnnotationTypeMap(); 
    4955 
    5056        Class<? extends Annotation> getEnumAnnotation(); 
  • trunk/src/org/fluffnstuff/asdoclet/generator/VelocityGenerator.java

    r68 r71  
    88import java.util.ArrayList; 
    99import java.util.Collection; 
    10 import java.util.Map; 
    1110 
    1211import org.apache.commons.lang.StringUtils; 
     
    3635        private FieldDescriptor fieldDescriptor; 
    3736        private MethodDescriptor methodDescriptor; 
     37        private PropertyDescriptor propertyDescriptor; 
    3838 
    3939        private final File destination; 
     
    4242 
    4343        private final TypeMap annotationMap; 
     44        private final TypeMap annotationTypeMap; 
    4445        private final TypeMap typeMap; 
    4546        private final Class<? extends Annotation> enumAnnotation; 
    4647 
    47         public VelocityGenerator(String destination, String namespace, String language, Class<? extends Annotation> enumAnnotation, TypeMap typeMap, TypeMap annotationMap) throws Exception { 
     48        public VelocityGenerator(String destination, String namespace, String language, Class<? extends Annotation> enumAnnotation, TypeMap typeMap, TypeMap annotationTypeMap, TypeMap annotationMap) throws Exception { 
    4849                this.destination = new File(destination); 
    4950                this.namespace = namespace; 
    5051                this.language = language; 
    5152 
     53                this.enumAnnotation = enumAnnotation; 
    5254                this.typeMap = typeMap; 
     55                this.annotationTypeMap = annotationTypeMap; 
    5356                this.annotationMap = annotationMap; 
    54                 this.enumAnnotation = enumAnnotation; 
    5557 
    5658                Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.fluffnstuff.asdoclet.generator.velocity.SLF4JLogChute"); 
     
    6971 
    7072        private void initCsTypeMap() { 
     73                annotationMap.addTypeMapping("java.lang.Deprecated", "System.Obsolete"); 
     74 
    7175                typeMap.addTypeMapping("boolean", "bool"); 
    7276 
     
    97101        } 
    98102 
     103        @Override 
    99104        public TypeMap getAnnotationMap() { 
    100105                return annotationMap; 
    101106        } 
    102107 
     108        @Override 
     109        public TypeMap getAnnotationTypeMap() { 
     110                return annotationTypeMap; 
     111        } 
     112 
     113        @Override 
    103114        public Class<? extends Annotation> getEnumAnnotation() { 
    104115                return enumAnnotation; 
    105116        } 
    106117 
     118        @Override 
    107119        public TypeMap getTypeMap() { 
    108120                return typeMap; 
     
    111123// --------------------- Interface Generator --------------------- 
    112124 
     125        @Override 
     126        public void addAnnotation(Type annotation) { 
     127                if (methodDescriptor != null) { 
     128                        methodDescriptor.addAnnotation(annotation); 
     129                } else if (propertyDescriptor != null) { 
     130                        propertyDescriptor.addAnnotation(annotation); 
     131                } else { 
     132                        typeDescriptor.addAnnotation(annotation); 
     133                } 
     134        } 
     135 
     136        @Override 
    113137        public void addBody(String body) { 
    114138                methodDescriptor.addBody(body); 
    115139        } 
    116140 
     141        @Override 
    117142        public void addConstant(Type classType, Type constantType, String name, String initializer, String comment) { 
    118143                addField(classType, Modifier.STATIC, constantType, name, initializer, comment); 
    119144        } 
    120145 
     146        @Override 
    121147        public void addEnumField(Type classType, Type fieldType, String name, Object value, String comment) { 
    122148                addField(classType, 0, fieldType, name, value, comment); 
    123149        } 
    124150 
     151        @Override 
    125152        public void addField(Type classType, int modifier, Type fieldType, String propertyName, Object value, String comment) { 
    126153                fieldDescriptor = new FieldDescriptor(modifier, fieldType, propertyName, value); 
     
    130157        } 
    131158 
    132         public void addGetter(Type classType, Type methodType, int modifier, Type returnType, String propertyName, String description, boolean override) { 
    133                 PropertyDescriptor propertyDescriptor = new PropertyDescriptor(modifier, returnType, methodType, propertyName); 
     159        @Override 
     160        public void beginGetter(Type classType, Type methodType, int modifier, Type returnType, String propertyName, String description, boolean override) { 
     161                propertyDescriptor = new PropertyDescriptor(modifier, returnType, methodType, propertyName); 
    134162                propertyDescriptor.setGetter(true); 
    135                 propertyDescriptor.setOverride(propertyDescriptor.isOverride() || override); 
     163                propertyDescriptor.setOverride(override); 
    136164                propertyDescriptor.setDescription(description); 
    137165                typeDescriptor.addPropertyDescriptor(propertyDescriptor); 
     
    142170        } 
    143171 
     172        @Override 
    144173        public void addInterface(Type name) { 
    145174                typeDescriptor.addInterface(name); 
    146175        } 
    147176 
     177        @Override 
    148178        public void addParameter(Type classType, Type methodType, Type type, String name) { 
    149179                ParameterDescriptor parameterDescriptor = new ParameterDescriptor(type, name); 
     
    151181        } 
    152182 
    153         public void addSetter(Type classType, Type methodType, int modifier, Type returnType, String propertyName, String description, boolean override) { 
    154                 PropertyDescriptor propertyDescriptor = new PropertyDescriptor(modifier, returnType, methodType, propertyName); 
     183        @Override 
     184        public void beginSetter(Type classType, Type methodType, int modifier, Type returnType, String propertyName, String description, boolean override) { 
     185                propertyDescriptor = new PropertyDescriptor(modifier, returnType, methodType, propertyName); 
    155186                propertyDescriptor.setSetter(true); 
    156                 propertyDescriptor.setOverride(propertyDescriptor.isOverride() || override); 
     187                propertyDescriptor.setOverride(override); 
    157188                propertyDescriptor.setDescription(description); 
    158189                typeDescriptor.addPropertyDescriptor(propertyDescriptor); 
     
    163194        } 
    164195 
    165         public void addTypeAnnotation(Type annotation) { 
    166                 typeDescriptor.addAnnotation(annotation); 
    167         } 
    168  
     196        @Override 
    169197        public void beginClass(Type type) { 
    170198                beginType(new ClassDescriptor(type)); 
    171199        } 
    172200 
     201        @Override 
    173202        public void beginEnum(Type type) { 
    174203                beginType(new EnumDescriptor(type)); 
    175204        } 
    176205 
     206        @Override 
    177207        public void beginInterface(Type type) { 
    178208                beginType(new InterfaceDescriptor(type)); 
    179209        } 
    180210 
    181         public void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean async) { 
    182                 methodDescriptor = new MethodDescriptor(modifier, returnType, methodType, methodName, async); 
     211        @Override 
     212        public void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean asnyc, boolean override) { 
     213                methodDescriptor = new MethodDescriptor(modifier, returnType, methodType, methodName, asnyc); 
     214                methodDescriptor.setOverride(override); 
    183215                if (typeDescriptor != null) typeDescriptor.addMethodDescriptor(methodDescriptor); 
    184216                if (proxyTypeDescriptor != null) proxyTypeDescriptor.addMethodDescriptor(methodDescriptor); 
    185217        } 
    186218 
     219        @Override 
    187220        public void beginProxy(Type proxy, Type baseType, Type interfaceType) { 
    188221                proxyTypeDescriptor = new ProxyDescriptor(proxy); 
     
    194227        } 
    195228 
     229        @Override 
    196230        public void endClass() { 
    197231                typeDescriptor = null; 
    198232        } 
    199233 
     234        @Override 
    200235        public void endEnum() { 
    201236                typeDescriptor = null; 
    202237        } 
    203238 
     239        @Override 
     240        public void endGetter() { 
     241                propertyDescriptor = null; 
     242        } 
     243 
     244        @Override 
    204245        public void endInterface() { 
    205246                typeDescriptor = null; 
    206247        } 
    207248 
     249        @Override 
    208250        public void endMethod(Type callbackType) { 
    209251                if (callbackType != org.fluffnstuff.asdoclet.generator.Type.EMPTY) { 
     
    214256        } 
    215257 
     258        @Override 
    216259        public void endProxy() { 
    217260                proxyTypeDescriptor = null; 
    218261        } 
    219262 
     263        @Override 
     264        public void endSetter() { 
     265                propertyDescriptor = null; 
     266        } 
     267 
     268        @Override 
    220269        public void generate() throws Exception { 
    221270                for (TypeDescriptor descriptor : typeDescriptors) { 
    222271                        String ns = descriptor.getNameSpace(); 
    223272 
    224                         if (ns.indexOf(namespace) == 0) { 
     273                        if (namespace != null && ns.indexOf(namespace) == 0) { 
    225274                                ns = ns.substring(namespace.length()); 
    226275                                if (ns.startsWith(".")) ns = ns.substring(1); 
     
    244293        } 
    245294 
     295        @Override 
    246296        public String getName() { 
    247297                return language; 
    248298        } 
    249299 
     300        @Override 
    250301        public boolean hasEnumSupport() { 
    251302                return true; 
    252303        } 
    253304 
     305        @Override 
    254306        public boolean isDebug() { 
    255307                return false; 
    256308        } 
    257309 
     310        @Override 
    258311        public Type postProcessType(Type type) { 
    259312                return type; 
    260313        } 
    261314 
     315        @Override 
    262316        public void setMethodDescription(String description) { 
    263317                if (!StringUtils.isEmpty(description)) methodDescriptor.setDescription(description.trim()); 
    264318        } 
    265319 
     320        @Override 
    266321        public void setSuperclass(Type type, boolean exception) { 
    267322                ((ClassDescriptor) typeDescriptor).setSuperclass(type); 
    268323 
    269324                if (exception && CSHARP.equals(language)) { 
    270                         beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false); 
     325                        beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false, false); 
    271326                        addBody(" : base() {}"); 
    272327                        endMethod(Type.EMPTY); 
    273328 
    274                         beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false); 
     329                        beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false, false); 
    275330                        addParameter(type, Type.EMPTY, GeneratorUtils.getType(String.class.getCanonicalName(), this), "message"); 
    276331                        addBody(" : base(message) {}"); 
    277332                        endMethod(Type.EMPTY); 
    278333 
    279                         beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false); 
     334                        beginMethod(type, Type.EMPTY, Modifier.PUBLIC, Type.EMPTY, typeDescriptor.getTypeName(), false, false); 
    280335                        addParameter(type, Type.EMPTY, GeneratorUtils.getType(String.class.getCanonicalName(), this), "message"); 
    281336                        addParameter(type, Type.EMPTY, GeneratorUtils.getType(Exception.class.getCanonicalName(), this), "exception"); 
     
    285340        } 
    286341 
     342        @Override 
    287343        public void setTypeDescription(String description) { 
    288344                if (!StringUtils.isEmpty(description)) typeDescriptor.setDescription(description.trim()); 
     
    294350        } 
    295351 
    296         public void setBounds(Map<String, Type> bounds) { 
    297                 if (proxyTypeDescriptor != null) proxyTypeDescriptor.getBounds().putAll(bounds); 
    298         } 
    299  
    300352        private void setFieldDescription(String description) { 
    301353                if (!StringUtils.isEmpty(description)) fieldDescriptor.setDescription(description.trim()); 
  • trunk/src/org/fluffnstuff/asdoclet/generator/utils/GeneratorUtils.java

    r64 r71  
    11package org.fluffnstuff.asdoclet.generator.utils; 
    22 
     3import java.lang.annotation.Annotation; 
    34import java.text.MessageFormat; 
    45import java.util.ArrayList; 
     
    89import java.util.HashSet; 
    910import java.util.Map; 
    10 import java.lang.annotation.Annotation; 
    1111 
    1212import org.fluffnstuff.asdoclet.generator.Generator; 
    1313import org.fluffnstuff.asdoclet.map.TypeMap; 
    1414 
     15import com.sun.javadoc.AnnotationDesc; 
    1516import com.sun.javadoc.ClassDoc; 
    1617import com.sun.javadoc.MethodDoc; 
     
    1920import com.sun.javadoc.TypeVariable; 
    2021import com.sun.javadoc.WildcardType; 
    21 import com.sun.javadoc.AnnotationDesc; 
    2222 
    2323public final class GeneratorUtils { 
    2424        private static Map<String, org.fluffnstuff.asdoclet.generator.Type> enumerationTypes = new HashMap<String, org.fluffnstuff.asdoclet.generator.Type>(); 
    25  
    26         private static org.fluffnstuff.asdoclet.generator.Type getEnumerationType(Type enumerationType, Generator generator) { 
    27                 Class<? extends Annotation> enumAnnotation = generator.getEnumAnnotation(); 
    28                 ClassDoc classDoc = enumerationType.asClassDoc(); 
    29                 String typeName = enumerationType.qualifiedTypeName(); 
    30  
    31                 if (generator.hasEnumSupport()) return org.fluffnstuff.asdoclet.generator.Type.EMPTY; 
    32                 if (enumerationTypes.containsKey(typeName)) return enumerationTypes.get(typeName); 
    33  
    34                 if (classDoc != null && enumAnnotation != null) { 
    35                         for (MethodDoc methodDoc : classDoc.methods()) { 
    36                                 for (AnnotationDesc annotationDesc : methodDoc.annotations()) { 
    37                                         if (annotationDesc.annotationType().qualifiedTypeName().equals(enumAnnotation.getCanonicalName())) { 
    38                                                 org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(methodDoc.returnType(), generator); 
    39                                                 enumerationTypes.put(typeName, type); 
    40                                                 return type; 
    41                                         } 
    42                                 } 
    43                         } 
    44  
    45                         enumerationTypes.put(typeName, org.fluffnstuff.asdoclet.generator.Type.EMPTY); 
    46                 } 
    47  
    48                 return org.fluffnstuff.asdoclet.generator.Type.EMPTY; 
    49         } 
    5025 
    5126        public static org.fluffnstuff.asdoclet.generator.Type getType(MethodDoc doc, Generator generator) { 
     
    11388        } 
    11489 
     90        private static org.fluffnstuff.asdoclet.generator.Type getEnumerationType(Type enumerationType, Generator generator) { 
     91                Class<? extends Annotation> enumAnnotation = generator.getEnumAnnotation(); 
     92                ClassDoc classDoc = enumerationType.asClassDoc(); 
     93                String typeName = enumerationType.qualifiedTypeName(); 
     94 
     95                if (generator.hasEnumSupport()) return org.fluffnstuff.asdoclet.generator.Type.EMPTY; 
     96                if (enumerationTypes.containsKey(typeName)) return enumerationTypes.get(typeName); 
     97 
     98                if (classDoc != null && enumAnnotation != null) { 
     99                        for (MethodDoc methodDoc : classDoc.methods()) { 
     100                                for (AnnotationDesc annotationDesc : methodDoc.annotations()) { 
     101                                        if (annotationDesc.annotationType().qualifiedTypeName().equals(enumAnnotation.getCanonicalName())) { 
     102                                                org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(methodDoc.returnType(), generator); 
     103                                                enumerationTypes.put(typeName, type); 
     104                                                return type; 
     105                                        } 
     106                                } 
     107                        } 
     108 
     109                        enumerationTypes.put(typeName, org.fluffnstuff.asdoclet.generator.Type.EMPTY); 
     110                } 
     111 
     112                return org.fluffnstuff.asdoclet.generator.Type.EMPTY; 
     113        } 
     114 
     115        public static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator) { 
     116                return getType(type, generator, new HashSet<String>()); 
     117        } 
     118 
    115119        public static boolean isEnum(Type type) { 
    116120                return type.asClassDoc() != null && type.asClassDoc().isEnum(); 
     
    150154        } 
    151155 
    152         public static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator) { 
    153                 return getType(type, generator, new HashSet<String>()); 
    154         } 
    155  
    156156        public static org.fluffnstuff.asdoclet.generator.Type getType(String name, Generator generator) { 
    157157                if (name == null) return org.fluffnstuff.asdoclet.generator.Type.NULL; 
    158158                return getType(name, generator, generator.getTypeMap()); 
     159        } 
     160 
     161        public static org.fluffnstuff.asdoclet.generator.Type getAnnotationType(String name, Generator generator) { 
     162                return getType(name, generator, generator.getAnnotationTypeMap()); 
    159163        } 
    160164 
  • trunk/src/org/fluffnstuff/asdoclet/generator/velocity/MethodDescriptor.java

    r68 r71  
    99        private Collection<ParameterDescriptor> parameterDescriptors = new ArrayList<ParameterDescriptor>(); 
    1010        private boolean async; 
     11        private boolean override; 
    1112        private String body; 
    1213        private Type genericType; 
     
    4344        } 
    4445 
     46        public boolean isOverride() { 
     47                return override; 
     48        } 
     49 
     50        public void setOverride(boolean override) { 
     51                this.override = override; 
     52        } 
     53 
    4554        public void addBody(String body) { 
    4655                this.body = body; 
  • trunk/src/org/fluffnstuff/asdoclet/handler/AbstractHandler.java

    r64 r71  
    33import java.beans.Introspector; 
    44import java.lang.reflect.Modifier; 
    5 import java.lang.reflect.Method; 
    6 import java.lang.annotation.Annotation; 
    75import java.util.HashMap; 
    86import java.util.HashSet; 
     
    4846        } 
    4947 
    50         protected Set<String> getIgnore(Map<String, String> commands) { 
    51                 Set<String> ignore = new HashSet<String>(); 
    52                 StringTokenizer tokenizer = new StringTokenizer(TagParser.getStringCommand(Constants.COMMAND_IGNORE, "", commands), ",;"); 
    53                 while (tokenizer.hasMoreTokens()) ignore.add(tokenizer.nextToken()); 
    54                 return ignore; 
    55         } 
    56  
    57         protected void processAnnotations(Map<String, String> commands) { 
    58                 if (commands.containsKey(Constants.COMMAND_ANNOTATION)) { 
    59                         StringTokenizer tokenizer = new StringTokenizer(commands.get(Constants.COMMAND_ANNOTATION), ","); 
    60                         while (tokenizer.hasMoreTokens()) { 
    61                                 getGenerator().addTypeAnnotation(GeneratorUtils.getType(tokenizer.nextToken(), getGenerator())); 
    62                         } 
    63                 } 
    64         } 
    65  
    6648        protected void processBeanProperty(ClassDoc classDoc, org.fluffnstuff.asdoclet.generator.Type classType, MethodDoc methodDoc, Set<String> ignore, Map<String, String> commands) { 
    67                 Map<String, String> methodCommands = new HashMap<String, String>(commands); 
    68                 TagParser.processTags(methodDoc.tags(getGenerator().getName() + Constants.TAG_PROPERTY), methodCommands); 
    69  
    70                 if (!TagParser.getBooleanCommand(Constants.COMMAND_IGNORE, methodCommands)) { 
     49                Map<String, String> propertyCommands = new HashMap<String, String>(commands); 
     50                Map<String, String> propertyOnlyCommands = new HashMap<String, String>(); 
     51 
     52                TagParser.processTags(methodDoc.tags(getGenerator().getName() + Constants.TAG_PROPERTY), propertyOnlyCommands); 
     53                propertyCommands.putAll(propertyOnlyCommands); 
     54 
     55                if (!TagParser.getBooleanCommand(Constants.COMMAND_IGNORE, propertyCommands)) { 
    7156                        String propertyName = getBeanPropertyName(methodDoc); 
    7257                        if (propertyName != null) { 
    73                                 String overriddenType = TagParser.getStringCommand(Constants.COMMAND_TYPE, methodCommands); 
     58                                String overriddenType = TagParser.getStringCommand(Constants.COMMAND_TYPE, propertyCommands); 
    7459 
    7560                                org.fluffnstuff.asdoclet.generator.Type fieldType = getFieldType(methodDoc, findField(classDoc, propertyName), overriddenType); 
     
    8772                                        String setterName = "set" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1); 
    8873 
    89  
    9074                                        if (classDoc.isInterface()) { 
    91                                                 getGenerator().addGetter(classType, methodType, 0, fieldType, propertyName, comment, false); 
    92                                                 if (findMethod(setterName, classDoc)) getGenerator().addSetter(classType, methodType, 0, fieldType, propertyName, comment, false); 
     75                                                getGenerator().beginGetter(classType, methodType, 0, fieldType, propertyName, comment, false); 
     76                                                processAnnotations(methodDoc.annotations()); 
     77                                                processAnnotationCommands(propertyOnlyCommands); 
     78                                                getGenerator().endGetter(); 
     79 
     80                                                if (findMethod(setterName, classDoc)) { 
     81                                                        getGenerator().beginSetter(classType, methodType, 0, fieldType, propertyName, comment, false); 
     82                                                        processAnnotations(methodDoc.annotations()); 
     83                                                        processAnnotationCommands(propertyOnlyCommands); 
     84                                                        getGenerator().endSetter(); 
     85                                                } 
    9386                                        } else { 
    9487                                                boolean overridden = isOverridden(classDoc, name, ignore); 
    95                                                 getGenerator().addGetter(classType, methodType, Modifier.PUBLIC, fieldType, propertyName, comment, overridden); 
     88 
     89                                                getGenerator().beginGetter(classType, methodType, Modifier.PUBLIC, fieldType, propertyName, comment, overridden); 
     90                                                processAnnotations(methodDoc.annotations()); 
     91                                                processAnnotationCommands(propertyOnlyCommands); 
     92                                                getGenerator().endGetter(); 
     93 
    9694                                                // always generate setter, serialization doesn't work otherwise 
    97                                                 getGenerator().addSetter(classType, methodType, Modifier.PUBLIC, fieldType, propertyName, comment, overridden); 
     95                                                getGenerator().beginSetter(classType, methodType, Modifier.PUBLIC, fieldType, propertyName, comment, overridden); 
     96                                                processAnnotations(methodDoc.annotations()); 
     97                                                processAnnotationCommands(propertyOnlyCommands); 
     98                                                getGenerator().endSetter(); 
    9899                                        } 
    99100                                } 
     
    133134                for (AnnotationDesc annotationDesc : annotationDescs) { 
    134135                        AnnotationTypeDoc annotationTypeDoc = annotationDesc.annotationType(); 
    135                         fieldType = GeneratorUtils.getAnnotation(annotationTypeDoc.qualifiedTypeName(), getGenerator()); 
     136                        fieldType = GeneratorUtils.getAnnotationType(annotationTypeDoc.qualifiedTypeName(), getGenerator()); 
    136137                        if (fieldType != null) break; 
    137138                } 
     
    161162        } 
    162163 
    163         private boolean isOverridden(ClassDoc classDoc, String name, Set<String> ignore) { 
    164                 for (ClassDoc superClass = classDoc.superclass(); superClass != null; superClass = superClass.superclass()) { 
    165                         if (ignore.contains(superClass.qualifiedTypeName() + "." + name)) return false; 
    166                         if (ignore.contains(superClass.qualifiedTypeName())) return false; 
    167                         if (findMethod(name, superClass)) return true; 
     164        protected boolean isOverridden(ClassDoc classDoc, String name, Set<String> ignore) { 
     165                if (classDoc.isInterface()) { 
     166                        for (ClassDoc interfaceDoc : classDoc.interfaces()) { 
     167                                if (ignore.contains(interfaceDoc.qualifiedTypeName() + "." + name)) return false; 
     168                                if (ignore.contains(interfaceDoc.qualifiedTypeName())) return false; 
     169                                if (findMethod(name, interfaceDoc)) return true; 
     170 
     171                                Map<String, String> commands = TagParser.processClassTags(getGenerator(), interfaceDoc); 
     172                                Set<String> interfaceIgnore = getIgnore(commands); 
     173                                interfaceIgnore.addAll(ignore); 
     174 
     175                                if (isOverridden(interfaceDoc, name, interfaceIgnore)) return true; 
     176                        } 
     177                } else { 
     178                        for (ClassDoc superClass = classDoc.superclass(); superClass != null; superClass = superClass.superclass()) { 
     179                                if (ignore.contains(superClass.qualifiedTypeName() + "." + name)) return false; 
     180                                if (ignore.contains(superClass.qualifiedTypeName())) return false; 
     181                                if (findMethod(name, superClass)) return true; 
     182 
     183                                Map<String, String> commands = TagParser.processClassTags(getGenerator(), superClass); 
     184                                ignore.addAll(getIgnore(commands)); 
     185                        } 
    168186                } 
    169187                return false; 
     188        } 
     189 
     190        protected Set<String> getIgnore(Map<String, String> commands) { 
     191                Set<String> ignore = new HashSet<String>(); 
     192                StringTokenizer tokenizer = new StringTokenizer(TagParser.getStringCommand(Constants.COMMAND_IGNORE, "", commands), ",;"); 
     193                while (tokenizer.hasMoreTokens()) ignore.add(tokenizer.nextToken()); 
     194                return ignore; 
     195        } 
     196 
     197        protected void processAnnotations(AnnotationDesc[] annotationDescs) { 
     198                for (AnnotationDesc annotationDesc : annotationDescs) { 
     199                        org.fluffnstuff.asdoclet.generator.Type annotation = GeneratorUtils.getAnnotation(annotationDesc.annotationType().qualifiedTypeName(), getGenerator()); 
     200                        if (annotation != null && annotation != org.fluffnstuff.asdoclet.generator.Type.NULL) getGenerator().addAnnotation(annotation); 
     201                } 
     202        } 
     203 
     204        protected void processAnnotationCommands(Map<String, String> commands) { 
     205                if (commands.containsKey(Constants.COMMAND_ANNOTATION)) { 
     206                        StringTokenizer tokenizer = new StringTokenizer(commands.get(Constants.COMMAND_ANNOTATION), ","); 
     207                        while (tokenizer.hasMoreTokens()) { 
     208                                getGenerator().addAnnotation(GeneratorUtils.getType(tokenizer.nextToken(), getGenerator())); 
     209                        } 
     210                } 
    170211        } 
    171212 
  • trunk/src/org/fluffnstuff/asdoclet/handler/ClassHandler.java

    r58 r71  
    33import java.util.Map; 
    44import java.util.Set; 
    5 import java.util.StringTokenizer; 
    6 import java.util.HashSet; 
    75 
    86import org.fluffnstuff.asdoclet.generator.Generator; 
     
    3028                getGenerator().beginClass(type); 
    3129 
    32                 processAnnotations(commands); 
     30                processAnnotations(classDoc.annotations()); 
     31                processAnnotationCommands(commands); 
    3332                processSuperClass(classDoc, ignore); 
    3433                processInterfaces(classDoc, ignore); 
  • trunk/src/org/fluffnstuff/asdoclet/handler/EnumHandler.java

    r64 r71  
    88import org.fluffnstuff.asdoclet.generator.Type; 
    99import org.fluffnstuff.asdoclet.generator.utils.GeneratorUtils; 
     10import org.fluffnstuff.asdoclet.AsDoclet; 
     11import org.slf4j.Logger; 
     12import org.slf4j.LoggerFactory; 
    1013 
    1114import com.sun.javadoc.ClassDoc; 
     
    1316 
    1417public class EnumHandler extends AbstractHandler { 
     18        private final Logger logger = LoggerFactory.getLogger(EnumHandler.class); 
     19 
    1520        public EnumHandler(Generator generator) { 
    1621                super(generator); 
     
    5055                Method getter = null; 
    5156                if (annotation != null) { 
    52                         Class<?> clazz = Class.forName(classDoc.qualifiedName()); 
     57                        try { 
     58                                Class<?> clazz = Class.forName(classDoc.qualifiedName()); 
    5359 
    54                         boolean present = false; 
    55                         for (Method method : clazz.getMethods()) { 
    56                                 if (method.isAnnotationPresent(annotation)) { 
    57                                         if (present) { 
    58                                                 throw new RuntimeException("enumeration " + classDoc + " has multiple annotations"); 
     60                                boolean present = false; 
     61                                for (Method method : clazz.getMethods()) { 
     62                                        if (method.isAnnotationPresent(annotation)) { 
     63                                                if (present) { 
     64                                                        throw new RuntimeException("enumeration " + classDoc + " has multiple annotations"); 
     65                                                } 
     66 
     67                                                getter = method; 
     68                                                present = true; 
    5969                                        } 
    60  
    61                                         getter = method; 
    62                                         present = true; 
    6370                                } 
     71                        } catch (ClassNotFoundException e) { 
     72                                logger.error(e.getMessage(), e); 
    6473                        } 
    6574                } 
  • trunk/src/org/fluffnstuff/asdoclet/handler/Handler.java

    r64 r71  
    66 
    77public interface Handler { 
    8     void process(ClassDoc classDoc) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException; 
     8       void process(ClassDoc classDoc) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException; 
    99} 
  • trunk/src/org/fluffnstuff/asdoclet/handler/InterfaceHandler.java

    r68 r71  
    33import java.util.ArrayList; 
    44import java.util.HashMap; 
     5import java.util.Iterator; 
    56import java.util.Map; 
    67import java.util.Set; 
    7 import java.util.Iterator; 
    88 
    99import org.fluffnstuff.asdoclet.generator.Generator; 
     
    5454                getGenerator().beginInterface(interfaceName); 
    5555 
    56                 processAnnotations(commands); 
     56                processAnnotations(classDoc.annotations()); 
     57                processAnnotationCommands(commands); 
    5758                processInterfaces(classDoc, ignore); 
    5859                processClassComment(classDoc); 
     
    7071                                processBeanProperty(classDoc, classType, methodDoc, ignore, commands); 
    7172                        } else { 
    72                                 processMethod(classType, methodDoc, commands, typeMap); 
     73                                processMethod(classDoc, classType, methodDoc, ignore, commands, typeMap); 
    7374                        } 
    7475                } 
    7576        } 
    7677 
    77         private void processMethod(org.fluffnstuff.asdoclet.generator.Type classType, MethodDoc methodDoc, Map<String, String> commands, Map<String, org.fluffnstuff.asdoclet.generator.Type> typeMap) { 
     78        private void processMethod(ClassDoc classDoc, org.fluffnstuff.asdoclet.generator.Type classType, MethodDoc methodDoc, Set<String> ignore, Map<String, String> commands, Map<String, org.fluffnstuff.asdoclet.generator.Type> typeMap) { 
    7879                Map<String, String> methodCommands = new HashMap<String, String>(commands); 
     80                Map<String, String> methodOnlyCommands = new HashMap<String, String>(); 
    7981                org.fluffnstuff.asdoclet.generator.Type returnType = GeneratorUtils.getType(methodDoc.returnType(), getGenerator()); 
    8082                org.fluffnstuff.asdoclet.generator.Type methodType = GeneratorUtils.getType(methodDoc, getGenerator()); 
     
    8789                org.fluffnstuff.asdoclet.generator.Type actualReturnType = returnType; 
    8890 
    89                 TagParser.processTags(methodDoc.tags(getGenerator().getName() + Constants.TAG_METHOD), methodCommands); 
     91                TagParser.processTags(methodDoc.tags(getGenerator().getName() + Constants.TAG_METHOD), methodOnlyCommands); 
     92                methodCommands.putAll(methodOnlyCommands); 
    9093 
    9194                if (!TagParser.getBooleanCommand(Constants.COMMAND_IGNORE, methodCommands)) { 
     
    113116                        boolean isasync = asyncType != org.fluffnstuff.asdoclet.generator.Type.EMPTY; 
    114117 
    115                         getGenerator().beginMethod(classType, methodType, 0, actualReturnType, methodDoc.name(), isasync); 
     118                        String name = methodDoc.name(); 
     119                        boolean override = isOverridden(classDoc, name, ignore); 
     120                        getGenerator().beginMethod(classType, methodType, 0, actualReturnType, name, isasync, override); 
     121 
     122                        processAnnotations(methodDoc.annotations()); 
     123                        processAnnotationCommands(methodOnlyCommands); 
    116124 
    117125                        if (isasync) {