001/*license*\ 002 Codelet: Copyright (C) 2014, Jeff Epstein (aliteralmind __DASH__ github __AT__ yahoo __DOT__ com) 003 004 This software is dual-licensed under the: 005 - Lesser General Public License (LGPL) version 3.0 or, at your option, any later version; 006 - Apache Software License (ASL) version 2.0. 007 008 Either license may be applied at your discretion. More information may be found at 009 - http://en.wikipedia.org/wiki/Multi-licensing. 010 011 The text of both licenses is available in the root directory of this project, under the names "LICENSE_lgpl-3.0.txt" and "LICENSE_asl-2.0.txt". The latest copies may be downloaded at: 012 - LGPL 3.0: https://www.gnu.org/licenses/lgpl-3.0.txt 013 - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt 014\*license*/ 015package com.github.aliteralmind.codelet.type; 016 import com.github.aliteralmind.codelet.CodeletType; 017 import com.github.aliteralmind.codelet.UserExtraGapGetter; 018 import com.github.aliteralmind.codelet.CodeletGap; 019 import com.github.aliteralmind.codelet.CodeletBaseConfig; 020 import com.github.aliteralmind.codelet.CodeletInstance; 021 import com.github.aliteralmind.codelet.TagletTextUtil; 022 import com.github.aliteralmind.templatefeather.FeatherTemplate; 023 import java.util.Map; 024 import java.util.Set; 025 import java.util.TreeMap; 026 import static com.github.xbn.lang.XbnConstants.*; 027/** 028 <P>The text into which {@code {@.codelet}} output (the example-code's source) is placed.</P> 029 030 <A NAME="gaps"></A><H2><A HREF="{@docRoot}/overview-summary.html#overview_description"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> Codelet: {@code {@.codelet}}: Template: <U>Gap names</U></H2> 031 032 <P>The only required gap is "{@link com.github.aliteralmind.codelet.type.OnlyOneBodyGapTemplateBase#BODY_GAP_NAME body}", which is where the fully-processed source-code is placed.</P> 033 034 <P>In addition to any {@linkplain com.github.aliteralmind.codelet.UserExtraGapGetter#getForSourceCodelet() user-extra} gaps, the {@code {@.codelet}} template also provides for the following "default" optional gaps:</P> 035 036 <A NAME="gaps"></A><P><A HREF="SourceCodeTemplate.html"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> <B>Url-related:</B></P> 037 038 <P><TABLE ALIGN="center" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#EEEEEE"><TR ALIGN="center" VALIGN="middle"> 039 <TD><B><U>Name</U></B></TD> 040 <TD><B><U>Description</U></B></TD> 041 </TR><TR> 042 <TD>{@link #GAP_SOURCE_URL source_url}</TD> 043 <TD>The absolute url to the example code's source file, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#linksource">as created by</A> JavaDoc (in <A HREF="{@docRoot}/src-html/">{@code {@docRoot}/src-html/}</A>)</TD> 044 </TR><TR> 045 <TD>{@link #GAP_JAVADOC_URL javadoc_url}</TD> 046 <TD>The absolute url to the example code's JavaDoc.</TD> 047 </TR><TR> 048 <TD>{@link #GAP_FQ_CLASS_NAME_URL fq_class_name_url}</TD> 049 <TD>The example's fully-qualified class name, with dots ({@code '.'}) replaced by url-slashes ({@code '/'}).</TD> 050 </TR><TR> 051 <TD>{@link #GAP_PACKAGE_URL package_url}</TD> 052 <TD>The example code's package, with dots ({@code '.'}) replaced by url-slashes ({@code '/'}).</TD> 053 </TR></TABLE></P> 054 055 <A NAME="gaps"></A><P><A HREF="SourceCodeTemplate.html"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> <B>Non-url related:</B></P> 056 057 <P><TABLE ALIGN="center" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#EEEEEE"><TR ALIGN="center" VALIGN="middle"> 058 <TD><B><U>Name</U></B></TD> 059 <TD><B><U>Description</U></B></TD> 060 </TR><TR> 061 <TD>{@link #GAP_SRC_PATH source_path}</TD> 062 <TD>The full on-disk path to the example code's source file.</TD> 063 </TR><TR> 064 <TD>{@link #GAP_SRC_BASE_DIR source_base_dir}</TD> 065 <TD>The on-disk directory in which the <I>top-most package</I> of example source-code file exists.</TD> 066 </TR><TR> 067 <TD>{@link #GAP_SIMPLE_CLASS_NAME simple_class_name}</TD> 068 <TD>The example code's non-fully-qualified class name.</TD> 069 </TR><TR> 070 <TD>{@link #GAP_FQ_CLASS_NAME fq_class_name}</TD> 071 <TD>The example code's fully-qualified class name.</TD> 072 </TR><TR> 073 <TD>{@link #GAP_FQ_CLASS_NAME_DIR fq_class_name_dir}</TD> 074 <TD>The example's fully-qualified class name, with dots {@code '.'} replaced by file-separators.</TD> 075 </TR><TR> 076 <TD>{@link #GAP_PACKAGE package}</TD> 077 <TD>The example code's package name.</TD> 078 </TR><TR> 079 <TD>{@link #GAP_PACKAGE_DIR package_dir}</TD> 080 <TD>The example's package name, with dots {@code '.'} replaced by file-separators.</TD> 081 </TR></TABLE></P> 082 083 @since 0.1.0 084 @author Copyright (C) 2014, Jeff Epstein ({@code aliteralmind __DASH__ github __AT__ yahoo __DOT__ com}), dual-licensed under the LGPL (version 3.0 or later) or the ASL (version 2.0). See source code for details. <A HREF="http://codelet.aliteralmind.com">{@code http://codelet.aliteralmind.com}</A>, <A HREF="https://github.com/aliteralmind/codelet">{@code https://github.com/aliteralmind/codelet}</A> 085 **/ 086public class SourceCodeTemplate extends OnlyOneBodyGapTemplateBase { 087 /** 088 <P>The full on-disk path to the example code's source file--Gap name is {@code "source_path"}.</P> 089 090 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 091 092 <P><CODE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getJavaSourceFilePath(CodeletInstance) getJavaSourceFilePath}(<I>[the-instance]</I>)</CODE></P> 093 094 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 095 @see #GAP_SRC_BASE_DIR 096 **/ 097 public static final CodeletGap GAP_SRC_PATH = new SourcePathGap(); 098 /** 099 <P>The on-disk directory in which the <I>top-most package</I> of example source-code file exists--Gap name is {@code "source_base_dir"}.</P> 100 101 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 102 103<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.CodeletBaseConfig CodeletBaseConfig}.{@link com.github.aliteralmind.codelet.CodeletBaseConfig#INSTANCE INSTANCE}.{@link com.github.aliteralmind.codelet.CodeletBaseConfig#getExampleSourceBaseDir() getExampleClassFQName}()</PRE></BLOCKQUOTE> 104 105 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 106 @see #GAP_SRC_PATH 107 **/ 108 public static final CodeletGap GAP_SRC_BASE_DIR = new SourceBaseDirGap(); 109 /** 110 <P>The example code's non-fully-qualified class name--Gap name is {@code "simple_class_name"}.</P> 111 112 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 113 114<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExampleSimpleClassName(CodeletInstance) getExampleSimpleClassName}(<I>[the-instance]</I>)</PRE></BLOCKQUOTE> 115 116 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 117 @see #GAP_FQ_CLASS_NAME 118 @see #GAP_PACKAGE 119 **/ 120 public static final CodeletGap GAP_SIMPLE_CLASS_NAME = new ClassNameGap(); 121 /** 122 <P>The example code's fully-qualified class name--Gap name is {@code "fq_class_name"}.</P> 123 124 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 125 126<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) getExampleClassFQName}(<I>[the-instance]</I>)</PRE></BLOCKQUOTE> 127 128 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 129 @see #GAP_FQ_CLASS_NAME_DIR 130 @see #GAP_FQ_CLASS_NAME_URL 131 @see #GAP_PACKAGE 132 @see #GAP_SIMPLE_CLASS_NAME 133 **/ 134 public static final CodeletGap GAP_FQ_CLASS_NAME = new FQClassNameGap(); 135 /** 136 <P>The example's fully-qualified class name, with dots ({@code '.'}) replaced by url-slashes ({@code '/'})--Gap name is {@code "fq_class_name_url"}.</P> 137 138 <P>Example input:<OL> 139 <LI>Example code's {@linkplain com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) fully-qualified class name}: {@code "fully.qualified.examples.AnExample"}</LI> 140 </OL></P> 141 142 <P>{@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) Output}:</P> 143 144 <P>{@code "fully/qualified/examples/AnExample"}</P> 145 146 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 147 148<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) getExampleClassFQName}(<I>[the-instance]</I>).{@link java.lang.String#replace(CharSequence, CharSequence) replace}(".", "/")</PRE></BLOCKQUOTE> 149 150 @see <A HREF="#codelet_tmpl_gaps_url"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 151 @see #GAP_FQ_CLASS_NAME 152 **/ 153 public static final CodeletGap GAP_FQ_CLASS_NAME_URL = new FQClassNameUrlGap(); 154 /** 155 <P>The example's fully-qualified class name, with dots {@code '.'} replaced by file-separators--Gap name is {@code "fq_class_name_dir"}.</P> 156 157 <P>Example input:<OL> 158 <LI>Example code's {@linkplain com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) fully-qualified class name}: {@code "fully.qualified.examples.AnExample"}</LI> 159 </OL></P> 160 161 <P>{@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) Output} (assuming Microsoft Windows):</P> 162 163 <P>{@code "fully\qualified\examples\AnExample"}</P> 164 165 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 166 167<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) getExampleClassFQName}(<I>[the-instance]</I>).{@link java.lang.String#replace(CharSequence, CharSequence) replace}(".", {@link com.github.xbn.lang.XbnConstants#FILE_SEP FILE_SEP}*)</PRE></BLOCKQUOTE> 168 169 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 170 @see #GAP_FQ_CLASS_NAME 171 **/ 172 public static final CodeletGap GAP_FQ_CLASS_NAME_DIR = new FQClassNameDirGap(); 173 /** 174 <P>The absolute url to the example code's source file, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#linksource">as created by</A> JavaDoc (in <A HREF="{@docRoot}/src-html/">{@code {@docRoot}/src-html/}</A>)--Gap name is {@code "source_url"}.</P> 175 176 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 177 178<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getJavaDocSourceUrl(CodeletInstance) getJavaDocSourceUrl}(<I>[the-instance]</I>)</PRE></BLOCKQUOTE> 179 180 @see <A HREF="#codelet_tmpl_gaps_url"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 181 @see #GAP_JAVADOC_URL 182 **/ 183 public static final CodeletGap GAP_SOURCE_URL = new SourceUrlGap(); 184 /** 185 <P>The absolute url to the example code's JavaDoc--Gap name is {@code "javadoc_url"}.</P> 186 187 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 188 189<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getJavaDocSourceUrl(CodeletInstance) getJavaDocSourceUrl}(<I>[the-instance]</I>)</PRE></BLOCKQUOTE> 190 191 @see <A HREF="#codelet_tmpl_gaps_url"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 192 @see #GAP_SOURCE_URL 193 **/ 194 public static final CodeletGap GAP_JAVADOC_URL = new JavadocUrlGap(); 195 /** 196 <P>The example code's package name--Gap name is {@code "package"}.</P> 197 198 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 199 200<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExamplePackageName(CodeletInstance) getExamplePackageName}(<I>[the-instance]</I>)</PRE></BLOCKQUOTE> 201 202 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 203 @see #GAP_PACKAGE_DIR 204 @see #GAP_PACKAGE_URL 205 @see #GAP_FQ_CLASS_NAME 206 @see #GAP_SIMPLE_CLASS_NAME 207 **/ 208 public static final CodeletGap GAP_PACKAGE = new PackageGap(); 209 /** 210 <P>The example code's package, with dots ({@code '.'}) replaced by url-slashes ({@code '/'})--Gap name is {@code "package_url"}.</P> 211 212 <P>Example input:<OL> 213 <LI>The example code's {@linkplain com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) fully-qualified class name}: {@code "fully.qualified.examples.AnExample"}</LI> 214 </OL></P> 215 216 <P>{@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) Output}:</P> 217 218 <P>{@code "fully/qualified/examples"}</P> 219 220 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 221 222<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExamplePackageName(CodeletInstance) getExamplePackageName}(<I>[the-instance]</I>).{@link java.lang.String#replace(CharSequence, CharSequence) replace}(".", "/")</PRE></BLOCKQUOTE> 223 224 @see <A HREF="#codelet_tmpl_gaps_url"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 225 @see #GAP_PACKAGE 226 **/ 227 public static final CodeletGap GAP_PACKAGE_URL = new PackageUrlGap(); 228 /** 229 <P>The example's package name, with dots {@code '.'} replaced by file-separators--Gap name is {@code "package_dir"}.</P> 230 231 <P>Example input:<OL> 232 <LI>The example code's {@linkplain com.github.aliteralmind.codelet.TagletTextUtil#getExampleClassFQName(CodeletInstance) fully-qualified class name}: {@code "fully.qualified.examples.AnExample"}</LI> 233 </OL></P> 234 235 <P>{@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) Output} (assuming Microsoft Windows):</P> 236 237 <P>{@code "fully\qualified\examples"}</P> 238 239 <P>Gap is {@linkplain com.github.aliteralmind.codelet.CodeletGap#getFillText(CodeletInstance) filled} with</P> 240 241<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.TagletTextUtil TagletTextUtil}.{@link com.github.aliteralmind.codelet.TagletTextUtil#getExamplePackageName(CodeletInstance) getExamplePackageName}(<I>[the-instance]</I>).{@link java.lang.String#replace(CharSequence, CharSequence) replace}(".", {@link com.github.xbn.lang.XbnConstants#FILE_SEP FILE_SEP}*)</PRE></BLOCKQUOTE> 242 243 @see <A HREF="#codelet_tmpl_gaps_dir"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></A> 244 @see #GAP_PACKAGE 245 **/ 246 public static final CodeletGap GAP_PACKAGE_DIR = new PackageDirGap(); 247 248 /** 249 <P>Create the first instance.</P> 250 251 <P>Equal to</P> 252 253<BLOCKQUOTE><PRE> 254{@link com.github.aliteralmind.codelet.type.OnlyOneBodyGapTemplateBase#OnlyOneBodyGapTemplateBase(CodeletType, FeatherTemplate, String, CodeletGap[], UserExtraGapGetter) super}({@link com.github.aliteralmind.codelet.CodeletType CodeletType}.{@link com.github.aliteralmind.codelet.CodeletType#SOURCE_CODE SOURCE_CODE}, template, tmpl_path, 255 new CodeletGap[] { 256 {@link #GAP_SRC_PATH}, 257 {@link #GAP_SRC_BASE_DIR}, 258 {@link #GAP_SIMPLE_CLASS_NAME}, 259 {@link #GAP_FQ_CLASS_NAME}, 260 {@link #GAP_FQ_CLASS_NAME_URL}, 261 {@link #GAP_FQ_CLASS_NAME_DIR}, 262 {@link #GAP_SOURCE_URL}, 263 {@link #GAP_JAVADOC_URL}, 264 {@link #GAP_PACKAGE}, 265 {@link #GAP_PACKAGE_URL}, 266 {@link #GAP_PACKAGE_DIR}}, 267 userExtra_getter) 268</PRE></BLOCKQUOTE> 269 @see #SourceCodeTemplate(SourceCodeTemplate, FeatherTemplate, String) 270 **/ 271 public SourceCodeTemplate(FeatherTemplate template, String tmpl_path, UserExtraGapGetter userExtra_getter) { 272 super(CodeletType.SOURCE_CODE, template, tmpl_path, 273 new CodeletGap[] { 274 GAP_SRC_PATH, 275 GAP_SRC_BASE_DIR, 276 GAP_SIMPLE_CLASS_NAME, 277 GAP_FQ_CLASS_NAME, 278 GAP_FQ_CLASS_NAME_URL, 279 GAP_FQ_CLASS_NAME_DIR, 280 GAP_SOURCE_URL, 281 GAP_JAVADOC_URL, 282 GAP_PACKAGE, 283 GAP_PACKAGE_URL, 284 GAP_PACKAGE_DIR}, 285 userExtra_getter); 286 } 287 /** 288 <P>Create the second or subsequent instance.</P> 289 290 <P>Equal to</P> 291 292<BLOCKQUOTE><PRE>{@link com.github.aliteralmind.codelet.type.OnlyOneBodyGapTemplateBase#OnlyOneBodyGapTemplateBase(OnlyOneBodyGapTemplateBase, FeatherTemplate, String) super}(to_copy, template, tmpl_path)</PRE></BLOCKQUOTE> 293 294 @see #SourceCodeTemplate(FeatherTemplate, String, UserExtraGapGetter) 295 **/ 296 public SourceCodeTemplate(SourceCodeTemplate to_copy, FeatherTemplate template, String tmpl_path) { 297 super(to_copy, template, tmpl_path); 298 } 299 public SourceCodeTemplate(SourceCodeTemplate to_copy, Appendable debugDest_ifNonNull) { 300 super(to_copy, debugDest_ifNonNull); 301 } 302 public SourceCodeTemplate fillBody(String fully_processed) { 303 fillBodyGap(fully_processed); 304 return this; 305 } 306 public static final SourceCodeTemplate newFromPathAndUserExtraGaps(String path, String path_name, UserExtraGapGetter userExtra_getter) { 307 return (new SourceCodeTemplate(newTemplateFromPath(path, path_name), path, userExtra_getter)); 308 } 309 /** 310 <P>Duplicate this template.</P> 311 312 @return <CODE>(new {@link #SourceCodeTemplate(SourceCodeTemplate, Appendable) SourceCodeTemplate}(this, debugDest_ifNonNull))</CODE> 313 **/ 314 public SourceCodeTemplate getObjectCopy(Appendable debugDest_ifNonNull) { 315 return (new SourceCodeTemplate(this, debugDest_ifNonNull)); 316 } 317} 318class SourcePathGap extends CodeletGap { 319 public SourcePathGap() { 320 super("source_path"); 321 } 322 public String getFillText(CodeletInstance instance) { 323 return TagletTextUtil.getJavaSourceFilePath(instance); 324 } 325} 326class SourceBaseDirGap extends CodeletGap { 327 public SourceBaseDirGap() { 328 super("source_base_dir"); 329 } 330 public String getFillText(CodeletInstance ignored) { 331 return CodeletBaseConfig.getExampleSourceBaseDir(); 332 } 333} 334class ClassNameGap extends CodeletGap { 335 public ClassNameGap() { 336 super("simple_class_name"); 337 } 338 public String getFillText(CodeletInstance instance) { 339 return TagletTextUtil.getExampleSimpleClassName(instance); 340 } 341} 342class FQClassNameGap extends CodeletGap { 343 public FQClassNameGap() { 344 super("fq_class_name"); 345 } 346 public String getFillText(CodeletInstance instance) { 347 return TagletTextUtil.getExampleClassFQName(instance); 348 } 349} 350class FQClassNameUrlGap extends CodeletGap { 351 public FQClassNameUrlGap() { 352 super("fq_class_name_url"); 353 } 354 public String getFillText(CodeletInstance instance) { 355 return TagletTextUtil.getExampleClassFQName(instance).replace(".", "/"); 356 } 357} 358class FQClassNameDirGap extends CodeletGap { 359 public FQClassNameDirGap() { 360 super("fq_class_name_dir"); 361 } 362 public String getFillText(CodeletInstance instance) { 363 return TagletTextUtil.getExampleClassFQName(instance).replace(".", FILE_SEP); 364 } 365} 366class JavadocUrlGap extends CodeletGap { 367 public JavadocUrlGap() { 368 super("javadoc_url"); 369 } 370 public String getFillText(CodeletInstance instance) { 371 return TagletTextUtil.getJavaDocUrl(instance); 372 } 373} 374class SourceUrlGap extends CodeletGap { 375 public SourceUrlGap() { 376 super("source_url"); 377 } 378 public String getFillText(CodeletInstance instance) { 379 return TagletTextUtil.getJavaDocSourceUrl(instance); 380 } 381} 382class PackageGap extends CodeletGap { 383 public PackageGap() { 384 super("package"); 385 } 386 public String getFillText(CodeletInstance instance) { 387 return TagletTextUtil.getExamplePackageName(instance); 388 } 389} 390class PackageUrlGap extends CodeletGap { 391 public PackageUrlGap() { 392 super("package_url"); 393 } 394 public String getFillText(CodeletInstance instance) { 395 return TagletTextUtil.getExamplePackageName(instance).replace(".", "/"); 396 } 397} 398class PackageDirGap extends CodeletGap { 399 public PackageDirGap() { 400 super("package_dir"); 401 } 402 public String getFillText(CodeletInstance instance) { 403 return TagletTextUtil.getExamplePackageName(instance).replace(".", FILE_SEP); 404 } 405}