|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.template.util.UtilTemplate
Random functions related to Templates.
Source code: UtilTemplate.java.
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
UtilTemplate()
Create a UtilTemplate. |
Method Summary | |
i_i |
addUnqGapNamesToACS(VWString vws_uniqueGaps,
ForLineRetrieval flr_srcTxt,
GapConfig gap_config,
Outputter optr_dbg)
Add all the unique gap names found in the source text to the VWString. |
String[] |
getAOSUniqueGapNames(ForLineRetrieval flr_srcTxt,
GapConfig gap_config,
Outputter optr_dbg)
Get all the unique gap names that exist in the provided source text, or null if no gaps exist. |
String |
getFilled1GapTString(String s_templateWithOneGap,
String s_fillText)
Get the resulting string, after filling in the single gap, existing in the provided template string. |
String |
getFilledXGapsTString(int i_rqdUniqueGaps,
String s_templateWithXGaps,
String[] as_fillText)
Get the resulting string, after filling in the gaps existing in the provided template string. |
String |
getOriginalText(Template t_emplate)
Want to see the original text, as it existed before it was parsed? |
String |
getOriginalText(TemplateData template_data)
Want to see the original text, as it existed before it was parsed? |
s_s[] |
getRecursivelyFilled(TDOSArray tdosa_recursive)
Recursively fill a set of templates, and get the resulting name/value in a placeholder.s_s object (name=s1, value=s2). |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UtilTemplate()
Create a UtilTemplate. This constructor does nothing.
Method Detail |
public final String[] getAOSUniqueGapNames(ForLineRetrieval flr_srcTxt, GapConfig gap_config, Outputter optr_dbg)
Get all the unique gap names that exist in the provided source text, or null if no gaps exist.
public final i_i addUnqGapNamesToACS(VWString vws_uniqueGaps, ForLineRetrieval flr_srcTxt, GapConfig gap_config, Outputter optr_dbg)
Add all the unique gap names found in the source text to the VWString.
This creates a new TemplateDataOrString with the following constructor parameters:
(null, flr_srcTxt, (new TParseConfig(gap_config, true, optr_dbg)))
vws_uniqueGaps
- The VWString to add to. If null, a new VWString is created. How convenient is that? This parameter is manipulated by this function. It...public final String getFilled1GapTString(String s_templateWithOneGap, String s_fillText)
Get the resulting string, after filling in the single gap, existing in the provided template string.
Equal to getFilledXGapsTString(1, s_templateWithOneGap, (new String[] {s_fillText}))
public final String getFilledXGapsTString(int i_rqdUniqueGaps, String s_templateWithXGaps, String[] as_fillText)
Get the resulting string, after filling in the gaps existing in the provided template string.
i_rqdUniqueGaps
- The number of gaps required to exist in s_templateWithXGaps. Must be greater than zero.s_templateWithXGaps
- The template source text. Must be non null, and contain exactly i_rqdUniqueGaps gaps. All gap names are surrounded with tag delimiters which, by default, are TConfigDefaults.getTagTxtStart and TConfigDefaults.getTagTxtEnd.as_fillText
- The array of strings containing the text to fill into the unique gaps in s_templateWithXGaps. Must be valid according to AOOValid.crashIfBad, and its length must equal i_rqdUniqueGaps.AssertException
- If a TemplateFormatException is thrown when parsing s_templateWithXGaps, for any reason.public final String getOriginalText(Template t_emplate)
Want to see the original text, as it existed before it was parsed?
public final String getOriginalText(TemplateData template_data)
Want to see the original text, as it existed before it was parsed?
public final s_s[] getRecursivelyFilled(TDOSArray tdosa_recursive)
Recursively fill a set of templates, and get the resulting name/value in a placeholder.s_s object (name=s1, value=s2).
At least one element must be a string, which is the "seed" to prevent circular fills. Every gap must be the name of an existing template/string (except itself). There must be at least one gap in at least one Template.
Example code XmplRecursiveFill.java
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava