User: ara_e_w 
  Date: 02/02/17 13:12:08

  Modified:    src/xjavadoc/parser JavadocVisitor.java SourceClass.java
                        SourceConstructor.java SourceExecutableMember.java
                        SourceMethod.java TraverseVisitor.java
  Added:       src/xjavadoc/parser AbstractProgramElement.java
                        SourceField.java
  Log:
  - more compatible with doclet api
  - modifiers scanning for top level classes
  - ....!
  
  Revision  Changes    Path
  1.8       +70 -2     xjavadoc/src/xjavadoc/parser/JavadocVisitor.java
  
  Index: JavadocVisitor.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/JavadocVisitor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- JavadocVisitor.java       11 Feb 2002 14:11:57 -0000      1.7
  +++ JavadocVisitor.java       17 Feb 2002 21:12:08 -0000      1.8
  @@ -118,6 +118,32 @@
                };
   
        /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private PrintVisitor _classModifierDeclVisitor =
  +             new PrintVisitor() {
  +                     protected void print(Token t, PrintStream out) {
  +
  +                             Token tt = t.specialToken;
  +                             if (tt != null) {
  +                                     while (tt.specialToken != null) {
  +                                             tt = tt.specialToken;
  +                                     }
  +                                     while (tt != null) {
  +                                             if (isModifierToken(tt)) {
  +                                                     
out.print(addUnicodeEscapes(tt.image) + " ");
  +                                             }
  +                                             tt = tt.next;
  +                                     }
  +                             }
  +
  +                             if (isModifierToken(t)) {
  +                                     out.print(addUnicodeEscapes(t.image) + " ");
  +                             }
  +                     }
  +             };
  +
  +     /**
         * Get static reference to Log4J Logger
         */
        private static org.apache.log4j.Category _log = 
org.apache.log4j.Category.getInstance(JavadocVisitor.class.getName());
  @@ -213,6 +239,28 @@
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         */
  +     public Object visit(ASTClassModifierDeclaration node, Object data) {
  +
  +             String class_modifier_str = toString(_classModifierDeclVisitor, node);
  +             SourceClass clazz = (SourceClass)data;
  +
  +             clazz.setModifiers(class_modifier_str);
  +
  +             return super.visit(node, data);
  +     }
  +
  +
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param node Describe what the parameter does
  +      * @param data 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 Object visit(ASTClassDeclaration node, Object data) {
                // set javadoc
                Token javaDoc = (Token)super.visit(node, data);
  @@ -222,6 +270,7 @@
                else {
                        _log.debug("No javadoc");
                }
  +
                return null;
        }
   
  @@ -358,7 +407,7 @@
         * @todo-javadoc Write javadocs for return value
         */
        public Object visit(ASTMethodDeclaration node, Object data) {
  -             _currentMethod = new SourceMethod(((SourceClass)data), 
node.getFirstToken());
  +             _currentMethod = new SourceMethod(((SourceClass)data));
                _currentExecutableMember = _currentMethod;
   
                _currentMethodDeclaration = node;
  @@ -444,6 +493,10 @@
                        _currentMethod.setDoc(javaDocToken);
                }
   
  +             //System.out.println("::::_currentMethod=" + 
_currentMethod.toString());
  +             //System.out.println("*****=" + toString(_printCodeVisitor, node));
  +             //getModifier(node);
  +
                return javaDocToken;
        }
   
  @@ -460,7 +513,7 @@
         * @todo-javadoc Write javadocs for return value
         */
        public Object visit(ASTConstructorDeclaration node, Object data) {
  -             _currentConstructor = new SourceConstructor(((SourceClass)data), 
node.getFirstToken());
  +             _currentConstructor = new SourceConstructor(((SourceClass)data));
                _currentExecutableMember = _currentConstructor;
                ((SourceClass)data).addConstructor(_currentConstructor);
   
  @@ -545,6 +598,21 @@
                                }
                        }
                }
  +     }
  +
  +
  +     /**
  +      * Gets the ModifierToken attribute of the JavadocVisitor object
  +      *
  +      * @param tt Describe what the parameter does
  +      * @return The ModifierToken value
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     private boolean isModifierToken(Token tt) {
  +             return tt.kind == JavaParserConstants.PUBLIC ||
  +                             tt.kind == JavaParserConstants.ABSTRACT ||
  +                             tt.kind == JavaParserConstants.FINAL ||
  +                             tt.kind == JavaParserConstants.STRICTFP;
        }
   
   
  
  
  
  1.15      +11 -19    xjavadoc/src/xjavadoc/parser/SourceClass.java
  
  Index: SourceClass.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/SourceClass.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -r1.14 -r1.15
  --- SourceClass.java  11 Feb 2002 14:11:57 -0000      1.14
  +++ SourceClass.java  17 Feb 2002 21:12:08 -0000      1.15
  @@ -44,7 +44,7 @@
    * @author Aslak Helles�y
    * @created 3. januar 2002
    */
  -public class SourceClass extends XClass {
  +public class SourceClass extends AbstractClass {
   
        /**
         * @todo-javadoc Describe the field
  @@ -64,11 +64,6 @@
        /**
         * @todo-javadoc Describe the field
         */
  -     private final XJavaDoc _xJavaDoc;
  -
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
        private HashMap _fields = new HashMap();
   
        /**
  @@ -207,7 +202,6 @@
        /**
         * Describe what the SourceClass constructor does
         *
  -      * @param xJavaDoc Describe what the parameter does
         * @param compilationUnit Describe what the parameter does
         * @param qualifiedName Describe what the parameter does
         * @todo-javadoc Write javadocs for constructor
  @@ -216,9 +210,7 @@
         * @todo-javadoc Write javadocs for method parameter
         */
   
  -     public SourceClass(XJavaDoc xJavaDoc, ASTCompilationUnit compilationUnit, 
String qualifiedName) {
  -
  -             _xJavaDoc = xJavaDoc;
  +     public SourceClass(ASTCompilationUnit compilationUnit, String qualifiedName) {
   
                _compilationUnit = compilationUnit;
   
  @@ -675,7 +667,7 @@
   
        void setContainingPackage(String packageName) {
   
  -             XPackage pakkage = _xJavaDoc.addPackageMaybe(packageName);
  +             XPackage pakkage = XJavaDoc.getInstance().addPackageMaybe(packageName);
   
                _containingPackage = pakkage;
   
  @@ -816,7 +808,7 @@
   
        void addImportedPackage(String packageName) {
   
  -             XPackage pakkage = _xJavaDoc.addPackageMaybe(packageName);
  +             XPackage pakkage = XJavaDoc.getInstance().addPackageMaybe(packageName);
   
                _importedPackages.add(pakkage);
   
  @@ -858,7 +850,7 @@
   
                        qualifiedClassName = unqualifiedClassName;
   
  -                     result = _xJavaDoc.getXClass(qualifiedClassName);
  +                     result = XJavaDoc.getInstance().getXClass(qualifiedClassName);
   
                }
   
  @@ -891,7 +883,7 @@
   
                        //}????
   
  -                     result = _xJavaDoc.getUnknownClass(containingPackage().name() 
+ "." + unqualifiedClassName);
  +                     result = 
XJavaDoc.getInstance().getUnknownClass(containingPackage().name() + "." + 
unqualifiedClassName);
   
                }
   
  @@ -916,7 +908,7 @@
   
                        String qualifiedClassName = unqualifiedClassName;
   
  -                     result = _xJavaDoc.getXClass(qualifiedClassName);
  +                     result = XJavaDoc.getInstance().getXClass(qualifiedClassName);
   
                        if (result == null) {
   
  @@ -955,7 +947,7 @@
   
                                String matchedImportedClass = imported_class_str;
   
  -                             XClass clazz = _xJavaDoc.getXClass(imported_class_str);
  +                             XClass clazz = 
XJavaDoc.getInstance().getXClass(imported_class_str);
   
                                if (result != null) {
   
  @@ -972,7 +964,7 @@
   
                                        // found an import match, but couldn't find 
the class
   
  -                                     result = 
_xJavaDoc.getUnknownClass(unqualifiedClassName);
  +                                     result = 
XJavaDoc.getInstance().getUnknownClass(unqualifiedClassName);
   
                                }
   
  @@ -1006,7 +998,7 @@
   
                        String qualifiedClassName = importedPackage.name() + "." + 
unqualifiedClassName;
   
  -                     XClass clazz = _xJavaDoc.getXClass(qualifiedClassName);
  +                     XClass clazz = 
XJavaDoc.getInstance().getXClass(qualifiedClassName);
   
                        if (result != null && clazz != null) {
   
  @@ -1040,7 +1032,7 @@
   
                String qualifiedClassName = containingPackage().name() + "." + 
unqualifiedClassName;
   
  -             XClass clazz = _xJavaDoc.getXClass(qualifiedClassName);
  +             XClass clazz = XJavaDoc.getInstance().getXClass(qualifiedClassName);
   
                if (result != null && clazz != null) {
   
  
  
  
  1.5       +3 -4      xjavadoc/src/xjavadoc/parser/SourceConstructor.java
  
  Index: SourceConstructor.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/SourceConstructor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- SourceConstructor.java    20 Jan 2002 16:53:35 -0000      1.4
  +++ SourceConstructor.java    17 Feb 2002 21:12:08 -0000      1.5
  @@ -12,7 +12,7 @@
    *   notice, this list of conditions and the following disclaimer in the
    *   documentation and/or other materials provided with the distribution.
    *
  - * - Neither the name of the BEKK Consulting nor the names of its
  + * - 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.
    *
  @@ -51,13 +51,12 @@
         * Describe what the SourceConstructor constructor does
         *
         * @param containingClass Describe what the parameter does
  -      * @param token 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
         */
  -     SourceConstructor(SourceClass containingClass, Token token) {
  -             super(containingClass, token);
  +     SourceConstructor(SourceClass containingClass) {
  +             super(containingClass);
        }
   
   
  
  
  
  1.9       +2 -23     xjavadoc/src/xjavadoc/parser/SourceExecutableMember.java
  
  Index: SourceExecutableMember.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/SourceExecutableMember.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- SourceExecutableMember.java       11 Feb 2002 14:11:57 -0000      1.8
  +++ SourceExecutableMember.java       17 Feb 2002 21:12:08 -0000      1.9
  @@ -50,7 +50,7 @@
    * @created 8. januar 2002
    * @todo-javadoc Write javadocs
    */
  -public abstract class SourceExecutableMember implements XExecutableMember {
  +public abstract class SourceExecutableMember extends AbstractProgramElement 
implements XExecutableMember {
        /**
         * @todo-javadoc Describe the field
         */
  @@ -68,29 +68,17 @@
         */
        private final ArrayList _thrownExceptions = new ArrayList();
   
  -     /**
  -      * @todo refactor
  -      */
  -     private XDoc _doc;
  -
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
  -     private final Token _memberToken;
  -
   
        /**
         * Describe what the SourceExecutableMember constructor does
         *
         * @param containingClass Describe what the parameter does
  -      * @param memberToken Describe what the parameter does
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         */
  -     SourceExecutableMember(SourceClass containingClass, Token memberToken) {
  +     SourceExecutableMember(SourceClass containingClass) {
                _containingClass = containingClass;
  -             _memberToken = memberToken;
        }
   
   
  @@ -109,15 +97,6 @@
                        // will be indented totally left
                        javadocToken.previous = null;
   
  -//                   System.out.println();
  -//                   System.out.println();
  -//                   System.out.println();
  -//                   System.out.println(_memberToken.image);
  -//                   System.out.println();
  -//                   System.out.println();
  -//                   System.out.println();
  -
  -                     _memberToken.specialToken = javadocToken;
                        _doc = new XDoc(javadocToken);
                }
                return _doc;
  
  
  
  1.7       +2 -3      xjavadoc/src/xjavadoc/parser/SourceMethod.java
  
  Index: SourceMethod.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/SourceMethod.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- SourceMethod.java 11 Feb 2002 14:11:57 -0000      1.6
  +++ SourceMethod.java 17 Feb 2002 21:12:08 -0000      1.7
  @@ -68,13 +68,12 @@
         * Describe what the SourceMethod constructor does
         *
         * @param containingClass Describe what the parameter does
  -      * @param token Describe what the parameter does
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         */
  -     SourceMethod(SourceClass containingClass, Token token) {
  -             super(containingClass, token);
  +     SourceMethod(SourceClass containingClass) {
  +             super(containingClass);
        }
   
   
  
  
  
  1.5       +23 -93    xjavadoc/src/xjavadoc/parser/TraverseVisitor.java
  
  Index: TraverseVisitor.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/parser/TraverseVisitor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- TraverseVisitor.java      20 Jan 2002 16:53:35 -0000      1.4
  +++ TraverseVisitor.java      17 Feb 2002 21:12:08 -0000      1.5
  @@ -12,7 +12,7 @@
    *   notice, this list of conditions and the following disclaimer in the
    *   documentation and/or other materials provided with the distribution.
    *
  - * - Neither the name of the BEKK Consulting nor the names of its
  + * - 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.
    *
  @@ -35,93 +35,7 @@
    */
   package xjavadoc.parser;
   
  -import xjavadoc.ast.ASTAdditiveExpression;
  -import xjavadoc.ast.ASTAllocationExpression;
  -import xjavadoc.ast.ASTAndExpression;
  -import xjavadoc.ast.ASTArgumentList;
  -import xjavadoc.ast.ASTArguments;
  -import xjavadoc.ast.ASTArrayDimsAndInits;
  -import xjavadoc.ast.ASTArrayInitializer;
  -import xjavadoc.ast.ASTAssignmentOperator;
  -import xjavadoc.ast.ASTBlock;
  -import xjavadoc.ast.ASTBlockStatement;
  -import xjavadoc.ast.ASTBooleanLiteral;
  -import xjavadoc.ast.ASTBreakStatement;
  -import xjavadoc.ast.ASTCastExpression;
  -import xjavadoc.ast.ASTCastLookahead;
  -import xjavadoc.ast.ASTClassBody;
  -import xjavadoc.ast.ASTClassBodyDeclaration;
  -import xjavadoc.ast.ASTClassDeclaration;
  -import xjavadoc.ast.ASTCompilationUnit;
  -import xjavadoc.ast.ASTConditionalAndExpression;
  -import xjavadoc.ast.ASTConditionalExpression;
  -import xjavadoc.ast.ASTConditionalOrExpression;
  -import xjavadoc.ast.ASTConstructorDeclaration;
  -import xjavadoc.ast.ASTContinueStatement;
  -import xjavadoc.ast.ASTDoStatement;
  -import xjavadoc.ast.ASTEmptyStatement;
  -import xjavadoc.ast.ASTEqualityExpression;
  -import xjavadoc.ast.ASTExclusiveOrExpression;
  -import xjavadoc.ast.ASTExplicitConstructorInvocation;
  -import xjavadoc.ast.ASTExpression;
  -import xjavadoc.ast.ASTFieldDeclaration;
  -import xjavadoc.ast.ASTForInit;
  -import xjavadoc.ast.ASTFormalParameter;
  -import xjavadoc.ast.ASTFormalParameters;
  -import xjavadoc.ast.ASTForStatement;
  -import xjavadoc.ast.ASTForUpdate;
  -import xjavadoc.ast.ASTIfStatement;
  -import xjavadoc.ast.ASTImportDeclaration;
  -import xjavadoc.ast.ASTInclusiveOrExpression;
  -import xjavadoc.ast.ASTInitializer;
  -import xjavadoc.ast.ASTInstanceOfExpression;
  -import xjavadoc.ast.ASTInterfaceDeclaration;
  -import xjavadoc.ast.ASTInterfaceMemberDeclaration;
  -import xjavadoc.ast.ASTLabeledStatement;
  -import xjavadoc.ast.ASTLiteral;
  -import xjavadoc.ast.ASTLocalVariableDeclaration;
  -import xjavadoc.ast.ASTMethodDeclaration;
  -import xjavadoc.ast.ASTMethodDeclarationLookahead;
  -import xjavadoc.ast.ASTMethodDeclarator;
  -import xjavadoc.ast.ASTMultiplicativeExpression;
  -import xjavadoc.ast.ASTName;
  -import xjavadoc.ast.ASTNameList;
  -import xjavadoc.ast.ASTNestedClassDeclaration;
  -import xjavadoc.ast.ASTNestedInterfaceDeclaration;
  -import xjavadoc.ast.ASTNullLiteral;
  -import xjavadoc.ast.ASTPackageDeclaration;
  -import xjavadoc.ast.ASTPostfixExpression;
  -import xjavadoc.ast.ASTPreDecrementExpression;
  -import xjavadoc.ast.ASTPreIncrementExpression;
  -import xjavadoc.ast.ASTPrimaryExpression;
  -import xjavadoc.ast.ASTPrimaryPrefix;
  -import xjavadoc.ast.ASTPrimarySuffix;
  -import xjavadoc.ast.ASTPrimitiveType;
  -import xjavadoc.ast.ASTRelationalExpression;
  -import xjavadoc.ast.ASTResultType;
  -import xjavadoc.ast.ASTReturnStatement;
  -import xjavadoc.ast.ASTShiftExpression;
  -import xjavadoc.ast.ASTStatement;
  -import xjavadoc.ast.ASTStatementExpression;
  -import xjavadoc.ast.ASTStatementExpressionList;
  -import xjavadoc.ast.ASTSwitchLabel;
  -import xjavadoc.ast.ASTSwitchStatement;
  -import xjavadoc.ast.ASTSynchronizedStatement;
  -import xjavadoc.ast.ASTThrowStatement;
  -import xjavadoc.ast.ASTTryStatement;
  -import xjavadoc.ast.ASTType;
  -import xjavadoc.ast.ASTTypeDeclaration;
  -import xjavadoc.ast.ASTUnaryExpression;
  -import xjavadoc.ast.ASTUnaryExpressionNotPlusMinus;
  -import xjavadoc.ast.ASTUnmodifiedClassDeclaration;
  -import xjavadoc.ast.ASTUnmodifiedInterfaceDeclaration;
  -import xjavadoc.ast.ASTVariableDeclarator;
  -import xjavadoc.ast.ASTVariableDeclaratorId;
  -import xjavadoc.ast.ASTVariableInitializer;
  -import xjavadoc.ast.ASTWhileStatement;
  -import xjavadoc.ast.JavaParserVisitor;
  -import xjavadoc.ast.Node;
  -import xjavadoc.ast.SimpleNode;
  +import xjavadoc.ast.*;
   
   /**
    * Describe what this class does
  @@ -1492,6 +1406,27 @@
        }
   
   
  +     /*
  +      *  public Object visit(ASTMethodModifiers node, Object data) {
  +      *  return traverse( node, data );
  +      *  }
  +      */
  +     /**
  +      * Describe what the method does
  +      *
  +      * @param node Describe what the parameter does
  +      * @param data 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 Object visit(ASTClassModifierDeclaration node, Object data) {
  +             return traverse(node, data);
  +     }
  +
  +
        /**
         * @todo use SimpleNode.childrenAccept instead
         * @param node Describe what the parameter does
  @@ -1509,9 +1444,4 @@
                }
                return data;
        }
  -     /*
  -      *  public Object visit(ASTMethodModifiers node, Object data) {
  -      *  return traverse( node, data );
  -      *  }
  -      */
   }
  
  
  
  1.1                  xjavadoc/src/xjavadoc/parser/AbstractProgramElement.java
  
  Index: AbstractProgramElement.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.parser;
  
  import xjavadoc.XProgramElement;
  import xjavadoc.XClass;
  import xjavadoc.XDoc;
  import xjavadoc.XPackage;
  import xjavadoc.ast.Token;
  import xjavadoc.ast.JavaParserConstants;
  
  import java.lang.reflect.Modifier;
  
  /**
   * Describe what this class does
   *
   * @author Ara Abrahamian
   * @created February 17, 2002
   * @todo-javadoc Write javadocs
   */
  public abstract class AbstractProgramElement implements XProgramElement {
  
        /**
         * @todo-javadoc Describe the field
         */
        protected String _qualifiedName;
  
        /**
         * @todo-javadoc Describe the field
         */
        protected String _name;
  
        /**
         * @todo-javadoc Describe the field
         */
        protected int _modifiers = 0;
  
        /**
         * @todo refactor
         */
        protected XDoc _doc;
  
  
        /**
         * Describe what the setModifiers constructor does
         *
         * @param modifiers Describe what the parameter does
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         */
        public void setModifiers(String modifiers) {
  
                java.util.StringTokenizer st = new 
java.util.StringTokenizer(modifiers);
  
                while (st.hasMoreTokens()) {
                        String modifier = st.nextToken();
                        if (modifier.equals("abstract")) {
                                this._modifiers |= Modifier.ABSTRACT;
                        }
                        else if (modifier.equals("public")) {
                                this._modifiers |= Modifier.PUBLIC;
                        }
                        else if (modifier.equals("final")) {
                                this._modifiers |= Modifier.FINAL;
                        }
                        else if (modifier.equals("strictfp")) {
                                this._modifiers |= Modifier.STRICT;
                        }
                }
        }
  
  
        /**
         * Gets the Final attribute of the AbstractProgramElement object
         *
         * @return The Final value
         */
        public boolean isFinal() {
                return (_modifiers & Modifier.FINAL) != 0;
        }
  
  
        /**
         * Gets the PackagePrivate attribute of the AbstractProgramElement object
         *
         * @return The PackagePrivate value
         */
        public boolean isPackagePrivate() {
                return isPrivate() == false && isProtected() == false && isPublic() == 
false;
        }
  
  
        /**
         * Gets the Private attribute of the AbstractProgramElement object
         *
         * @return The Private value
         */
        public boolean isPrivate() {
                return (_modifiers & Modifier.PRIVATE) != 0;
        }
  
  
        /**
         * Gets the Protected attribute of the AbstractProgramElement object
         *
         * @return The Protected value
         */
        public boolean isProtected() {
                return (_modifiers & Modifier.PROTECTED) != 0;
        }
  
  
        /**
         * Gets the Public attribute of the AbstractProgramElement object
         *
         * @return The Public value
         */
        public boolean isPublic() {
                return (_modifiers & Modifier.PUBLIC) != 0;
        }
  
  
        /**
         * Gets the Static attribute of the AbstractProgramElement object
         *
         * @return The Static value
         */
        public boolean isStatic() {
                return (_modifiers & Modifier.STATIC) != 0;
        }
  
  
        /**
         * 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 name() {
                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 String qualifiedName() {
                return _qualifiedName;
        }
  
  
        /**
         * Describe what the method does
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
        public XDoc doc() {
                if (_doc == null) {
                        // there was no doc in the original source. Create it.
                        // We have to create a new token and attach it to
                        Token javadocToken = 
Token.newToken(JavaParserConstants.FORMAL_COMMENT);
                        // will be indented totally left
                        javadocToken.previous = null;
  
                        _doc = new XDoc(javadocToken);
                }
                return _doc;
        }
  
  
        /**
         * Get modifiers string.
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for return value
         */
        public String modifiers() {
                return Modifier.toString(_modifiers);
        }
  
  
        /**
         * Get the modifier specifier integer.
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for return value
         */
        public int modifierSpecifier() {
                return _modifiers;
        }
  
  
        /**
         * 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 containingClass() {
                return null;
        }
  
  
        /**
         * Describe what the method does
         *
         * @return Describe the return value
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for return value
         */
        public XPackage containingPackage() {
                return containingClass().containingPackage();
        }
  
  
        /**
         * Sets the Doc attribute of the SourceExecutableMember object
         *
         * @param javaDoc The new Doc value
         */
        void setDoc(Token javaDoc) {
                if (_doc != null) {
                        throw new IllegalStateException("Doc has already been set!!");
                }
                _doc = new XDoc(javaDoc);
        }
  
  }
  
  
  
  1.1                  xjavadoc/src/xjavadoc/parser/SourceField.java
  
  Index: SourceField.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.parser;
  
  import xjavadoc.XField;
  import xjavadoc.XDoc;
  import xjavadoc.ast.Token;
  
  /**
   * @author Ara Abrahamian ([EMAIL PROTECTED])
   * @created Feb 15, 2002
   * @version $Revision: 1.1 $
   */
  public class SourceField extends AbstractProgramElement implements XField {
        /**
         * Describe what the SourceMethod constructor does
         *
         * @param containingClass Describe what the parameter does
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for constructor
         * @todo-javadoc Write javadocs for method parameter
         */
        SourceField(SourceClass containingClass) {
                super(
                /*
                 *  containingClass,
                 */
                                );
        }
  
  
        /**
         * @todo implement it properly
         * @return The Transient value
         */
        public boolean isTransient() {
                return false;
        }
  
  
        /**
         * @todo implement it properly
         * @return The Volatile value
         */
        public boolean isVolatile() {
                return false;
        }
  }
  
  
  

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

Reply via email to