类 SpringResourceLoader
java.lang.Object
org.apache.velocity.runtime.resource.loader.ResourceLoader
cn.aradin.spring.velocity.ui.SpringResourceLoader
public class SpringResourceLoader
extends org.apache.velocity.runtime.resource.loader.ResourceLoader
Velocity ResourceLoader adapter that loads via a Spring ResourceLoader.
Used by VelocityEngineFactory for any resource loader path that cannot
be resolved to a
java.io.File.
Note that this loader does not allow for modification detection:
Use Velocity's default FileResourceLoader for java.io.File
resources.
Expects "spring.resource.loader" and "spring.resource.loader.path"
application attributes in the Velocity runtime: the former of type
org.springframework.core.io.ResourceLoader, the latter a String.
- 从以下版本开始:
- 14.03.2004
- 作者:
- Juergen Hoeller
- 另请参阅:
-
VelocityEngineFactory.setResourceLoaderPath(java.lang.String)ResourceLoaderFileResourceLoader
-
字段概要
字段修饰符和类型字段说明protected final org.apache.commons.logging.Logstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String从类继承的字段 org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明longgetLastModified(org.apache.velocity.runtime.resource.Resource resource) getResourceReader(String source, String encoding) voidinit(org.apache.velocity.util.ExtProperties configuration) booleanisSourceModified(org.apache.velocity.runtime.resource.Resource resource) 从类继承的方法 org.apache.velocity.runtime.resource.loader.ResourceLoader
buildReader, commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckInterval
-
字段详细资料
-
构造器详细资料
-
SpringResourceLoader
public SpringResourceLoader()
-
-
方法详细资料
-
init
public void init(org.apache.velocity.util.ExtProperties configuration) - 指定者:
init在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
-
getResourceReader
public Reader getResourceReader(String source, String encoding) throws org.apache.velocity.exception.ResourceNotFoundException - 指定者:
getResourceReader在类中org.apache.velocity.runtime.resource.loader.ResourceLoader- 抛出:
org.apache.velocity.exception.ResourceNotFoundException
-
isSourceModified
public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource) - 指定者:
isSourceModified在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
-
getLastModified
public long getLastModified(org.apache.velocity.runtime.resource.Resource resource) - 指定者:
getLastModified在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
-