Trail:

Changeset 76

Show
Ignore:
Timestamp:
10/21/09 16:21:22 (2 years ago)
Author:
harald
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/org/fluffnstuff/asdoclet/generator/utils/GeneratorUtils.java

    r71 r76  
    2424        private static Map<String, org.fluffnstuff.asdoclet.generator.Type> enumerationTypes = new HashMap<String, org.fluffnstuff.asdoclet.generator.Type>(); 
    2525 
    26         public static org.fluffnstuff.asdoclet.generator.Type getType(MethodDoc doc, Generator generator) { 
     26        public static org.fluffnstuff.asdoclet.generator.Type getType(MethodDoc doc, Generator generator, Collection<String> ignore) { 
    2727                if (generator.isDebug()) System.out.println(MessageFormat.format("Generating type {0} <{1}>", doc.name(), doc.getClass().getCanonicalName())); 
    2828 
     
    3232                if (generator.isDebug()) System.out.println(MessageFormat.format("Parameters {0}", Arrays.toString(doc.typeParameters()))); 
    3333                for (Type argument : doc.typeParameters()) { 
    34                         processArgument(argument, generator, arguments, bounds, new HashSet<String>()); 
     34                        processArgument(argument, generator, arguments, bounds, ignore, new HashSet<String>()); 
    3535                } 
    3636 
     
    4141        } 
    4242 
    43         private static void processArgument(Type argument, Generator generator, Collection<org.fluffnstuff.asdoclet.generator.Type> arguments, Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds, Collection<String> visited) { 
     43        private static void processArgument(Type argument, Generator generator, Collection<org.fluffnstuff.asdoclet.generator.Type> arguments, Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds, Collection<String> ignore, Collection<String> visited) { 
    4444                if (generator.isDebug()) System.out.println(MessageFormat.format("Processing argument {0} <{1}>", argument.qualifiedTypeName(), argument.getClass().getCanonicalName())); 
    4545 
    46                 org.fluffnstuff.asdoclet.generator.Type argumentType = getType(argument, generator, visited); 
     46                org.fluffnstuff.asdoclet.generator.Type argumentType = getType(argument, generator, ignore, visited); 
    4747                if (argumentType != org.fluffnstuff.asdoclet.generator.Type.NULL) { 
    48                         getTypeBounds(argument, generator, bounds, visited); 
     48                        getTypeBounds(argument, generator, bounds, ignore, visited); 
    4949                        if (arguments != null) arguments.add(argumentType); 
    5050                } 
    5151        } 
    5252 
    53         private static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator, Collection<String> visited) { 
     53        private static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator, Collection<String> ignore, Collection<String> visited) { 
    5454                if (generator.isDebug()) System.out.println(MessageFormat.format("Generating type {0} <{1}>", type.qualifiedTypeName(), type.getClass().getCanonicalName())); 
     55 
     56                if (ignore.contains(type.qualifiedTypeName())) return org.fluffnstuff.asdoclet.generator.Type.NULL; 
    5557 
    5658                if (visited.contains(type.toString())) return getType(type.qualifiedTypeName(), generator); 
     
    6769                        if (generator.isDebug()) System.out.println(MessageFormat.format("Arguments {0}", Arrays.toString(parameterizedType.typeArguments()))); 
    6870                        for (Type argument : parameterizedType.typeArguments()) { 
    69                                 processArgument(argument, generator, arguments, bounds, visited); 
     71                                processArgument(argument, generator, arguments, bounds, ignore, visited); 
    7072                        } 
    7173                } else if (type instanceof ClassDoc) { 
     
    7375                        if (generator.isDebug()) System.out.println(MessageFormat.format("Parameters {0}", Arrays.toString(classDoc.typeParameters()))); 
    7476                        for (Type argument : classDoc.typeParameters()) { 
    75                                 processArgument(argument, generator, arguments, bounds, visited); 
     77                                processArgument(argument, generator, arguments, bounds, ignore, visited); 
    7678                        } 
    7779                } 
     
    100102                                for (AnnotationDesc annotationDesc : methodDoc.annotations()) { 
    101103                                        if (annotationDesc.annotationType().qualifiedTypeName().equals(enumAnnotation.getCanonicalName())) { 
    102                                                 org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(methodDoc.returnType(), generator); 
     104                                                org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(methodDoc.returnType(), generator, new HashSet<String>()); 
    103105                                                enumerationTypes.put(typeName, type); 
    104106                                                return type; 
     
    113115        } 
    114116 
    115         public static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator) { 
    116                 return getType(type, generator, new HashSet<String>()); 
     117        public static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator, Collection<String> ignore) { 
     118                return getType(type, generator, ignore, new HashSet<String>()); 
    117119        } 
    118120 
     
    125127        } 
    126128 
    127         private static void getTypeBounds(Type argument, Generator generator, Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds, Collection<String> visited) { 
     129        private static void getTypeBounds(Type argument, Generator generator, Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds, Collection<String> ignore, Collection<String> visited) { 
    128130                Type[] types = null; 
    129131                if (argument instanceof TypeVariable) { 
     
    137139 
    138140                        if (boundType != null) { 
    139                                 org.fluffnstuff.asdoclet.generator.Type bound = getType(boundType, generator, visited); 
     141                                org.fluffnstuff.asdoclet.generator.Type bound = getType(boundType, generator, ignore, visited); 
    140142 
    141143                                if (bound != org.fluffnstuff.asdoclet.generator.Type.NULL) { 
  • trunk/src/org/fluffnstuff/asdoclet/handler/AbstractHandler.java

    r71 r76  
    6262 
    6363                                if (fieldType == null) { 
    64                                         fieldType = GeneratorUtils.getType(methodDoc.returnType(), getGenerator()); 
    65                                         methodType = GeneratorUtils.getType(methodDoc, getGenerator()); 
     64                                        fieldType = GeneratorUtils.getType(methodDoc.returnType(), getGenerator(), ignore); 
     65                                        methodType = GeneratorUtils.getType(methodDoc, getGenerator(), ignore); 
    6666                                } 
    6767 
     
    165165                if (classDoc.isInterface()) { 
    166166                        for (ClassDoc interfaceDoc : classDoc.interfaces()) { 
     167                                org.fluffnstuff.asdoclet.generator.Type interfaceClass = GeneratorUtils.getType(interfaceDoc, getGenerator(), ignore); 
     168 
     169                                if (interfaceClass == org.fluffnstuff.asdoclet.generator.Type.NULL) return false; 
    167170                                if (ignore.contains(interfaceDoc.qualifiedTypeName() + "." + name)) return false; 
    168171                                if (ignore.contains(interfaceDoc.qualifiedTypeName())) return false; 
     
    176179                        } 
    177180                } 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); 
     181                        for (ClassDoc superClassDoc = classDoc.superclass(); superClassDoc != null; superClassDoc = superClassDoc.superclass()) { 
     182                                org.fluffnstuff.asdoclet.generator.Type superClass = GeneratorUtils.getType(superClassDoc, getGenerator(), ignore); 
     183 
     184                                if (superClass == org.fluffnstuff.asdoclet.generator.Type.NULL) return false; 
     185                                if (ignore.contains(superClassDoc.qualifiedTypeName() + "." + name)) return false; 
     186                                if (ignore.contains(superClassDoc.qualifiedTypeName())) return false; 
     187                                if (findMethod(name, superClassDoc)) return true; 
     188 
     189                                Map<String, String> commands = TagParser.processClassTags(getGenerator(), superClassDoc); 
    184190                                ignore.addAll(getIgnore(commands)); 
    185191                        } 
     
    230236        protected void processInterfaces(ClassDoc classDoc, Set<String> ignore) { 
    231237                for (Type type : classDoc.interfaceTypes()) { 
    232                         org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(type, getGenerator()); 
     238                        org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(type, getGenerator(), ignore); 
    233239 
    234240                        if (interfaceName != org.fluffnstuff.asdoclet.generator.Type.NULL && !ignore.contains(interfaceName.getName())) { 
  • trunk/src/org/fluffnstuff/asdoclet/handler/ClassHandler.java

    r71 r76  
    33import java.util.Map; 
    44import java.util.Set; 
     5import java.util.Collection; 
    56 
    67import org.fluffnstuff.asdoclet.generator.Generator; 
     
    2425                Set<String> ignore = getIgnore(commands); 
    2526 
    26                 org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(classDoc, getGenerator()); 
     27                org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(classDoc, getGenerator(), ignore); 
    2728 
    2829                getGenerator().beginClass(type); 
     
    3334                processInterfaces(classDoc, ignore); 
    3435                processClassComment(classDoc); 
    35                 processClassConstants(type, classDoc); 
     36                processClassConstants(type, classDoc, ignore); 
    3637                processBeanProperties(type, classDoc, ignore, commands); 
    3738 
     
    4546        } 
    4647 
    47         private void processClassConstants(org.fluffnstuff.asdoclet.generator.Type classType, ClassDoc classDoc) { 
     48        private void processClassConstants(org.fluffnstuff.asdoclet.generator.Type classType, ClassDoc classDoc, Collection<String> ignore) { 
    4849                for (FieldDoc fieldDoc : classDoc.fields()) { 
    4950                        if (fieldDoc.isFinal() && fieldDoc.isPublic()) { 
    50                                 org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(fieldDoc.type(), getGenerator()); 
     51                                org.fluffnstuff.asdoclet.generator.Type type = GeneratorUtils.getType(fieldDoc.type(), getGenerator(), ignore); 
    5152                                getGenerator().addConstant(classType, type, fieldDoc.name(), fieldDoc.constantValueExpression(), fieldDoc.commentText()); 
    5253                        } 
     
    5455        } 
    5556 
    56         private void processSuperClass(ClassDoc classDoc, Set<String> ignore) { 
     57        private void processSuperClass(ClassDoc classDoc, Collection<String> ignore) { 
    5758                Type type = classDoc.superclassType(); 
    5859                if ((type != null) && !type.qualifiedTypeName().equals(Object.class.getCanonicalName())) { 
    59                         org.fluffnstuff.asdoclet.generator.Type superClass = GeneratorUtils.getType(type, getGenerator()); 
     60                        org.fluffnstuff.asdoclet.generator.Type superClass = GeneratorUtils.getType(type, getGenerator(), ignore); 
    6061 
    6162                        if (superClass != org.fluffnstuff.asdoclet.generator.Type.NULL && !ignore.contains(superClass.getName())) { 
  • trunk/src/org/fluffnstuff/asdoclet/handler/EnumHandler.java

    r71 r76  
    44import java.lang.reflect.InvocationTargetException; 
    55import java.lang.reflect.Method; 
     6import java.util.HashSet; 
    67 
    78import org.fluffnstuff.asdoclet.generator.Generator; 
     
    3637        private void processEnumConstants(Type type, ClassDoc classDoc) throws InvocationTargetException, IllegalAccessException, ClassNotFoundException { 
    3738                Method getter = findGetter(classDoc); 
    38                 Type valueType = GeneratorUtils.getType(classDoc, getGenerator()); 
     39                Type valueType = GeneratorUtils.getType(classDoc, getGenerator(), new HashSet<String>()); 
    3940 
    4041                for (FieldDoc fieldDoc : classDoc.enumConstants()) { 
  • trunk/src/org/fluffnstuff/asdoclet/handler/InterfaceHandler.java

    r71 r76  
    66import java.util.Map; 
    77import java.util.Set; 
     8import java.util.HashSet; 
    89 
    910import org.fluffnstuff.asdoclet.generator.Generator; 
     
    2728                boolean proxy = TagParser.getBooleanCommand(Constants.COMMAND_PROXY, commands); 
    2829                if (proxy) { 
    29                         org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(classDoc, getGenerator()); 
     30                        org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(classDoc, getGenerator(), new HashSet<String>()); 
    3031                        String proxyName = TagParser.getStringCommand(Constants.COMMAND_PROXY_NAME, interfaceName + "Proxy", commands); 
    3132                        String baseType = TagParser.getStringCommand(Constants.COMMAND_PROXY_SUPER_CLASS, commands); 
     
    4748 
    4849        private void processInterfaceInternal(ClassDoc classDoc, Map<String, String> commands) { 
    49                 org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(classDoc, getGenerator()); 
    50  
    5150                boolean bean = TagParser.getBooleanCommand(Constants.COMMAND_BEAN, commands); 
    5251                Set<String> ignore = getIgnore(commands); 
     52 
     53                org.fluffnstuff.asdoclet.generator.Type interfaceName = GeneratorUtils.getType(classDoc, getGenerator(), ignore); 
    5354 
    5455                getGenerator().beginInterface(interfaceName); 
     
    7980                Map<String, String> methodCommands = new HashMap<String, String>(commands); 
    8081                Map<String, String> methodOnlyCommands = new HashMap<String, String>(); 
    81                 org.fluffnstuff.asdoclet.generator.Type returnType = GeneratorUtils.getType(methodDoc.returnType(), getGenerator()); 
    82                 org.fluffnstuff.asdoclet.generator.Type methodType = GeneratorUtils.getType(methodDoc, getGenerator()); 
     82 
     83                org.fluffnstuff.asdoclet.generator.Type returnType = GeneratorUtils.getType(methodDoc.returnType(), getGenerator(), ignore); 
     84                org.fluffnstuff.asdoclet.generator.Type methodType = GeneratorUtils.getType(methodDoc, getGenerator(), ignore); 
    8385 
    8486                if (typeMap != null) { 
     
    128130 
    129131                        for (Parameter parameter : methodDoc.parameters()) { 
    130                                 getGenerator().addParameter(classType, methodType, GeneratorUtils.getType(parameter.type(), getGenerator()), parameter.name()); 
     132                                getGenerator().addParameter(classType, methodType, GeneratorUtils.getType(parameter.type(), getGenerator(), ignore), parameter.name()); 
    131133                        } 
    132134 
     
    151153                        ClassDoc classDoc = type.asClassDoc(); 
    152154 
    153                         org.fluffnstuff.asdoclet.generator.Type interfaceType = GeneratorUtils.getType(type, getGenerator()); 
     155                        org.fluffnstuff.asdoclet.generator.Type interfaceType = GeneratorUtils.getType(type, getGenerator(), ignore); 
    154156 
    155157                        if (interfaceType != org.fluffnstuff.asdoclet.generator.Type.NULL && !ignore.contains(interfaceType.getName())) { 
    156                                 org.fluffnstuff.asdoclet.generator.Type interfaceClass = GeneratorUtils.getType(classDoc, getGenerator()); 
     158                                org.fluffnstuff.asdoclet.generator.Type interfaceClass = GeneratorUtils.getType(classDoc, getGenerator(), ignore); 
    157159                                Map<String, org.fluffnstuff.asdoclet.generator.Type> typeMap = null; 
    158160 
  • trunk/test

    • Property svn:ignore changed from
      results
      to
      results
      *.class
  • trunk/test/TestAsdoclet.java

    r71 r76  
    33public class TestAsdoclet { 
    44        public static void main(String[] args) { 
    5                 Main.execute(new String[]{"-d", "test/results/cs", "-doclet", "org.fluffnstuff.asdoclet.AsDoclet", "-generator", "cs", "asdoclet.test", "test/asdoclet/test/TestInterfaceAnnotations.java"}); 
     5                Main.execute(new String[]{"-d", "test/results/cs", "-doclet", "org.fluffnstuff.asdoclet.AsDoclet", "-generator", "cs", "asdoclet.test", "test/asdoclet/test/TestIgnoreGeneric.java"}); 
    66        } 
    77} 
  • trunk/test/asdoclet/test

    • Property svn:ignore set to
      *.class
  • trunk/test/asdoclet/test/TestException.java

    r71 r76  
    2020                super(message, cause); 
    2121        } 
     22 
     23        /** 
     24         * @return message 
     25         * @cs.property ignore=<code>true</code> 
     26         */ 
     27        @Override 
     28        public String getMessage() { 
     29                return super.getMessage(); 
     30        } 
    2231} 
  • trunk/test/expectations/actionscript/asdoclet/test/TestException.as

    r71 r76  
    66        [RemoteClass(alias="asdoclet.test.TestException")] 
    77        public class TestException { 
     8                private var _message:String; 
     9                public function get message():String { 
     10                        return _message; 
     11                } 
     12                public function set message(value:String):void { 
     13                        _message=value; 
     14                } 
    815        } 
    916}