User: rinkrank
  Date: 02/03/16 10:13:10

  Modified:    src/xjavadoc AbstractClass.java
                        AbstractExecutableMember.java
                        AbstractProgramElement.java ConstructorImpl.java
                        DefaultXTag.java FieldImpl.java MethodImpl.java
                        ParameterImpl.java ProxyClass.java SourceClass.java
                        XClass.java XDoc.java XDocTest.java
                        XExecutableMember.java XField.java XJavaDoc.java
                        XJavaDocRoot.java XJavaDocTest.java XMethod.java
                        XParameter.java XProgramElement.java XTag.java
                        XTagTest.java
  Added:       src/xjavadoc SourceSet.java XMember.java
  Removed:     src/xjavadoc ClassDump.java XJavaDoclet.java
  Log:
  miscellaneous fixes that became apparent when integrating xjavadoc into xdoclet
  
  Revision  Changes    Path
  1.12      +49 -13    xjavadoc/src/xjavadoc/AbstractClass.java
  
  Index: AbstractClass.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/AbstractClass.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- AbstractClass.java        10 Mar 2002 17:56:00 -0000      1.11
  +++ AbstractClass.java        16 Mar 2002 18:13:09 -0000      1.12
  @@ -85,6 +85,10 @@
        /**
         * @todo-javadoc Describe the field
         */
  +     private HashMap _namedConstructors;
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private XMethod[] _xmethods;
        /**
         * @todo-javadoc Describe the field
  @@ -219,16 +223,6 @@
   
   
        /**
  -      * Gets the Abstract attribute of the SourceClass object
  -      *
  -      * @return The Abstract value
  -      */
  -     public final boolean isAbstract() {
  -             return (modifierSpecifier() & Modifier.ABSTRACT) != 0;
  -     }
  -
  -
  -     /**
         * Returns true if we are subclass or implement the class/interface with the
         * name classOrInterfaceName
         *
  @@ -274,6 +268,24 @@
        }
   
   
  +     /**
  +      * Gets the Constructor attribute of the AbstractClass object
  +      *
  +      * @param constructorNameWithSignature Describe what the parameter does
  +      * @return The Constructor value
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     public final XConstructor getConstructor(String constructorNameWithSignature) {
  +             complete();
  +             if (_namedConstructors != null) {
  +                     return 
(XConstructor)_namedConstructors.get(constructorNameWithSignature);
  +             }
  +             else {
  +                     return null;
  +             }
  +     }
  +
  +
   
        /**
         * Returns an XField with the given name. Example: getField("id");
  @@ -655,12 +667,13 @@
         * @todo-javadoc Describe the method parameter
         */
        public void addConstructor(XConstructor constructor) {
  -
                if (_constructors == null) {
                        _constructors = new ArrayList();
  +                     _namedConstructors = new HashMap();
                }
   
                _constructors.add(constructor);
  +             _namedConstructors.put(constructor.nameWithSignature(), constructor);
        }
   
   
  @@ -707,8 +720,31 @@
                }
   
                _methods.add(method);
  -             String methodWithSignature = method.name() + method.signature();
  -             _namedMethods.put(methodWithSignature, method);
  +             _namedMethods.put(method.nameWithSignature(), method);
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement() {
  +             return superclass();
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public long lastModified() {
  +             return Long.MIN_VALUE;
        }
   
   
  
  
  
  1.5       +36 -9     xjavadoc/src/xjavadoc/AbstractExecutableMember.java
  
  Index: AbstractExecutableMember.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/AbstractExecutableMember.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- AbstractExecutableMember.java     22 Feb 2002 20:22:31 -0000      1.4
  +++ AbstractExecutableMember.java     16 Mar 2002 18:13:09 -0000      1.5
  @@ -212,15 +212,19 @@
         * @todo-javadoc Write javadocs for return value
         */
        public final String signature() {
  -             StringBuffer sb = new StringBuffer("(");
  -             XParameter[] parameters = parameters();
  -             for (int i = 0; i < parameters.length; i++) {
  -                     sb.append(toString(parameters[i]));
  -                     if (i < parameters.length - 1) {
  -                             sb.append(',');
  +             return signature(new StringBuffer());
                        }
  -             }
  -             return sb.append(")").toString();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public final String nameWithSignature() {
  +             return signature(new StringBuffer(name()));
        }
   
   
  @@ -263,6 +267,28 @@
        /**
         * Describe what the method does
         *
  +      * @param sb Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     private final String signature(StringBuffer sb) {
  +             sb.append("(");
  +             XParameter[] parameters = parameters();
  +             for (int i = 0; i < parameters.length; i++) {
  +                     sb.append(toString(parameters[i]));
  +                     if (i < parameters.length - 1) {
  +                             sb.append(',');
  +                     }
  +             }
  +             return sb.append(")").toString();
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
         * @param parameter Describe what the parameter does
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
  @@ -289,4 +315,5 @@
                        _parameterPool[i] = new ParameterImpl();
                }
        }
  +
   }
  
  
  
  1.7       +20 -6     xjavadoc/src/xjavadoc/AbstractProgramElement.java
  
  Index: AbstractProgramElement.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/AbstractProgramElement.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- AbstractProgramElement.java       10 Mar 2002 17:56:00 -0000      1.6
  +++ AbstractProgramElement.java       16 Mar 2002 18:13:09 -0000      1.7
  @@ -144,6 +144,16 @@
   
   
        /**
  +      * Gets the Abstract attribute of the AbstractProgramElement object
  +      *
  +      * @return The Abstract value
  +      */
  +     public final boolean isAbstract() {
  +             return (_modifiers & Modifier.ABSTRACT) != 0;
  +     }
  +
  +
  +     /**
         * Gets the PackagePrivate attribute of the AbstractProgramElement object
         *
         * @return The PackagePrivate value
  @@ -252,12 +262,16 @@
         * @return the class level doc
         */
        public final XDoc doc() {
  +             if (_token == null) {
  +                     // We're not from source (we're binary, primitive or unknown)
  +                     return null;
  +             }
                if (_doc != null) {
                        return _doc;
                }
   
                if (_javadocToken != null) {
  -                     _doc = new XDoc(_javadocToken);
  +                     _doc = new XDoc(_javadocToken, this);
                }
                else {
                        // there was no doc in the original source. Create it.
  @@ -266,18 +280,18 @@
                        Token preJavadocToken = 
Token.newToken(NodeParserConstants.DEFAULT);
                        preJavadocToken.image = "\n\n";
   
  -                     Token javadocToken = 
Token.newToken(NodeParserConstants.FORMAL_COMMENT);
  -                     javadocToken.image = "";
  +                     _javadocToken = 
Token.newToken(NodeParserConstants.FORMAL_COMMENT);
  +                     _javadocToken.image = "";
   
                        Token postJavadocToken = 
Token.newToken(NodeParserConstants.DEFAULT);
                        postJavadocToken.image = "\n";
   
                        // Link the new tokens properly
  -                     preJavadocToken.next = javadocToken;
  -                     javadocToken.next = postJavadocToken;
  +                     preJavadocToken.next = _javadocToken;
  +                     _javadocToken.next = postJavadocToken;
   
                        _token.specialToken = preJavadocToken;
  -                     _doc = new XDoc(javadocToken);
  +                     _doc = new XDoc(_javadocToken, this);
                }
                return _doc;
        }
  
  
  
  1.5       +17 -0     xjavadoc/src/xjavadoc/ConstructorImpl.java
  
  Index: ConstructorImpl.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/ConstructorImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- ConstructorImpl.java      1 Mar 2002 10:44:40 -0000       1.4
  +++ ConstructorImpl.java      16 Mar 2002 18:13:09 -0000      1.5
  @@ -75,4 +75,21 @@
                return true;
        }
   
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement() {
  +             XClass superclass = containingClass().superclass();
  +             if (superclass != null) {
  +                     return superclass.getConstructor(nameWithSignature());
  +             }
  +             else {
  +                     return null;
  +             }
  +     }
   }
  
  
  
  1.6       +30 -5     xjavadoc/src/xjavadoc/DefaultXTag.java
  
  Index: DefaultXTag.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/DefaultXTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -r1.5 -r1.6
  --- DefaultXTag.java  10 Mar 2002 17:56:00 -0000      1.5
  +++ DefaultXTag.java  16 Mar 2002 18:13:09 -0000      1.6
  @@ -119,7 +119,7 @@
         * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method parameter
         */
  -     public String getAttribute(String attributeName) {
  +     public String attributeValue(String attributeName) {
                parse();
                return (String)_attributes.get(attributeName);
        }
  @@ -133,7 +133,7 @@
         * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method parameter
         */
  -     public String[] getAttributeNames() {
  +     public String[] attributeValueNames() {
                parse();
                Set names = _attributes.keySet();
                String[] result = (String[])names.toArray(new String[names.size()]);
  @@ -179,6 +179,34 @@
   
   
        /**
  +      * @todo fix this when we get more implementations
  +      * @param o Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public boolean equals(Object o) {
  +             parse();
  +             DefaultXTag other = (DefaultXTag)o;
  +             other.parse();
  +             return _attributes.equals(other._attributes);
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public int hashCode() {
  +             parse();
  +             return _attributes.hashCode();
  +     }
  +
  +
  +     /**
         * Given the raw javadoc tag content as the <i>value</i> parameter parses it
         * and sets the parameter. If anything is malformed (not (foo="xxx")+), then
         * nothing is set.
  @@ -187,8 +215,6 @@
         * @todo-javadoc Write javadocs for exception
         */
        private void parse() {
  -             Category cat = Category.getInstance(XTag.class);
  -
                // Todo: use StringBuffer, or do some substring stuff using i.
                String attr_name = "";
                String attr_value = "";
  @@ -288,7 +314,6 @@
                                        //_log.warn("Error in @tag: tailing \" sign 
expected but not found, @tags=" + value);
                                        return;
                                }
  -                             System.out.println("add param:" + attr_name + "," + 
attr_value);
                                _attributes.put(attr_name, attr_value);
                                attr_name = "";
                                attr_value = "";
  
  
  
  1.5       +28 -1     xjavadoc/src/xjavadoc/FieldImpl.java
  
  Index: FieldImpl.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/FieldImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- FieldImpl.java    1 Mar 2002 10:44:40 -0000       1.4
  +++ FieldImpl.java    16 Mar 2002 18:13:09 -0000      1.5
  @@ -41,7 +41,7 @@
    * @author Ara Abrahamian ([EMAIL PROTECTED])
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created Feb 15, 2002
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   class FieldImpl extends AbstractProgramElement implements XField {
   
  @@ -131,6 +131,21 @@
   
   
        /**
  +      * @todo refactor with similar methods from method and parameter into a util
  +      *      class
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String dimensionAsString() {
  +             StringBuffer sb = new StringBuffer();
  +             for (int i = dimension() - 1; i >= 0; i--) {
  +                     sb.append("[]");
  +             }
  +             return sb.toString();
  +     }
  +
  +
  +     /**
         * Describe what the method does
         *
         * @return Describe the return value
  @@ -163,5 +178,17 @@
         */
        public String toString() {
                return name();
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement() {
  +             return null;
        }
   }
  
  
  
  1.5       +34 -3     xjavadoc/src/xjavadoc/MethodImpl.java
  
  Index: MethodImpl.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/MethodImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- MethodImpl.java   24 Feb 2002 04:38:56 -0000      1.4
  +++ MethodImpl.java   16 Mar 2002 18:13:09 -0000      1.5
  @@ -143,15 +143,30 @@
                sb.append(modifiers());
                sb.append(" ");
                sb.append(returnType());
  -             for (int i = returnDimension() - 1; i >= 0; i--) {
  -                     sb.append("[]");
  -             }
  +             sb.append(returnDimensionAsString());
                sb.append(" ");
                sb.append(name());
                sb.append(signature());
                return sb.toString();
        }
   
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String returnDimensionAsString() {
  +             StringBuffer sb = new StringBuffer();
  +             for (int i = returnDimension() - 1; i >= 0; i--) {
  +                     sb.append("[]");
  +             }
  +             return sb.toString();
  +     }
  +
  +
        /*
         *  public static int getDimension(String[] typeName) {
         *  int dimension = 0;
  @@ -169,4 +184,20 @@
         *  return dimension;
         *  }
         */
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement() {
  +             XClass superclass = containingClass().superclass();
  +             if (superclass != null) {
  +                     return superclass.getMethod(nameWithSignature());
  +             }
  +             else {
  +                     return null;
  +             }
  +     }
   }
  
  
  
  1.4       +18 -2     xjavadoc/src/xjavadoc/ParameterImpl.java
  
  Index: ParameterImpl.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/ParameterImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- ParameterImpl.java        22 Feb 2002 20:22:30 -0000      1.3
  +++ ParameterImpl.java        16 Mar 2002 18:13:09 -0000      1.4
  @@ -41,7 +41,7 @@
    * @author Ara Abrahamian ([EMAIL PROTECTED])
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created Feb 11, 2002
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   final class ParameterImpl implements XParameter {
   
  @@ -121,7 +121,23 @@
   
   
        /**
  -      * Sets the extrinsic state.
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String dimensionAsString() {
  +             StringBuffer sb = new StringBuffer();
  +             for (int i = dimension() - 1; i >= 0; i--) {
  +                     sb.append("[]");
  +             }
  +             return sb.toString();
  +     }
  +
  +
  +     /**
  +      * Sets the extrinsic flyweight state.
         *
         * @param containingExecutableMember The containing member
         * @param parameterIndex
  
  
  
  1.9       +39 -0     xjavadoc/src/xjavadoc/ProxyClass.java
  
  Index: ProxyClass.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/ProxyClass.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- ProxyClass.java   10 Mar 2002 17:56:00 -0000      1.8
  +++ ProxyClass.java   16 Mar 2002 18:13:09 -0000      1.9
  @@ -49,6 +49,7 @@
    * @todo-javadoc Write javadocs
    */
   class ProxyClass implements XClass {
  +
        /**
         * @todo-javadoc Describe the field
         */
  @@ -180,6 +181,19 @@
   
   
        /**
  +      * Gets the Constructor attribute of the ProxyClass object
  +      *
  +      * @param constructor Describe what the parameter does
  +      * @return The Constructor value
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     public XConstructor getConstructor(String constructor) {
  +             resolve();
  +             return _subject.getConstructor(constructor);
  +     }
  +
  +
  +     /**
         * Gets the Method attribute of the ProxyClass object
         *
         * @param name Describe what the parameter does
  @@ -219,6 +233,18 @@
        /**
         * Describe what the method does
         *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public long lastModified() {
  +             return _subject.lastModified();
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
         * @param o Describe what the parameter does
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
  @@ -482,6 +508,19 @@
        public boolean implementsInterface(String interfaceName) {
                resolve();
                return _subject.implementsInterface(interfaceName);
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement() {
  +             resolve();
  +             return _subject.superElement();
        }
   
   
  
  
  
  1.15      +29 -1     xjavadoc/src/xjavadoc/SourceClass.java
  
  Index: SourceClass.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/SourceClass.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -r1.14 -r1.15
  --- SourceClass.java  10 Mar 2002 17:56:00 -0000      1.14
  +++ SourceClass.java  16 Mar 2002 18:13:09 -0000      1.15
  @@ -67,6 +67,12 @@
         * @todo-javadoc Describe the field
         */
        private Reader _in = null;
  +
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private final long _lastModified;
  +
        /**
         * @todo-javadoc Describe the field
         */
  @@ -95,6 +101,7 @@
                super(containingClass, qualifiedName);
                // We need to check if sourceFile is null. All inner classes will have 
it set to null
                if (sourceFile != null) {
  +                     _lastModified = sourceFile.lastModified();
                        //_log.debug("A normal source class:" + qualifiedName);
                        addImportedPackage("java.lang");
                        try {
  @@ -104,6 +111,10 @@
                                throw new IllegalStateException("Couldn't find source 
for " + qualifiedName + " at " + sourceFile.getAbsolutePath());
                        }
                }
  +             else {
  +                     // only to satisfy compiler. will never be returned.
  +                     _lastModified = Long.MAX_VALUE;
  +             }
                instanceCount++;
        }
   
  @@ -168,6 +179,23 @@
        /**
         * Describe what the method does
         *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public long lastModified() {
  +             if (isOuterClass()) {
  +                     return _lastModified;
  +             }
  +             else {
  +                     return containingClass().lastModified();
  +             }
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
         * @param useNodeParser Describe what the parameter does
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
  @@ -311,7 +339,7 @@
                                        try {
                                                _log.debug("waiting for parser to 
complete in complete()");
                                                getParseLock().wait();
  -                                             _log.debug("notified by completed 
parser to in complete()");
  +                                             _log.debug("notified by completed 
parser in complete()");
                                        } catch (InterruptedException e) {
                                                _log.debug("The complete() of " + 
qualifiedName() + " has been interrupted");
                                        }
  
  
  
  1.18      +16 -0     xjavadoc/src/xjavadoc/XClass.java
  
  Index: XClass.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XClass.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -r1.17 -r1.18
  --- XClass.java       10 Mar 2002 17:56:00 -0000      1.17
  +++ XClass.java       16 Mar 2002 18:13:09 -0000      1.18
  @@ -60,6 +60,16 @@
   
   
        /**
  +      * Gets the Constructor attribute of the XClass object
  +      *
  +      * @param constructorNameWithSignature Describe what the parameter does
  +      * @return The Constructor value
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     public XConstructor getConstructor(String constructorNameWithSignature);
  +
  +
  +     /**
         * Gets the Field attribute of the XClass object
         *
         * @param name Describe what the parameter does
  @@ -222,4 +232,10 @@
         * @return The Writeable value
         */
        public boolean isWriteable();
  +
  +
  +     /**
  +      * @return the time that this class was last modified
  +      */
  +     public long lastModified();
   }
  
  
  
  1.14      +160 -11   xjavadoc/src/xjavadoc/XDoc.java
  
  Index: XDoc.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XDoc.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- XDoc.java 10 Mar 2002 17:56:00 -0000      1.13
  +++ XDoc.java 16 Mar 2002 18:13:09 -0000      1.14
  @@ -41,6 +41,7 @@
   import java.io.StringReader;
   import java.util.ArrayList;
   import java.util.HashMap;
  +import java.util.Arrays;
   import java.util.HashSet;
   import java.util.StringTokenizer;
   import java.util.Iterator;
  @@ -86,6 +87,11 @@
        private final Token _javadocToken;
   
        /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private final XProgramElement _owner;
  +
  +     /**
         * Token on which the javadoc belongs. Needed for proper indentation
         */
   //   private final Token _programElementToken;
  @@ -114,14 +120,17 @@
         * Describe what the XDoc constructor does
         *
         * @param javadocToken Describe what the parameter does
  +      * @param owner Describe what the parameter does
  +      * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         */
  -     public XDoc(Token javadocToken) {
  +     public XDoc(Token javadocToken, XProgramElement owner) {
                instanceCount++;
                _javadocToken = javadocToken;
  +             _owner = owner;
                if (_javadocToken.image == null) {
                        // the passed token was not from source code, but was created 
because no javadoc existed.
                        _javadocToken.image = "/**\n */";
  @@ -130,6 +139,88 @@
   
   
        /**
  +      * Gets the Owner attribute of the XDoc object
  +      *
  +      * @return The Owner value
  +      */
  +     public XProgramElement getOwner() {
  +             return _owner;
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param tagName Describe what the parameter does
  +      * @param superclasses Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XTag[] tags(String tagName, boolean superclasses) {
  +             XTag[] tags = tags(tagName);
  +
  +             if (superclasses) {
  +                     ArrayList allTags = new ArrayList(Arrays.asList(tags));
  +                     XDoc superDoc = this;
  +                     while ((superDoc = superDoc.superDoc()) != null) {
  +                             System.out.println("ASLAK super");
  +                             XTag[] superTags = superDoc.tags(tagName);
  +                             for (int i = 0; i < superTags.length; i++) {
  +                                     // Do not add redundant tags (a tag defined 
exactly in base and
  +                                     // child).
  +                                     boolean found = false;
  +                                     for (int j = 0; j < allTags.size(); j++) {
  +                                             if (allTags.get(j).equals(tags[i])) {
  +                                                     found = true;
  +                                                     break;
  +                                             }
  +                                     }
  +
  +                                     if (!found) {
  +                                             allTags.add(tags[i]);
  +                                     }
  +                             }
  +                     }
  +                     tags = (XTag[])allTags.toArray(new XTag[allTags.size()]);
  +             }
  +             return tags;
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param tagName Describe what the parameter does
  +      * @param superclasses Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public boolean hasTag(String tagName, boolean superclasses) {
  +             return tags(tagName, superclasses).length != 0;
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param tagName Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public boolean hasTag(String tagName) {
  +             return hasTag(tagName, false);
  +     }
  +
  +
  +     /**
         * Utility method to set the value of a tag parameter. If the tag doesn't
         * exist, it is created. If the parameter doesn't exist it is created. If the
         * tag parameter exists, it is updated.
  @@ -164,14 +255,30 @@
   
   
        /**
  +      * Describe what the method does
  +      *
  +      * @param tagName Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XTag tag(String tagName) {
  +             return tag(tagName, false);
  +     }
  +
  +
  +     /**
         * Get the first tag of name tagName
         *
         * @param tagName the name of the tag to get.
  +      * @param superclasses Describe what the parameter does
         * @return the first XTag with name equal to tagName
  +      * @todo-javadoc Write javadocs for method parameter
         */
  -     public XTag tag(String tagName) {
  +     public XTag tag(String tagName, boolean superclasses) {
                parse();
  -             XTag[] tags = tags(tagName);
  +             XTag[] tags = tags(tagName, superclasses);
                if (tags.length == 0) {
                        return null;
                }
  @@ -200,28 +307,48 @@
   
   
        /**
  -      * Utility method to get the value of a tag parameter.
  +      * Describe what the method does
         *
         * @param tagName Describe what the parameter does
         * @param attributeName Describe what the parameter does
  +      * @param superclasses Describe what the parameter does
         * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
  -     public String tagValue(String tagName, String attributeName) {
  +     public String tagAttributeValue(String tagName, String attributeName, boolean 
superclasses) {
                String result = null;
  -             XTag tag = tag(tagName);
  -             System.out.println("tagName:" + tagName + ":" + tag);
  -             if (tag != null) {
  -                     result = tag.getAttribute(attributeName);
  +             XTag[] tags = tags(tagName, superclasses);
  +             for (int i = 0; i < tags.length; i++) {
  +                     result = tags[i].attributeValue(attributeName);
  +                     if (result != null) {
  +                             break;
  +                     }
                }
                return result;
        }
   
   
        /**
  +      * Describe what the method does
  +      *
  +      * @param tagName Describe what the parameter does
  +      * @param attributeName Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String tagAttributeValue(String tagName, String attributeName) {
  +             return tagAttributeValue(tagName, attributeName, false);
  +     }
  +
  +
  +     /**
         * Describe the method
         *
         * @param docListener Describe the method parameter
  @@ -263,7 +390,7 @@
                XTag[] tags = tags();
                for (int i = 0; i < tags.length; i++) {
                        appendWhiteSpaces(sb).append(" * @").append(tags[i].name());
  -                     String[] parameters = tags[i].getAttributeNames();
  +                     String[] parameters = tags[i].attributeValueNames();
                        if (parameters.length == 0) {
                                // no parameters, or malformed
                                sb.append(" ").append(tags[i].value()).append(NEWLINE);
  @@ -271,7 +398,7 @@
                        else {
                                sb.append(NEWLINE);
                                for (int j = 0; j < parameters.length; j++) {
  -                                     appendWhiteSpaces(sb).append(" *    
").append(parameters[j]).append("=\"").append(tags[i].getAttribute(parameters[j])).append("\"").append(NEWLINE);
  +                                     appendWhiteSpaces(sb).append(" *    
").append(parameters[j]).append("=\"").append(tags[i].attributeValue(parameters[j])).append("\"").append(NEWLINE);
                                }
                        }
                }
  @@ -339,11 +466,33 @@
                parse();
                ArrayList tags = (ArrayList)_tagMap.get(tagName);
                if (tags == null) {
  +                     String dottedFormatTagName = tagName.replace(':', '.');
  +                     tags = (ArrayList)_tagMap.get(dottedFormatTagName);
  +             }
  +
  +             if (tags == null) {
                        return new XTag[0];
                }
                else {
                        XTag[] tagArray = new XTag[tags.size()];
                        return (XTag[])tags.toArray(tagArray);
  +             }
  +     }
  +
  +
  +     /**
  +      * Returns the doc in the superclass if any.
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     private XDoc superDoc() {
  +             XProgramElement superElement = _owner.superElement();
  +             if (superElement != null) {
  +                     return superElement.doc();
  +             }
  +             else {
  +                     return null;
                }
        }
   
  
  
  
  1.4       +1 -1      xjavadoc/src/xjavadoc/XDocTest.java
  
  Index: XDocTest.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XDocTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- XDocTest.java     24 Feb 2002 04:38:56 -0000      1.3
  +++ XDocTest.java     16 Mar 2002 18:13:09 -0000      1.4
  @@ -87,7 +87,7 @@
                Token token = Token.newToken(0);
                token.image = javadoc;
   //           XDoc doc = new XDoc(token, token);
  -             XDoc doc = new XDoc(token);
  +             XDoc doc = new XDoc(token, null);
   
                assertEquals("This is in the doc too JUnit test for JavaDocReader.", 
doc.firstSentence());
                assertEquals("This is in the doc too JUnit test for JavaDocReader. 
This is sentence number two.", doc.commentText());
  
  
  
  1.8       +11 -1     xjavadoc/src/xjavadoc/XExecutableMember.java
  
  Index: XExecutableMember.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XExecutableMember.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- XExecutableMember.java    20 Feb 2002 00:12:01 -0000      1.7
  +++ XExecutableMember.java    16 Mar 2002 18:13:09 -0000      1.8
  @@ -43,7 +43,7 @@
    * @created February 17, 2002
    * @todo-javadoc Write javadocs for interface
    */
  -public interface XExecutableMember extends XProgramElement {
  +public interface XExecutableMember extends XMember {
        // To follow Javadoc there would be XMember inbetween
   
   
  @@ -99,5 +99,15 @@
         * @todo-javadoc Write javadocs for return value
         */
        public String signature();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String nameWithSignature();
   }
   
  
  
  
  1.4       +11 -1     xjavadoc/src/xjavadoc/XField.java
  
  Index: XField.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XField.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- XField.java       22 Feb 2002 18:14:49 -0000      1.3
  +++ XField.java       16 Mar 2002 18:13:09 -0000      1.4
  @@ -43,7 +43,7 @@
    * @created February 16, 2002
    * @todo-javadoc Write javadocs for interface
    */
  -public interface XField extends XProgramElement {
  +public interface XField extends XMember {
        /**
         * Gets the Transient attribute of the XField object
         *
  @@ -77,4 +77,14 @@
         * @todo-javadoc Write javadocs for return value
         */
        public int dimension();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String dimensionAsString();
   }
  
  
  
  1.22      +77 -158   xjavadoc/src/xjavadoc/XJavaDoc.java
  
  Index: XJavaDoc.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XJavaDoc.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -w -r1.21 -r1.22
  --- XJavaDoc.java     10 Mar 2002 17:56:00 -0000      1.21
  +++ XJavaDoc.java     16 Mar 2002 18:13:09 -0000      1.22
  @@ -42,6 +42,9 @@
   import java.util.Arrays;
   import java.util.List;
   import java.util.ArrayList;
  +import java.util.Set;
  +import java.util.HashSet;
  +import java.util.Iterator;
   import java.util.Collections;
   import java.util.HashMap;
   import java.util.HashSet;
  @@ -50,7 +53,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created 3. januar 2002
    */
  -public class XJavaDoc implements XJavaDocRoot, Serializable {
  +public class XJavaDoc implements XJavaDocRoot {
   
        /**
         * @todo-javadoc Describe the field
  @@ -80,7 +83,7 @@
        /**
         * @todo-javadoc Describe the field
         */
  -     private File _dir;
  +     private final HashSet _sourceSets = new HashSet();
   
        /**
         * @todo-javadoc Describe the field
  @@ -90,12 +93,7 @@
        /**
         * @todo-javadoc Describe the field
         */
  -     private String[] _files;
  -
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
  -     private String _docletClass;
  +     private int _sourceFileCount;
   
        /**
         * @todo-javadoc Describe the field
  @@ -130,68 +128,6 @@
   
   
        /**
  -      * Sets the Dir attribute of the XJavaDoc object
  -      *
  -      * @param dir The new Dir value
  -      */
  -     public void setDir(File dir) {
  -             //_log.debug("setFile " + dir.getAbsolutePath());
  -             this._dir = dir;
  -     }
  -
  -
  -     /**
  -      * Sets the DocletClass attribute of the XJavaDoc object
  -      *
  -      * @param docletClass The new DocletClass value
  -      */
  -     public void setDocletClass(String docletClass) {
  -             this._docletClass = docletClass;
  -     }
  -
  -
  -     /**
  -      * Sets the Files attribute of the XJavaDoc object
  -      *
  -      * @param files The new Files value
  -      */
  -
  -     public void setFiles(String[] files) {
  -             this._files = files;
  -     }
  -
  -
  -     /**
  -      * Gets the Dir attribute of the XJavaDoc object
  -      *
  -      * @return The Dir value
  -      */
  -     public File getDir() {
  -             return _dir;
  -     }
  -
  -
  -     /**
  -      * Gets the DocletClass attribute of the XJavaDoc object
  -      *
  -      * @return The DocletClass value
  -      */
  -     public String getDocletClass() {
  -             return _docletClass;
  -     }
  -
  -
  -     /**
  -      * Gets the Files attribute of the XJavaDoc object
  -      *
  -      * @return The Files value
  -      */
  -     public String[] getFiles() {
  -             return _files;
  -     }
  -
  -
  -     /**
         * Get the XClass corresponding to the qualifiedName. This can be a class from
         * source, a precompiled class or a primitive. UnknownClass is never returned
         * from this method. If a class can't be resolved, null is returned. This
  @@ -223,6 +159,19 @@
   
   
        /**
  +      * Describe the method
  +      *
  +      * @param sourceSet Describe the method parameter
  +      * @todo-javadoc Describe the method
  +      * @todo-javadoc Describe the method parameter
  +      */
  +     public void addSourceSet(SourceSet sourceSet) {
  +             _sourceSets.add(sourceSet);
  +             _sourceFileCount += sourceSet.size();
  +     }
  +
  +
  +     /**
         * Describe what the method does
         *
         * @todo-javadoc Write javadocs for method
  @@ -318,53 +267,25 @@
   
   
        /**
  -      * This method is used if we're using the doclet functionality. Otherwise,
  -      * don't call this method.
  +      * Returns all cla
         *
  +      * @return Describe the return value
         * @exception XJavaDocException Describe the exception
  +      * @todo-javadoc Write javadocs for return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for exception
         */
  -     public void scan() throws XJavaDocException {
  -             if (_dir == null) {
  -                     throw new XJavaDocException("setDir must pe called first!");
  -             }
  -             long start = System.currentTimeMillis();
  -             System.out.println("Scanning " + _files.length + " classes...");
  -             for (int i = 0; i < _files.length; i++) {
  -                     String qualifiedName = _files[i].replace('/', '.');
  -                     qualifiedName = qualifiedName.replace('\\', '.');
  -                     qualifiedName = qualifiedName.substring(0, 
qualifiedName.length() - 5);
  +     public XClass[] sourceClasses() throws XJavaDocException {
  +             ArrayList sourceClasses = new ArrayList();
  +             for (Iterator i = _sourceSets.iterator(); i.hasNext(); ) {
  +                     SourceSet sourceSet = (SourceSet)i.next();
  +                     for (int j = 0; j < sourceSet.size(); j++) {
  +                             String qualifiedName = sourceSet.getQualifiedName(j);
                        XClass clazz = getXClass(qualifiedName);
  -//                   Uncomment this line to see what performance is like when all 
classes are parsed completely
  -                     XClass[] intfs = clazz.interfaces();
  -                     /*
  -                      *  XMethod[] methods = clazz.methods();
  -                      *  if (methods.length > 0) {
  -                      *  XClass ret = methods[0].returnType();
  -                      *  XMethod[] retmet = ret.methods();
  -                      *  }
  -                      */
  -             }
  -             long end = System.currentTimeMillis();
  -             System.out.println("Scanned " + _files.length + " classes in " + (end 
- start) + " milliseconds.");
  -             printMemoryStatus();
  -             if (_docletClass != null) {
  -                     invokeDoclet();
  +                             sourceClasses.add(clazz);
                }
        }
  -
  -
  -     /**
  -      * Describe what the method does
  -      *
  -      * @return Describe the return value
  -      * @todo-javadoc Write javadocs for method
  -      * @todo-javadoc Write javadocs for return value
  -      */
  -     public XClass[] classes() {
  -             XClass[] result = new XClass[_sourceClasses.size()];
  -             return (XClass[])_sourceClasses.values().toArray(result);
  +             return (XClass[])sourceClasses.toArray(new 
XClass[sourceClasses.size()]);
        }
   
   
  @@ -372,11 +293,13 @@
         * Returns the packages of the specified classes during parsing.
         *
         * @return Describe the return value
  +      * @exception XJavaDocException Describe the exception
  +      * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for return value
         */
  -     public XPackage[] specifiedPackages() {
  +     public XPackage[] sourcePackages() throws XJavaDocException {
                HashSet packages = new HashSet();
  -             XClass[] classes = classes();
  +             XClass[] classes = sourceClasses();
                for (int i = 0; i < classes.length; i++) {
                        packages.add(classes[i].containingPackage());
                }
  @@ -394,15 +317,20 @@
        /**
         * Returns the XPackage with the given name
         *
  -      * @param s Describe what the parameter does
  +      * @param qualifiedName Describe what the parameter does
  +      * @param proxyIfNotCached Describe what the parameter does
  +      * @param useNodeParser Describe what the parameter does
         * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
  -     public XPackage packageNamed(String s) {
  -             return (XPackage)_packages.get(s);
  -     }
  +//   public XPackage packageNamed(String s) {
  +//           return (XPackage)_packages.get(s);
  +//   }
   
   
        /**
  @@ -420,9 +348,6 @@
         * @pre qualifiedName != null
         */
        XClass getXClass(String qualifiedName, boolean proxyIfNotCached, boolean 
useNodeParser) {
  -             if (_dir == null) {
  -                     throw new IllegalStateException("setDir must pe called 
first!");
  -             }
                if (qualifiedName.equals("")) {
                        throw new IllegalStateException("Classname can't be empty 
String");
                }
  @@ -533,8 +458,7 @@
                        return true;
                }
                else {
  -                     File f = new File(_dir, qualifiedName.replace('.', '/') + 
".java");
  -                     return f.exists();
  +                     return getSourceFile(qualifiedName) != null;
                }
        }
   
  @@ -552,6 +476,31 @@
   
   
        /**
  +      * Gets the SourceFile attribute of the XJavaDoc object
  +      *
  +      * @param qualifiedName Describe what the parameter does
  +      * @return The SourceFile value
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     private File getSourceFile(String qualifiedName) {
  +             // loop over all SourceSets. If a source is found more than once -> 
bang!
  +             File found = null;
  +
  +             for (Iterator i = _sourceSets.iterator(); i.hasNext(); ) {
  +                     SourceSet sourceSet = (SourceSet)i.next();
  +                     File javaFile = sourceSet.getSourceFile(qualifiedName);
  +                     if (javaFile != null) {
  +                             if (found != null) {
  +                                     throw new IllegalStateException("Ambiguous 
sources for " + qualifiedName + " : " + found.getAbsolutePath() + " or " + 
javaFile.getAbsolutePath());
  +                             }
  +                             found = javaFile;
  +                     }
  +             }
  +             return found;
  +     }
  +
  +
  +     /**
         * Gets the ProxyClass attribute of the XJavaDoc object
         *
         * @param qualifiedName Describe what the parameter does
  @@ -589,12 +538,11 @@
         * @todo-javadoc Write javadocs for exception
         */
        private SourceClass scanAndPut(String qualifiedName, boolean useNodeParser) 
throws XJavaDocException {
  -             File f = null;
  -             f = new File(_dir, qualifiedName.replace('.', '/') + ".java");
  -             if (!f.exists()) {
  -                     throw new XJavaDocException("No source found for " + 
qualifiedName + " at " + f.getAbsolutePath());
  +             File sourceFile = getSourceFile(qualifiedName);
  +             if (sourceFile == null) {
  +                     throw new XJavaDocException("No source found for " + 
qualifiedName);
                }
  -             SourceClass sourceClass = new SourceClass(null, qualifiedName, f);
  +             SourceClass sourceClass = new SourceClass(null, qualifiedName, 
sourceFile);
                addSourceClass(sourceClass);
   
                //sourceClass.parse();
  @@ -603,7 +551,9 @@
                _parseThreads.add(parseThread);
                // We must wait here until the first part of the parsing is done.
                // we'll be notified by the parser when it's done
  +             _log.debug("scanAndPut entering sync block");
                synchronized (sourceClass.getParseLock()) {
  +                     _log.debug("scanAndPut inside sync block");
                        parseThread.start();
                        try {
                                _log.debug("main thread waiting in scanAndPut() for " 
+ qualifiedName + " header to be parsed");
  @@ -634,37 +584,6 @@
                System.out.println("BinaryClass instances:     " + 
BinaryClass.instanceCount);
                System.out.println("UnknownClass instances:    " + 
UnknownClass.instanceCount);
                System.out.println("ProxyClass instances:      " + 
ProxyClass.instanceCount);
  -     }
  -
  -
  -     /**
  -      * Describe what the method does
  -      *
  -      * @exception XJavaDocException Describe the exception
  -      * @todo-javadoc Write javadocs for method
  -      * @todo-javadoc Write javadocs for exception
  -      */
  -     private void invokeDoclet() throws XJavaDocException {
  -             try {
  -                     Object o = Class.forName(_docletClass).newInstance();
  -                     XJavaDoclet doclet = (XJavaDoclet)o;
  -                     doclet.start(this);
  -             } catch (Exception e) {
  -                     e.printStackTrace();
  -                     throw new XJavaDocException(e);
  -             }
  -     }
  -
  -
  -     /**
  -      * Copies settings from an other instance. Useful if an instance was
  -      * deserialized. The only reason to serialise is to augment the memory size.
  -      * This will only be done from the Ant task.
  -      *
  -      * @param other The new Singleton value
  -      */
  -     public static synchronized void setSingleton(XJavaDoc other) {
  -             instance = other;
        }
   
   
  
  
  
  1.4       +7 -13     xjavadoc/src/xjavadoc/XJavaDocRoot.java
  
  Index: XJavaDocRoot.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XJavaDocRoot.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- XJavaDocRoot.java 20 Feb 2002 00:12:01 -0000      1.3
  +++ XJavaDocRoot.java 16 Mar 2002 18:13:09 -0000      1.4
  @@ -45,32 +45,26 @@
         * Describe what the method does
         *
         * @return Describe the return value
  +      * @exception XJavaDocException Describe the exception
  +      * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
  -     public XClass[] classes();
  +     public XClass[] sourceClasses() throws XJavaDocException;
   
   
        /**
         * Describe what the method does
         *
         * @return Describe the return value
  +      * @exception XJavaDocException Describe the exception
  +      * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
  -     public XPackage[] specifiedPackages();
  +     public XPackage[] sourcePackages() throws XJavaDocException;
   
  -
  -     /**
  -      * Describe what the method does
  -      *
  -      * @param name Describe what the parameter does
  -      * @return Describe the return value
  -      * @todo-javadoc Write javadocs for method
  -      * @todo-javadoc Write javadocs for method parameter
  -      * @todo-javadoc Write javadocs for return value
  -      */
  -     public XPackage packageNamed(String name);
  +//   public XPackage packageNamed(String name) throws XJavaDocException;
   
   }
   
  
  
  
  1.19      +2 -2      xjavadoc/src/xjavadoc/XJavaDocTest.java
  
  Index: XJavaDocTest.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XJavaDocTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -r1.18 -r1.19
  --- XJavaDocTest.java 10 Mar 2002 17:56:00 -0000      1.18
  +++ XJavaDocTest.java 16 Mar 2002 18:13:09 -0000      1.19
  @@ -71,7 +71,7 @@
        public void setUp() throws Exception {
                File dir = new File(System.getProperty("user.dir") + File.separator + 
"test");
   
  -             XJavaDoc.getInstance().setDir(dir);
  +             XJavaDoc.getInstance().addSourceSet(new SourceSet(dir, null));
        }
   
   
  @@ -149,7 +149,7 @@
                XClass clazz = XJavaDoc.getInstance().getXClass("Hello", true);
                XMethod method = clazz.getMethod("whatever(java.lang.String[][],int)");
                XDoc doc = method.doc();
  -             assertEquals("is", doc.tagValue("maybe", "this"));
  +             assertEquals("is", doc.tagAttributeValue("maybe", "this", true));
                File testDir = new File("build/junit/testGetMethodParameterValue");
                String fileName = clazz.save(testDir);
        }
  
  
  
  1.6       +10 -0     xjavadoc/src/xjavadoc/XMethod.java
  
  Index: XMethod.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XMethod.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -r1.5 -r1.6
  --- XMethod.java      20 Feb 2002 00:12:01 -0000      1.5
  +++ XMethod.java      16 Mar 2002 18:13:09 -0000      1.6
  @@ -61,5 +61,15 @@
         * @todo-javadoc Write javadocs for return value
         */
        public abstract int returnDimension();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String returnDimensionAsString();
   }
   
  
  
  
  1.8       +10 -0     xjavadoc/src/xjavadoc/XParameter.java
  
  Index: XParameter.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XParameter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- XParameter.java   20 Feb 2002 00:12:01 -0000      1.7
  +++ XParameter.java   16 Mar 2002 18:13:09 -0000      1.8
  @@ -72,5 +72,15 @@
         * @todo-javadoc Write javadocs for return value
         */
        public int dimension();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public String dimensionAsString();
   }
   
  
  
  
  1.5       +18 -0     xjavadoc/src/xjavadoc/XProgramElement.java
  
  Index: XProgramElement.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XProgramElement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- XProgramElement.java      1 Mar 2002 10:44:39 -0000       1.4
  +++ XProgramElement.java      16 Mar 2002 18:13:09 -0000      1.5
  @@ -108,6 +108,14 @@
   
   
        /**
  +      * Gets the Abstract attribute of the XProgramElement object
  +      *
  +      * @return The Abstract value
  +      */
  +     public boolean isAbstract();
  +
  +
  +     /**
         * Gets the Public attribute of the XProgramElement object
         *
         * @return The Public value
  @@ -161,4 +169,14 @@
         * @todo-javadoc Write javadocs for return value
         */
        public XDoc doc();
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public XProgramElement superElement();
   }
  
  
  
  1.11      +25 -2     xjavadoc/src/xjavadoc/XTag.java
  
  Index: XTag.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XTag.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- XTag.java 10 Mar 2002 17:56:00 -0000      1.10
  +++ XTag.java 16 Mar 2002 18:13:09 -0000      1.11
  @@ -54,7 +54,7 @@
         * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method parameter
         */
  -     public String getAttribute(String attributeName);
  +     public String attributeValue(String attributeName);
   
   
        /**
  @@ -65,7 +65,7 @@
         * @todo-javadoc Write javadocs for exception
         * @todo-javadoc Write javadocs for method parameter
         */
  -     public String[] getAttributeNames();
  +     public String[] attributeValueNames();
   
   
        /**
  @@ -114,6 +114,29 @@
         */
        public String removeAttribute(String attributeName);
   
  +
   //   public void formatDoc();
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param o Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public boolean equals(Object o);
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public int hashCode();
  +
   }
   
  
  
  
  1.7       +3 -3      xjavadoc/src/xjavadoc/XTagTest.java
  
  Index: XTagTest.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XTagTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- XTagTest.java     10 Mar 2002 17:56:00 -0000      1.6
  +++ XTagTest.java     16 Mar 2002 18:13:09 -0000      1.7
  @@ -72,9 +72,9 @@
        public void testSimpleOne() throws Exception {
                String text = "one=\"en\" two=\"to\" fiftysix=\"femti seks\"";
                XTag tag = XTagFactory.getInstance().createTag("test", text);
  -             assertEquals("en", tag.getAttribute("one"));
  -             assertEquals("to", tag.getAttribute("two"));
  -             assertEquals("femti seks", tag.getAttribute("fiftysix"));
  +             assertEquals("en", tag.attributeValue("one"));
  +             assertEquals("to", tag.attributeValue("two"));
  +             assertEquals("femti seks", tag.attributeValue("fiftysix"));
        }
   
   }
  
  
  
  1.1                  xjavadoc/src/xjavadoc/SourceSet.java
  
  Index: SourceSet.java
  ===================================================================
  /*
   * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without modification,
   * are permitted provided that the following conditions are met:
   *
   * - Redistributions of source code must retain the above copyright notice,
   *   this list of conditions and the following disclaimer.
   *
   * - Redistributions in binary form must reproduce the above copyright
   *   notice, this list of conditions and the following disclaimer in the
   *   documentation and/or other materials provided with the distribution.
   *
   * - Neither the name of BEKK Consulting nor the names of its
   *   contributors may be used to endorse or promote products derived from
   *   this software without specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
   * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
   * DAMAGE.
   */
  
  /*
   * Change log
   *
   */
  package xjavadoc;
  
  import java.io.File;
  import java.io.Serializable;
  import java.util.Arrays;
  
  /**
   * This class represents a set of Java source files. It designs a directory and
   * an optional array of files. The size() and getQualifiedName( int ) methods
   * depend on what files were passed in the constructor. The getSourceFile(
   * String ) will work regardless of wether the class was instantiated with files
   * or not (provided the file exists).
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
   * @created 14. mars 2002
   */
  public class SourceSet implements Serializable {
        /**
         * @todo-javadoc Describe the field
         */
        private File _dir;
        /**
         * @todo-javadoc Describe the field
         */
        private String[] _files;
  
  
        /**
         * Describe what the SourceSet constructor does
         *
         * @param dir Describe what the parameter does
         * @param files Describe what the parameter does
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method parameter
         */
        public SourceSet(File dir, String[] files) {
                _dir = dir;
                _files = files;
        }
  
  
        /**
         * Gets the SourceFile attribute of the SourceSet object
         *
         * @param qualifiedName Describe what the parameter does
         * @return The SourceFile value
         * @todo-javadoc Write javadocs for method parameter
         */
        public File getSourceFile(String qualifiedName) {
                File sourceFile = new File(_dir, relativeFileName(qualifiedName));
                if (!sourceFile.exists()) {
                        sourceFile = null;
                }
                return sourceFile;
        }
  
  
        /**
         * Gets the QualifiedName attribute of the SourceSet object
         *
         * @param i Describe what the parameter does
         * @return The QualifiedName value
         * @todo-javadoc Write javadocs for method parameter
         */
        public String getQualifiedName(int i) {
                return qualifiedName(_files[i]);
        }
  
  
        /**
         * Describe what the method does
         *
         * @param o Describe what the parameter does
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
        public boolean equals(Object o) {
                if (o instanceof SourceSet) {
                        SourceSet other = (SourceSet)o;
                        return _dir.equals(other._dir) && Arrays.equals(_files, 
other._files);
                }
                else {
                        return false;
                }
        }
  
  
        /**
         * Describe what the method does
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
        public int hashCode() {
                int result = _dir.hashCode();
                if (_files != null) {
                        for (int i = 0; i < _files.length; i++) {
                                result += _files.hashCode();
                        }
                }
                return result;
        }
  
  
        /**
         * Describe what the method does
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
        public int size() {
                return _files != null ? _files.length : 0;
        }
  
  
        /**
         * Describe what the method does
         *
         * @param relativeFileName Describe what the parameter does
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
        private String qualifiedName(String relativeFileName) {
                String result = relativeFileName.replace('/', '.').replace('\\', '.');
                result = result.substring(0, result.length() - 5);
                return result;
        }
  
  
        /**
         * Describe what the method does
         *
         * @param qualifiedName Describe what the parameter does
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
        private String relativeFileName(String qualifiedName) {
                return qualifiedName.replace('.', File.separatorChar) + ".java";
        }
  }
  
  
  
  
  1.1                  xjavadoc/src/xjavadoc/XMember.java
  
  Index: XMember.java
  ===================================================================
  /*
   * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without modification,
   * are permitted provided that the following conditions are met:
   *
   * - Redistributions of source code must retain the above copyright notice,
   *   this list of conditions and the following disclaimer.
   *
   * - Redistributions in binary form must reproduce the above copyright
   *   notice, this list of conditions and the following disclaimer in the
   *   documentation and/or other materials provided with the distribution.
   *
   * - Neither the name of BEKK Consulting nor the names of its
   *   contributors may be used to endorse or promote products derived from
   *   this software without specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
   * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
   * DAMAGE.
   */
  
  /*
   * Change log
   *
   */
  package xjavadoc;
  
  /**
   * This is just a marker interface to be able to distinguish between class
   * members and classes. Used in XDoc.superdoc().
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
   * @created 12. mars 2002
   */
  public interface XMember extends XProgramElement {
  }
  
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to