org.apache.velocity.runtime.RuntimeSingleton.getLoaderNameForResource()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.apache.velocity.runtime.RuntimeSingleton.getLoaderNameForResource方法的一些代码示例,展示了RuntimeSingleton.getLoaderNameForResource的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RuntimeSingleton.getLoaderNameForResource方法的具体详情如下:
包路径:org.apache.velocity.runtime.RuntimeSingleton
类名称:RuntimeSingleton
方法名:getLoaderNameForResource

RuntimeSingleton.getLoaderNameForResource介绍

[英]Determines is a template exists, and returns name of the loader that provides it. This is a slightly less hokey way to support the Velocity.templateExists() utility method, which was broken when per-template encoding was introduced. We can revisit this.
[中]确定模板是否存在,并返回提供该模板的加载程序的名称。这是一种支持速度的稍微不那么矫揉造作的方式。templateExists()实用程序方法,当引入每模板编码时,该方法被破坏。我们可以重温一下。

代码示例

代码示例来源:origin: org.apache.velocity/com.springsource.org.apache.velocity

/**
 *  Determines is a template exists, and returns name of the loader that
 *  provides it.  This is a slightly less hokey way to support
 *  the Velocity.templateExists() utility method, which was broken
 *  when per-template encoding was introduced.  We can revisit this.
 *
 *  @param resourceName Name of template or content resource
 *  @return class name of loader than can provide it
 */
public static String getLoaderNameForResource( String resourceName )
{
  return RuntimeSingleton.getLoaderNameForResource( resourceName );
}

代码示例来源:origin: velocity/velocity-dep

/**
 *  Determines is a template exists, and returns name of the loader that 
 *  provides it.  This is a slightly less hokey way to support
 *  the Velocity.templateExists() utility method, which was broken
 *  when per-template encoding was introduced.  We can revisit this.
 *
 *  @param resourceName Name of template or content resource
 *  @return class name of loader than can provide it
 */
public static String getLoaderNameForResource( String resourceName )
{
  return RuntimeSingleton.getLoaderNameForResource( resourceName );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity

/**
 *  Determines is a template exists, and returns name of the loader that
 *  provides it.  This is a slightly less hokey way to support
 *  the Velocity.templateExists() utility method, which was broken
 *  when per-template encoding was introduced.  We can revisit this.
 *
 *  @param resourceName Name of template or content resource
 *  @return class name of loader than can provide it
 */
public static String getLoaderNameForResource( String resourceName )
{
  return RuntimeSingleton.getLoaderNameForResource( resourceName );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity

/**
 * <p>Determines whether a resource is accessable via the
 * currently configured resource loaders.  {@link
 * org.apache.velocity.runtime.resource.Resource} is the generic
 * description of templates, static content, etc.</p>
 *
 * <p>Note that the current implementation will <b>not</b> change
 * the state of the system in any real way - so this cannot be
 * used to pre-load the resource cache, as the previous
 * implementation did as a side-effect.</p>
 *
 * @param resourceName The name of the resource to search for.
 * @return Whether the resource was located.
 */
public static boolean resourceExists(String resourceName)
{
  return (RuntimeSingleton.getLoaderNameForResource(resourceName) != null);
}

代码示例来源:origin: velocity/velocity-dep

/**
 * <p>Determines whether a resource is accessable via the
 * currently configured resource loaders.  {@link
 * org.apache.velocity.runtime.resource.Resource} is the generic
 * description of templates, static content, etc.</p>
 *
 * <p>Note that the current implementation will <b>not</b> change
 * the state of the system in any real way - so this cannot be
 * used to pre-load the resource cache, as the previous
 * implementation did as a side-effect.</p>
 *
 * @param resourceName The name of the resource to search for.
 * @return Whether the resource was located.
 */
public static boolean resourceExists(String resourceName)
{
  return (RuntimeSingleton.getLoaderNameForResource(resourceName) != null);
}

代码示例来源:origin: org.apache.velocity/com.springsource.org.apache.velocity

/**
 * <p>Determines whether a resource is accessable via the
 * currently configured resource loaders.  {@link
 * org.apache.velocity.runtime.resource.Resource} is the generic
 * description of templates, static content, etc.</p>
 *
 * <p>Note that the current implementation will <b>not</b> change
 * the state of the system in any real way - so this cannot be
 * used to pre-load the resource cache, as the previous
 * implementation did as a side-effect.</p>
 *
 * @param resourceName The name of the resource to search for.
 * @return Whether the resource was located.
 */
public static boolean resourceExists(String resourceName)
{
  return (RuntimeSingleton.getLoaderNameForResource(resourceName) != null);
}

代码示例来源:origin: org.apache.velocity/velocity-engine-core

/**
 * <p>Determines whether a resource is accessible via the
 * currently configured resource loaders.  {@link
 * org.apache.velocity.runtime.resource.Resource} is the generic
 * description of templates, static content, etc.</p>
 *
 * <p>Note that the current implementation will <b>not</b> change
 * the state of the system in any real way - so this cannot be
 * used to pre-load the resource cache, as the previous
 * implementation did as a side-effect.</p>
 *
 * @param resourceName The name of the resource to search for.
 * @return Whether the resource was located.
 */
public static boolean resourceExists(String resourceName)
{
  return (RuntimeSingleton.getLoaderNameForResource(resourceName) != null);
}

相关文章