Produced by Araxis Merge on 9/25/2018 2:13:05 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\tools\doclets\formats\html | HtmlDoclet.java | Mon Jan 22 14:47:06 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\tools\doclets\formats\html | HtmlDoclet.java | Wed Sep 12 16:43:48 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 666 |
Changed | 1 | 4 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /* | |
2 | * Copyrig ht (c) 199 7, 2016, O racle and/ or its aff iliates. A ll rights reserved. | |
3 | * DO NOT ALTER OR R EMOVE COPY RIGHT NOTI CES OR THI S FILE HEA DER. | |
4 | * | |
5 | * This co de is free software; you can r edistribut e it and/o r modify i t | |
6 | * under t he terms o f the GNU General Pu blic Licen se version 2 only, a s | |
7 | * publish ed by the Free Softw are Founda tion. Ora cle design ates this | |
8 | * particu lar file a s subject to the "Cl asspath" e xception a s provided | |
9 | * by Orac le in the LICENSE fi le that ac companied this code. | |
10 | * | |
11 | * This co de is dist ributed in the hope that it wi ll be usef ul, but WI THOUT | |
12 | * ANY WAR RANTY; wit hout even the implie d warranty of MERCHA NTABILITY or | |
13 | * FITNESS FOR A PAR TICULAR PU RPOSE. Se e the GNU General Pu blic Licen se | |
14 | * version 2 for mor e details (a copy is included in the LIC ENSE file that | |
15 | * accompa nied this code). | |
16 | * | |
17 | * You sho uld have r eceived a copy of th e GNU Gene ral Public License v ersion | |
18 | * 2 along with this work; if not, write to the Fr ee Softwar e Foundati on, | |
19 | * Inc., 5 1 Franklin St, Fifth Floor, Bo ston, MA 0 2110-1301 USA. | |
20 | * | |
21 | * Please contact Or acle, 500 Oracle Par kway, Redw ood Shores , CA 94065 USA | |
22 | * or visi t www.orac le.com if you need a dditional informatio n or have any | |
23 | * questio ns. | |
24 | */ | |
25 | package co m.sun.tool s.doclets. formats.ht ml; | |
26 | ||
27 | import jav a.io.*; | |
28 | import jav a.util.*; | |
29 | ||
30 | import com .sun.javad oc.*; | |
31 | import com .sun.tools .javac.sym .Profiles; | |
32 | import com .sun.tools .javac.jvm .Profile; | |
33 | import com .sun.tools .doclets.i nternal.to olkit.*; | |
34 | import com .sun.tools .doclets.i nternal.to olkit.buil ders.*; | |
35 | import com .sun.tools .doclets.i nternal.to olkit.util .*; | |
36 | ||
37 | /** | |
38 | * The cla ss with "s tart" meth od, calls individual Writers. | |
39 | * | |
40 | * <p><b> This is NO T part of any suppor ted API. | |
41 | * If you write cod e that dep ends on th is, you do so at you r own risk . | |
42 | * This c ode and it s internal interface s are subj ect to cha nge or | |
43 | * deleti on without notice.</ b> | |
44 | * | |
45 | * @author Atul M Da mbalkar | |
46 | * @author Robert Fi eld | |
47 | * @author Jamie Ho | |
48 | * | |
49 | */ | |
50 | public cla ss HtmlDoc let extend s Abstract Doclet { | |
51 | // An instance w ill be cre ated by va lidOptions , and used by start. | |
52 | privat e static H tmlDoclet docletToSt art = null ; | |
53 | ||
54 | public HtmlDocle t() { | |
55 | co nfiguratio n = new Co nfiguratio nImpl(); | |
56 | } | |
57 | ||
58 | /** | |
59 | * The global co nfiguratio n informat ion for th is run. | |
60 | */ | |
61 | public final Con figuration Impl confi guration; | |
62 | ||
63 | /** | |
64 | * The "start" m ethod as r equired by Javadoc. | |
65 | * | |
66 | * @pa ram root t he root of the docum entation t ree. | |
67 | * @se e com.sun. javadoc.Ro otDoc | |
68 | * @re turn true if the doc let ran wi thout enco untering a ny errors. | |
69 | */ | |
70 | public static bo olean star t(RootDoc root) { | |
71 | // In typica l use, opt ions will have been set up by calling va lidOptions , | |
72 | // which wil l create a n HtmlDocl et for use here. | |
73 | Ht mlDoclet d oclet; | |
74 | if (docletTo Start != n ull) { | |
75 | doclet = docletToS tart; | |
76 | docletTo Start = nu ll; | |
77 | } else { | |
78 | doclet = new HtmlD oclet(); | |
79 | } | |
80 | re turn docle t.start(do clet, root ); | |
81 | } | |
82 | ||
83 | /** | |
84 | * Cre ate the co nfiguratio n instance . | |
85 | * Ove rride this method to use a dif ferent | |
86 | * con figuration . | |
87 | */ | |
88 | public Configura tion confi guration() { | |
89 | re turn confi guration; | |
90 | } | |
91 | ||
92 | /** | |
93 | * Sta rt the gen eration of files. Ca ll generat e methods in the ind ividual | |
94 | * wri ters, whic h will in turn genra te the doc umentation files. Ca ll the | |
95 | * Tre eWriter ge neration f irst to en sure the C lass Hiera rchy is bu ilt | |
96 | * fir st and the n can be u sed in the later gen eration. | |
97 | * | |
98 | * For new forma t. | |
99 | * | |
100 | * @se e com.sun. javadoc.Ro otDoc | |
101 | */ | |
102 | protec ted void g enerateOth erFiles(Ro otDoc root , ClassTre e classtre e) | |
103 | throws E xception { | |
104 | su per.genera teOtherFil es(root, c lasstree); | |
105 | if (configur ation.link source) { | |
106 | SourceTo HTMLConver ter.conver tRoot(conf iguration, | |
107 | root , DocPaths .SOURCE_OU TPUT); | |
108 | } | |
109 | ||
110 | if (configur ation.topF ile.isEmpt y()) { | |
111 | configur ation.stan dardmessag e. | |
112 | erro r("doclet. No_Non_Dep recated_Cl asses_To_D ocument"); | |
113 | return; | |
114 | } | |
115 | bo olean node precated = configura tion.nodep recated; | |
116 | pe rformCopy( configurat ion.helpfi le); | |
117 | pe rformCopy( configurat ion.styles heetfile); | |
118 | // do early to reduce memory foo tprint | |
119 | if (configur ation.clas suse) { | |
120 | ClassUse Writer.gen erate(conf iguration, classtree ); | |
121 | } | |
122 | In dexBuilder indexbuil der = new IndexBuild er(configu ration, no deprecated ); | |
123 | ||
124 | if (configur ation.crea tetree) { | |
125 | TreeWrit er.generat e(configur ation, cla sstree); | |
126 | } | |
127 | if (configur ation.crea teindex) { | |
128 | if (conf iguration. splitindex ) { | |
129 | Spli tIndexWrit er.generat e(configur ation, ind exbuilder) ; | |
130 | } else { | |
131 | Sing leIndexWri ter.genera te(configu ration, in dexbuilder ); | |
132 | } | |
133 | } | |
134 | ||
135 | if (!(config uration.no deprecated list || no deprecated )) { | |
136 | Deprecat edListWrit er.generat e(configur ation); | |
137 | } | |
138 | ||
139 | Al lClassesFr ameWriter. generate(c onfigurati on, | |
140 | new Inde xBuilder(c onfigurati on, nodepr ecated, tr ue)); | |
141 | ||
142 | Fr ameOutputW riter.gene rate(confi guration); | |
143 | ||
144 | if (configur ation.crea teoverview ) { | |
145 | PackageI ndexWriter .generate( configurat ion); | |
146 | } | |
147 | if (configur ation.help file.lengt h() == 0 & & | |
148 | !configu ration.noh elp) { | |
149 | HelpWrit er.generat e(configur ation); | |
150 | } | |
151 | // If a styl esheet fil e is not s pecified, copy the d efault sty lesheet | |
152 | // and repla ce newline with plat form-speci fic newlin e. | |
153 | Do cFile f; | |
154 | if (configur ation.styl esheetfile .length() == 0) { | |
155 | f = DocF ile.create FileForOut put(config uration, D ocPaths.ST YLESHEET); | |
156 | f.copyRe source(Doc Paths.RESO URCES.reso lve(DocPat hs.STYLESH EET), fals e, true); | |
157 | } | |
158 | f = DocFil e.createFi leForOutpu t(configur ation, Doc Paths.JA DN S IPT); | |
159 | f.copyReso urce(DocPa ths.RESOUR CES.resolv e(DocPaths .JA DN S IPT), true , true); | |
160 | } | |
161 | ||
162 | /** | |
163 | * {@i nheritDoc} | |
164 | */ | |
165 | protec ted void g enerateCla ssFiles(Cl assDoc[] a rr, ClassT ree classt ree) { | |
166 | Ar rays.sort( arr); | |
167 | fo r(int i = 0; i < arr .length; i ++) { | |
168 | if (!(co nfiguratio n.isGenera tedDoc(arr [i]) && ar r[i].isInc luded())) { | |
169 | cont inue; | |
170 | } | |
171 | ClassDoc prev = (i == 0)? | |
172 | null : | |
173 | arr[ i-1]; | |
174 | ClassDoc curr = ar r[i]; | |
175 | ClassDoc next = (i +1 == arr. length)? | |
176 | null : | |
177 | arr[ i+1]; | |
178 | try { | |
179 | if ( curr.isAnn otationTyp e()) { | |
180 | AbstractBu ilder anno tationType Builder = | |
181 | config uration.ge tBuilderFa ctory() | |
182 | .g etAnnotati onTypeBuil der((Annot ationTypeD oc) curr, | |
183 | prev, ne xt); | |
184 | annotation TypeBuilde r.build(); | |
185 | } el se { | |
186 | AbstractBu ilder clas sBuilder = | |
187 | config uration.ge tBuilderFa ctory() | |
188 | .g etClassBui lder(curr, prev, nex t, classtr ee); | |
189 | classBuild er.build() ; | |
190 | } | |
191 | } catch (IOExcepti on e) { | |
192 | thro w new Docl etAbortExc eption(e); | |
193 | } catch (FatalErro r fe) { | |
194 | thro w fe; | |
195 | } catch (DocletAbo rtExceptio n de) { | |
196 | thro w de; | |
197 | } catch (Exception e) { | |
198 | e.pr intStackTr ace(); | |
199 | thro w new Docl etAbortExc eption(e); | |
200 | } | |
201 | } | |
202 | } | |
203 | ||
204 | /** | |
205 | * {@i nheritDoc} | |
206 | */ | |
207 | protec ted void g eneratePro fileFiles( ) throws E xception { | |
208 | if (configur ation.show Profiles & & configur ation.prof ilePackage s.size() > 0) { | |
209 | ProfileI ndexFrameW riter.gene rate(confi guration); | |
210 | Profile prevProfil e = null, nextProfil e; | |
211 | String p rofileName ; | |
212 | for (int i = 1; i < configur ation.prof iles.getPr ofileCount (); i++) { | |
213 | prof ileName = Profile.lo okup(i).na me; | |
214 | // G enerate pr ofile pack age pages only if th ere are an y packages | |
215 | // i n a profil e to be do cumented. The profil ePackages map will n ot | |
216 | // c ontain an entry for the profil e if there are no pa ckages to be documen ted. | |
217 | if ( !configura tion.shoul dDocumentP rofile(pro fileName)) | |
218 | continue; | |
219 | Prof ilePackage IndexFrame Writer.gen erate(conf iguration, profileNa me); | |
220 | Pack ageDoc[] p ackages = configurat ion.profil ePackages. get( | |
221 | profil eName); | |
222 | Pack ageDoc pre v = null, next; | |
223 | for (int j = 0 ; j < pack ages.lengt h; j++) { | |
224 | // if -nod eprecated option is set and th e package is marked as | |
225 | // depreca ted, do no t generate the profi lename-pac kage-summa ry.html | |
226 | // and pro filename-p ackage-fra me.html pa ges for th at package . | |
227 | if (!(conf iguration. nodeprecat ed && Util .isDepreca ted(packag es[j]))) { | |
228 | Profil ePackageFr ameWriter. generate(c onfigurati on, packag es[j], i); | |
229 | next = (j + 1 < packages.l ength | |
230 | && packa ges[j + 1] .name().le ngth() > 0 ) ? packag es[j + 1] : null; | |
231 | Abstra ctBuilder profilePac kageSummar yBuilder = | |
232 | configur ation.getB uilderFact ory().getP rofilePack ageSummary Builder( | |
233 | packages [j], prev, next, Pro file.looku p(i)); | |
234 | profil ePackageSu mmaryBuild er.build() ; | |
235 | prev = packages[ j]; | |
236 | } | |
237 | } | |
238 | next Profile = (i + 1 < c onfigurati on.profile s.getProfi leCount()) ? | |
239 | Profil e.lookup(i + 1) : nu ll; | |
240 | Abst ractBuilde r profileS ummaryBuil der = | |
241 | config uration.ge tBuilderFa ctory().ge tProfileSu mmaryBuild er( | |
242 | Profil e.lookup(i ), prevPro file, next Profile); | |
243 | prof ileSummary Builder.bu ild(); | |
244 | prev Profile = Profile.lo okup(i); | |
245 | } | |
246 | } | |
247 | } | |
248 | ||
249 | /** | |
250 | * {@i nheritDoc} | |
251 | */ | |
252 | protec ted void g eneratePac kageFiles( ClassTree classtree) throws Ex ception { | |
253 | Pa ckageDoc[] packages = configur ation.pack ages; | |
254 | if (packages .length > 1) { | |
255 | PackageI ndexFrameW riter.gene rate(confi guration); | |
256 | } | |
257 | Pa ckageDoc p rev = null , next; | |
258 | fo r (int i = 0; i < pa ckages.len gth; i++) { | |
259 | // if -n odeprecate d option i s set and the packag e is marke d as | |
260 | // depre cated, do not genera te the pac kage-summa ry.html, p ackage-fra me.html | |
261 | // and p ackage-tre e.html pag es for tha t package. | |
262 | if (!(co nfiguratio n.nodeprec ated && Ut il.isDepre cated(pack ages[i]))) { | |
263 | Pack ageFrameWr iter.gener ate(config uration, p ackages[i] ); | |
264 | next = (i + 1 < packages .length && | |
265 | packag es[i + 1]. name().len gth() > 0) ? package s[i + 1] : null; | |
266 | //If the next package is unnamed p ackage, sk ip 2 ahead if possib le | |
267 | next = (i + 2 < packages .length && next == n ull) ? pac kages[i + 2] : next; | |
268 | Abst ractBuilde r packageS ummaryBuil der = | |
269 | config uration.ge tBuilderFa ctory().ge tPackageSu mmaryBuild er( | |
270 | packag es[i], pre v, next); | |
271 | pack ageSummary Builder.bu ild(); | |
272 | if ( configurat ion.create tree) { | |
273 | PackageTre eWriter.ge nerate(con figuration , | |
274 | pa ckages[i], prev, nex t, | |
275 | co nfiguratio n.nodeprec ated); | |
276 | } | |
277 | prev = package s[i]; | |
278 | } | |
279 | } | |
280 | } | |
281 | ||
282 | public static fi nal Config urationImp l sharedIn stanceForO ptions = | |
283 | new Conf igurationI mpl(); | |
284 | ||
285 | /** | |
286 | * Che ck for doc let added options he re. | |
287 | * | |
288 | * @re turn numbe r of argum ents to op tion. Zero return me ans | |
289 | * opt ion not kn own. Nega tive value means err or occurre d. | |
290 | */ | |
291 | public static in t optionLe ngth(Strin g option) { | |
292 | // Construct temporary configura tion for c heck | |
293 | re turn share dInstanceF orOptions. optionLeng th(option) ; | |
294 | } | |
295 | ||
296 | /** | |
297 | * Che ck that op tions have the corre ct argumen ts here. | |
298 | * <P> | |
299 | * Thi s method i s not requ ired and w ill defaul t graceful ly | |
300 | * (to true) if absent. | |
301 | * <P> | |
302 | * Pri nting opti on related error mes sages (usi ng the pro vided | |
303 | * Doc ErrorRepor ter) is th e responsi bility of this metho d. | |
304 | * | |
305 | * @re turn true if the opt ions are v alid. | |
306 | */ | |
307 | public static bo olean vali dOptions(S tring opti ons[][], | |
308 | DocError Reporter r eporter) { | |
309 | do cletToStar t = new Ht mlDoclet() ; | |
310 | re turn docle tToStart.c onfigurati on.validOp tions(opti ons, repor ter); | |
311 | } | |
312 | ||
313 | privat e void per formCopy(S tring file name) { | |
314 | if (filename .isEmpty() ) | |
315 | return; | |
316 | ||
317 | tr y { | |
318 | DocFile fromfile = DocFile.c reateFileF orInput(co nfiguratio n, filenam e); | |
319 | DocPath path = Doc Path.creat e(fromfile .getName() ); | |
320 | DocFile toFile = D ocFile.cre ateFileFor Output(con figuration , path); | |
321 | if (toFi le.isSameF ile(fromfi le)) | |
322 | retu rn; | |
323 | ||
324 | configur ation.mess age.notice ((SourcePo sition) nu ll, | |
325 | "doclet.Co pying_File _0_To_File _1", | |
326 | fromfile.t oString(), path.getP ath()); | |
327 | toFile.c opyFile(fr omfile); | |
328 | } catch (IOE xception e xc) { | |
329 | configur ation.mess age.error( (SourcePos ition) nul l, | |
330 | "doclet.pe rform_copy _exception _encounter ed", | |
331 | exc.toStri ng()); | |
332 | throw ne w DocletAb ortExcepti on(exc); | |
333 | } | |
334 | } | |
335 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.