KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > doc > javadoc > JavadocFile


1 /*
2  * Copyright (c) 1998-2003 Caucho Technology -- all rights reserved
3  *
4  * Caucho Technology permits redistribution, modification and use
5  * of this file in source and binary form ("the Software") under the
6  * Caucho Developer Source License ("the License"). The following
7  * conditions must be met:
8  *
9  * 1. Each copy or derived work of the Software must preserve the copyright
10  * notice and this notice unmodified.
11  *
12  * 2. Redistributions of the Software in source or binary form must include
13  * an unmodified copy of the License, normally in a plain ASCII text
14  *
15  * 3. The names "Resin" or "Caucho" are trademarks of Caucho Technology and
16  * may not be used to endorse products derived from this software.
17  * "Resin" or "Caucho" may not appear in the names of products derived
18  * from this software.
19  *
20  * This Software is provided "AS IS," without a warranty of any kind.
21  * ALL EXPRESS OR IMPLIED REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
22  * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
23  * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
24  *
25  * CAUCHO TECHNOLOGY AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
26  * SUFFERED BY LICENSEE OR ANY THIRD PARTY AS A RESULT OF USING OR
27  * DISTRIBUTING SOFTWARE. IN NO EVENT WILL CAUCHO OR ITS LICENSORS BE LIABLE
28  * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
29  * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
30  * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
31  * INABILITY TO USE SOFTWARE, EVEN IF HE HAS BEEN ADVISED OF THE POSSIBILITY
32  * OF SUCH DAMAGES.
33  *
34  * @author Sam
35  */

36
37 package com.caucho.doc.javadoc;
38
39 import com.caucho.log.Log;
40 import com.caucho.util.CharBuffer;
41 import com.caucho.util.L10N;
42
43 import java.util.logging.Logger JavaDoc;
44
45 /**
46  * A Javadoc generated HTML file.
47  */

48 public class JavadocFile {
49   static protected final Logger JavaDoc log = Log.open(JavadocFile.class);
50   static final L10N L = new L10N(JavadocFile.class);
51
52   private Api _api;
53   private int _id = Integer.MAX_VALUE;
54   private String JavaDoc _path;
55
56   private String JavaDoc _href;
57
58   /**
59    *
60    */

61   JavadocFile(Api api, int id, String JavaDoc path)
62   {
63     _api = api;
64     _id = id;
65     _path = path;
66     init();
67   }
68
69   JavadocFile(Api api, String JavaDoc path)
70   {
71     _api = api;
72     _path = path;
73     init();
74   }
75
76   private void init()
77   {
78     CharBuffer cb = CharBuffer.allocate();
79     Api api = getApi();
80     _href = api.getLocationHref(_path);
81   }
82
83   public Api getApi()
84   {
85     return _api;
86   }
87
88   int getId()
89   {
90     if (_id == Integer.MAX_VALUE)
91       throw new RuntimeException JavaDoc("_id not init in JavadocFile");
92     return _id;
93   }
94
95   public String JavaDoc getPath()
96   {
97     return _path;
98   }
99
100   public String JavaDoc getHref()
101   {
102     return _href;
103   }
104
105 }
106
107
Popular Tags