⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basetemplateengine.java

📁 struts 2 核心包 的源码 有错误是难免的
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   BaseTemplateEngine.java

package org.apache.struts2.components.template;

import com.opensymphony.xwork2.util.ClassLoaderUtil;
import java.io.*;
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

// Referenced classes of package org.apache.struts2.components.template:
//			TemplateEngine, Template

public abstract class BaseTemplateEngine
	implements TemplateEngine
{

	private static final Log LOG = LogFactory.getLog(org/apache/struts2/components/template/BaseTemplateEngine);
	public static final String DEFAULT_THEME_PROPERTIES_FILE_NAME = "theme.properties";
	final Map themeProps = new HashMap();

	public BaseTemplateEngine()
	{
	}

	public Map getThemeProps(Template template)
	{
		Map map = themeProps;
		JVM INSTR monitorenter ;
		Properties props;
		String propName;
		InputStream is;
		IOException e;
		props = (Properties)themeProps.get(template.getTheme());
		if (props != null)
			break MISSING_BLOCK_LABEL_304;
		propName = (new StringBuilder()).append(template.getDir()).append("/").append(template.getTheme()).append("/").append(getThemePropertiesFileName()).toString();
		File propFile = new File(propName);
		is = null;
		try
		{
			if (propFile.exists())
				is = new FileInputStream(propFile);
		}
		// Misplaced declaration of an exception variable
		catch (IOException e)
		{
			LOG.warn((new StringBuilder()).append("Unable to find file in filesystem [").append(propFile.getAbsolutePath()).append("]").toString());
		}
		if (is == null)
			is = ClassLoaderUtil.getResourceAsStream(propName, getClass());
		props = new Properties();
		if (is == null)
			break MISSING_BLOCK_LABEL_289;
		props.load(is);
		try
		{
			is.close();
		}
		catch (IOException io)
		{
			LOG.warn("Unable to close input stream", io);
		}
		break MISSING_BLOCK_LABEL_289;
		io;
		LOG.error((new StringBuilder()).append("Could not load ").append(propName).toString(), io);
		try
		{
			is.close();
		}
		catch (IOException io)
		{
			LOG.warn("Unable to close input stream", io);
		}
		break MISSING_BLOCK_LABEL_289;
		Exception exception;
		exception;
		try
		{
			is.close();
		}
		catch (IOException io)
		{
			LOG.warn("Unable to close input stream", io);
		}
		throw exception;
		themeProps.put(template.getTheme(), props);
		return props;
		Exception exception1;
		exception1;
		throw exception1;
	}

	protected String getFinalTemplateName(Template template)
	{
		String t = template.toString();
		if (t.indexOf(".") <= 0)
			return (new StringBuilder()).append(t).append(".").append(getSuffix()).toString();
		else
			return t;
	}

	protected String getThemePropertiesFileName()
	{
		return "theme.properties";
	}

	protected abstract String getSuffix();

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -