类 ImportSupport
java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.ImportSupport
- 直接已知子类:
JsonTool
Provides methods to import arbitrary local or remote resources as strings, generic version.
Based on ImportSupport from the JSTL taglib by Shawn Bayern
- 从以下版本开始:
- VelocityTools 3.0
- 版本:
- $$
- 作者:
- Marino A. Jonsson, Claude Brisson
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final StringConfiguration key for XmlTool and JsonTool, used to specify a local resourcestatic final StringConfiguration key for ImportTool, XmlTool and JsonTool, used to specify a local or remote source URLprotected static final String从类继承的字段 org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected ReaderAcquire a reader to a local URL - non applicable to the generic version of ImportSupportprotected StringAquire the content of a local URL.acquireReader(String url) Acquire a reader to an URLprotected ReaderAcquire a reader to a remote URLprotected StringAquire the content of a remote URL.acquireString(String url) protected voidconfigure(ValueParser values) Configure import supportprotected URLgetClasspathResource(String resource) Classpath entry URL builderstatic StringgetContentTypeAttribute(String input, String name) Get the value associated with a content-type attribute.protected URLgetFileResource(String resource) Overridable local file URL builder.static StringgetProtocol(String url) Returns protocol, or null for a local URLgetResourceReader(String resource) Get a reader of a local resource, first trying with a file (or a webapp resource for the view flavor) then with a classpath entry.getResourceString(String resource) Fetch a local resource, first trying with a file (or a webapp resource for the view flavor) then with a classpath entry.static booleanisRemoteURL(String url) Returns whether an URL is remote or localvoidsetSafeMode(boolean safe) Sets or clears safe mode从类继承的方法 org.apache.velocity.tools.generic.SafeConfig
configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig
-
字段详细资料
-
构造器详细资料
-
ImportSupport
public ImportSupport()
-
-
方法详细资料
-
configure
Configure import support- 覆盖:
configure在类中SafeConfig- 参数:
values- configuration values
-
setSafeMode
public void setSafeMode(boolean safe) Sets or clears safe mode- 覆盖:
setSafeMode在类中SafeConfig- 参数:
safe- flag value
-
acquireString
- 参数:
url- the URL resource to return as string- 返回:
- the URL resource as string
- 抛出:
IOException- if operation failed
-
acquireRemoteURLString
Aquire the content of a remote URL.- 参数:
url- remote URL- 返回:
- the URL resource as string
- 抛出:
IOException- if operation failed
-
acquireLocalURLString
Aquire the content of a local URL.- 参数:
url- local URL- 返回:
- the URL resource as string
- 抛出:
IOException- if operation failed
-
acquireReader
Acquire a reader to an URL- 参数:
url- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException- if operation failed
-
acquireRemoteURLReader
Acquire a reader to a remote URL- 参数:
url- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException- if operation failed
-
acquireLocalURLReader
Acquire a reader to a local URL - non applicable to the generic version of ImportSupport- 参数:
url- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException- if operation failed
-
isRemoteURL
Returns whether an URL is remote or local- 参数:
url- the url to check out- 返回:
- wether the URL is remote
-
getProtocol
Returns protocol, or null for a local URL- 参数:
url- the url to check out- 返回:
- found protocol or null for a local URL
-
getContentTypeAttribute
Get the value associated with a content-type attribute. Syntax defined in RFC 2045, section 5.1.- 参数:
input- the string containing the attributesname- the name of the content-type attribute- 返回:
- the value associated with a content-type attribute
-
getResourceString
Fetch a local resource, first trying with a file (or a webapp resource for the view flavor) then with a classpath entry.- 参数:
resource- the resource to read- 返回:
- the content of the resource
-
getResourceReader
Get a reader of a local resource, first trying with a file (or a webapp resource for the view flavor) then with a classpath entry.- 参数:
resource- the resource to read- 返回:
- a reader of the resource
-
getFileResource
Overridable local file URL builder.- 参数:
resource- the resource to read- 返回:
- the content of the resource
- 抛出:
Exception- if operation failed
-
getClasspathResource
Classpath entry URL builder- 参数:
resource- the resource to read- 返回:
- the content of the resource
- 抛出:
Exception- if operation failed
-