KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > tools > ajdoc > rootmakers > Javadoc13


1 /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the debugger and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  */

22 package org.aspectj.tools.ajdoc.rootmakers;
23
24 import com.sun.javadoc.RootDoc;
25 import com.sun.javadoc.DocErrorReporter;
26 import java.lang.reflect.Method JavaDoc;
27 import java.util.List JavaDoc;
28 import org.aspectj.tools.ajdoc.AccessChecker;
29 import org.aspectj.tools.ajdoc.RootDocMaker;
30 import org.aspectj.tools.ajdoc.CannotMakeRootDocException;
31
32 /**
33  * Makes a RootDoc using javadoc from SDK 1.3 as an example.
34  *
35  * @author Jeff Palm
36  */

37 public class Javadoc13 extends Javadoc implements RootDocMaker {
38
39     public Javadoc13() {}
40     public RootDoc makeRootDoc(String JavaDoc sourcepath,
41                                String JavaDoc classpath,
42                                String JavaDoc bootclasspath,
43                                String JavaDoc extdirs,
44                                long flags,
45                                String JavaDoc encoding,
46                                String JavaDoc locale,
47                                String JavaDoc source,
48                                List JavaDoc classesAndPackages,
49                                List JavaDoc options,
50                                DocErrorReporter messager,
51                                String JavaDoc programName,
52                                AccessChecker filter)
53         throws CannotMakeRootDocException {
54         // todo: options ignored in 13?
55
Class JavaDoc envClass = type("com.sun.tools.javadoc.Env");
56         if (envClass == null) return null;
57         Method JavaDoc create = method("create", new Class JavaDoc[]{String JavaDoc.class,
58                                                      String JavaDoc.class,
59                                                      String JavaDoc.class,
60                                                      String JavaDoc.class,
61                                                      int.class,
62                                                      String JavaDoc.class},
63                                envClass);
64         if (create == null) return null;
65         Object JavaDoc env = invoke(create, null, new Object JavaDoc[]{sourcepath,
66                                                        classpath,
67                                                        bootclasspath,
68                                                        extdirs,
69                                                        new Integer JavaDoc((int)flags),
70                                                        encoding});
71         if (env == null) return null;
72         
73
74         return null;
75     }
76
77 }
78
Popular Tags