private Hashtable m_customTagClasses = new Hashtable();
private boolean m_bIgnoreComments;
private int m_nCommentDashes;
private boolean m_bTrimDocumentWhitespace;
private boolean m_bTrimTagWhitespace;
private Stack m_urlInclude = new Stack();
TemplateRuntimeContext getRuntimeContext() {
return this.m_runtimeContext;
}
public void setExpressionParser(ExpressionParser var1) {
this.m_expressionParser = var1;
}
public void setTextOnlyTags(Vector var1) {
this.m_textOnlyTags.addElements(var1);
}
public void ignoreComments(boolean var1) {
this.m_bIgnoreComments = var1;
}
public void setCommentDashes(int var1) {
this.m_nCommentDashes = var1;
}
public void trimDocumentWhitespace(boolean var1) {
this.m_bTrimDocumentWhitespace = var1;
}
public void trimTagWhitespace(boolean var1) {
this.m_bTrimTagWhitespace = var1;
}
public void parse(URL var1, TemplateOutput var2) throws TemplateException {
this.m_urlInclude.push(var1);
InputStream var3 = null;
try {
URLConnection var4 = var1.openConnection();
var4.setUseCaches(false);
var4.connect();
var3 = var4.getInputStream();
this.parse(var3, var2);
} catch (FileNotFoundException var14) {
throw new TemplateException(1003, "The template file '" + var1.toString() + "' was " + "not found. Please verify that this file exists and is " + "accessible.");
} catch (IOException var15) {
throw new TemplateException(1004, "An IO error occurred while attempting to parse template file '" + var1.toString() + "' (" + ((Throwable)var15).getMessage() + ").");
} catch (TemplateException var16) {
var16.setTemplateURL(var1.toString());
throw var16;
} finally {
if (var3 != null) {
try {
var3.close();
} catch (IOException var13) {
}
}
}
this.m_urlInclude.pop();
}
public void parse(InputStream var1, TemplateOutput var2) throws TemplateException {
TagParser var3 = new TagParser();
var3.setIncludeTags(this.m_tags.keysVector());
var3.setTextOnlyTags(this.m_textOnlyTags);
var3.skipNonTagText(false);
var3.autoTrimWhitespace(false);
var3.ignoreComments(this.m_bIgnoreComments);
var3.setCommentDashes(this.m_nCommentDashes);
Vector var4 = var3.parse(var1);
Vector var5 = this.createElementTree(var4);
ByteArrayOutputStream var6 = new ByteArrayOutputStream();
throw new TemplateException(1006, "A relative reference to a URL was attempted when no " + "base URL has been established for parsing (this error will " + "occur when attempting to INCLUDE a template from within " + "another template which not originate from a URL location).");
}
}
public void addCustomTag(String var1, TemplateCustomTag var2) throws TemplateException {
Class var3 = var2.getClass();
try {
var3.newInstance();
} catch (Exception var4) {
throw new TemplateException(1005, "Error attempting to create a tag object for custom tag " + "named '" + var1 + "'. The class registered " + "for the tag is '" + var3.getName() + "'.");
}
this.addTag(var1, (new CustomElement()).getClass());
throw new TemplateException(1005, "Error attempting to create a tag object for tag " + "named '" + var7.getName() + "'. The class registered " + "for the tag is '" + var8.getName() + "'.");