optr_dbg.write("[" + tp_config.toString() + "]");
}
VWString acsSurroundingText = new VWString();
StringBuffer sbCurrentSurrText = new StringBuffer(sES);
AOSLCreator aoslc = new AOSLCreator();
TLAObjects tlao = new TLAObjects(tp_config);
while(for_lineRetrieval.hasMoreLines()) {
StringBuffer sbLine = for_lineRetrieval.getNextLine();
TemplateLineAnalyzer tla = new TemplateLineAnalyzer(getName(), for_lineRetrieval.getLineNumberPrev(), sbLine, tlao);
String sFinalSurrTxt = null;
while(!tla.isDoneAnalyzing()) {
if(tla.hasAnotherGap()) {
s_s ss = tla.getNextSurrTxtAndGap();
if(!tp_config.doIgnoreSurrTxt()) {
sbCurrentSurrText.append(ss.s1);
addCurrSurrTextOntoArray(acsSurroundingText, sbCurrentSurrText);
}
aoslc.addString(ss.s2);
if(aoslc.wasLastStringUnique()) {
//THIS IS PRINTING OUT AFTER THE GAP *FOLLOWING*
//THE ONE THAT IS UNIQUE. HMMMMM.
optr_dbg.write("\t\t\t[ UNIQUE ]");
}
} else {
//The end of the line has been reached. Get the final
//surrounding text.
sFinalSurrTxt = tla.getFinalSurrTxt();
}
}
if(!tp_config.doIgnoreSurrTxt()) {
sbCurrentSurrText.append(sFinalSurrTxt);
}
}
if(aoslc.getCountUnq() < 1) {
//There are no gaps, so the FLR contains a plain string.
sString = sbCurrentSurrText.toString();
tData = null;
optr_dbg.write("No gaps found. isTemplate() equals false. Use getString().");
} else {
//There is at least one gap. Add the final surrounding
//text to the array.
if(!tp_config.doIgnoreSurrTxt()) {
addCurrSurrTextOntoArray(acsSurroundingText, sbCurrentSurrText);
}
sString = null;
aoslc.lock();
tData = new TemplateData(getName(),
aoslc.getAOSLookup(),
new APString(acsSurroundingText.getAOString()),
tlao.sTagStart, tlao.sTagEnd);
sName = null;