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.templatefeather.FeatherTemplate; 017 import com.github.aliteralmind.codelet.UserExtraGapGetter; 018 import com.github.aliteralmind.codelet.CodeletType; 019 import com.github.aliteralmind.codelet.CodeletGap; 020 import com.github.aliteralmind.codelet.CodeletTemplateBase; 021/** 022 <p>For all templates but {@code {@.codelet.and.out}}.</p> 023 024 * @since 0.1.0 025 * @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> 026 **/ 027public abstract class OnlyOneBodyGapTemplateBase extends CodeletTemplateBase { 028 /** 029 <p>The gap name for the fully processed source-code, which is the <i>only</i> gap required to exist in the template--equal to {@code "body"}.</p> 030 031 * @see <a href="SourceCodeTemplate.html"><IMG SRC="{@docRoot}/resources/up_arrow.gif"/></a> 032 * @see #fillBodyGap(String, String) 033 */ 034 public static final String BODY_GAP_NAME = "body"; 035 /** 036 <p>Create the first instance.</p> 037 038 * <p>Equal to</p> 039 040<blockquote><pre>{@link com.github.aliteralmind.codelet.CodeletTemplateBase#CodeletTemplateBase(CodeletType, FeatherTemplate, String, String[], CodeletGap[], UserExtraGapGetter) super}(type, template, tmpl_path, new String[]{{@link #BODY_GAP_NAME}}, optional_defaultGaps, userExtra_getter)</pre></blockquote> 041 042 * @see #OnlyOneBodyGapTemplateBase(OnlyOneBodyGapTemplateBase, FeatherTemplate, String) 043 */ 044 public OnlyOneBodyGapTemplateBase(CodeletType type, FeatherTemplate template, String tmpl_path, CodeletGap[] optional_defaultGaps, UserExtraGapGetter userExtra_getter) { 045 super(type, template, tmpl_path, new String[]{BODY_GAP_NAME}, optional_defaultGaps, userExtra_getter); 046 } 047 /** 048 <p>Create the second or subsequent instance.</p> 049 050 * <p>Equal to</p> 051 052<blockquote><pre>{@link com.github.aliteralmind.codelet.CodeletTemplateBase#CodeletTemplateBase(CodeletTemplateBase, FeatherTemplate, String) super}(to_copy, template, tmpl_path)</pre></blockquote> 053 054 * @see #OnlyOneBodyGapTemplateBase(CodeletType, FeatherTemplate, String, CodeletGap[], UserExtraGapGetter) 055 */ 056 public OnlyOneBodyGapTemplateBase(OnlyOneBodyGapTemplateBase to_copy, FeatherTemplate template, String tmpl_path) { 057 super(to_copy, template, tmpl_path); 058 } 059 public OnlyOneBodyGapTemplateBase(OnlyOneBodyGapTemplateBase to_copy, Appendable debugDest_ifNonNull) { 060 super(to_copy, debugDest_ifNonNull); 061 } 062 /** 063 <p>Fill the fully-processed text into the body gap.</p> 064 065 * <p>Equal to</p> 066 067<blockquote><pre>{@link com.github.aliteralmind.codelet.CodeletTemplateBase#fillBodyGap(String, String) fillBodyGap}*({@link #BODY_GAP_NAME}, body_text)</pre></blockquote> 068 */ 069 public final void fillBodyGap(String body_text) { 070 fillBodyGap(BODY_GAP_NAME, body_text); 071 } 072 public static final FeatherTemplate newTemplateFromPath(String path, String path_name) { 073 return CodeletTemplateBase.newTemplateFromPath(path, path_name, BODY_GAP_NAME); 074 } 075}