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

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

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

RuntimeSingleton.getTemplate介绍

[英]Returns a Template from the resource manager. This method assumes that the character encoding of the template is set by the input.encoding property. The default is "ISO-8859-1"
[中]从资源管理器返回Template。此方法假定模板的字符编码由input.encoding属性设置。默认值为“ISO-8859-1”

代码示例

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 * Returns a <code>Template</code> from the resource manager
 *
 * @param name The  name of the desired template.
 * @param encoding Character encoding of the template
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name, String  encoding)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 * Returns a <code>Template</code> from the resource manager
 *
 * @param name The  name of the desired template.
 * @param encoding Character encoding of the template
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name, String  encoding)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 * Retrieves the requested template.
 *
 * @param name The file name of the template to retrieve relative to the
 *             template root.
 * @return     The requested template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public Template getTemplate( String name )
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate(name);
}

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

/**
 * Retrieves the requested template.
 *
 * @param name The file name of the template to retrieve relative to the
 *             template root.
 * @return     The requested template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public Template getTemplate( String name )
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate(name);
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 * Returns a <code>Template</code> from the resource manager.
 * This method assumes that the character encoding of the 
 * template is set by the <code>input.encoding</code>
 * property.  The default is "ISO-8859-1"
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 * Returns a <code>Template</code> from the resource manager
 *
 * @param name The  name of the desired template.
 * @param encoding Character encoding of the template
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public static Template getTemplate(String name, String  encoding)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 * Retrieves the requested template.
 *
 * @param name The file name of the template to retrieve relative to the 
 *             template root.
 * @return     The requested template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 */
public Template getTemplate( String name )
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate(name);
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @param encoding The character encoding to use for the template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 *
 *  @since Velocity v1.1
 */
public static Template getTemplate(String name, String encoding)
  throws ResourceNotFoundException, ParseErrorException
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 * Returns a <code>Template</code> from the resource manager.
 * This method assumes that the character encoding of the
 * template is set by the <code>input.encoding</code>
 * property.  The default is "ISO-8859-1"
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization.
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 * Returns a <code>Template</code> from the resource manager.
 * This method assumes that the character encoding of the
 * template is set by the <code>input.encoding</code>
 * property.  The default is "ISO-8859-1"
 *
 * @param name The file name of the desired template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization.
 */
public static Template getTemplate(String name)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name );
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @param encoding The character encoding to use for the template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 *
 *  @since Velocity v1.1
 */
public static Template getTemplate(String name, String encoding)
  throws ResourceNotFoundException, ParseErrorException
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @param encoding The character encoding to use for the template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 *
 *  @since Velocity v1.1
 */
public static Template getTemplate(String name, String encoding)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 *  Returns a <code>Template</code> from the Velocity
 *  resource management system.
 *
 * @param name The file name of the desired template.
 * @param encoding The character encoding to use for the template.
 * @return     The template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 *
 *  @since Velocity v1.1
 */
public static Template getTemplate(String name, String encoding)
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 * Retrieves the requested template with the specified
 * character encoding.
 *
 * @param name The file name of the template to retrieve relative to the 
 *             template root.
 * @param encoding the character encoding of the template
 *
 * @return     The requested template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 *     
 *  @since Velocity v1.1
 */
public Template getTemplate( String name, String encoding )
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

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

/**
 * Retrieves the requested template with the specified
 * character encoding.
 *
 * @param name The file name of the template to retrieve relative to the
 *             template root.
 * @param encoding the character encoding of the template
 *
 * @return     The requested template.
 * @throws ResourceNotFoundException if template not found
 *          from any available source.
 * @throws ParseErrorException if template cannot be parsed due
 *          to syntax (or other) error.
 * @throws Exception if an error occurs in template initialization
 *
 *  @since Velocity v1.1
 */
public Template getTemplate( String name, String encoding )
  throws ResourceNotFoundException, ParseErrorException, Exception
{
  return RuntimeSingleton.getTemplate( name, encoding );
}

代码示例来源:origin: webwork/webwork-jira

public static void merge(Context context, String templateName, Writer writer)
{
 try
 {
  Template t = RuntimeSingleton.getTemplate(templateName);
  t.merge(context, writer);
  //java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  //t.merge(context, out);
  //out.close();
 }
 catch(Exception e)
 {
  log.error(e.getMessage(), e);
 }
}

相关文章