org.peaseplate.locator
Interface TemplateLocator

All Superinterfaces:
Locator, java.io.Serializable
All Known Implementing Classes:
ClassLoaderTemplateLocator, InMemoryTemplateLocator, URLBasedTemplateLocator

public interface TemplateLocator
extends Locator

A template locator stores the resource of the template and is capable of loading it.


Method Summary
 java.lang.String highlight(java.lang.String message, int line, int column)
          Create a highlight from the resource with the position at line and column highlighted :) May return null.
 char[] load()
          Returns a char array with the raw template data Don't forget to update the timestamp and the rawSize properties when loading the data.
 Template resolve(TemplateEngine engine, java.lang.String name, java.util.Locale locale, java.lang.String encoding)
          Resolves the template with the specified name relative to this template.
 
Methods inherited from interface org.peaseplate.locator.Locator
getKey, getRawSize, getTimestamp, isOutdated, setRawSize, setTimestamp, toString
 

Method Detail

load

char[] load()
            throws TemplateException
Returns a char array with the raw template data Don't forget to update the timestamp and the rawSize properties when loading the data.

Returns:
a char array with the raw template data
Throws:
TemplateException - on occasion

resolve

Template resolve(TemplateEngine engine,
                 java.lang.String name,
                 java.util.Locale locale,
                 java.lang.String encoding)
                 throws TemplateException
Resolves the template with the specified name relative to this template. If it can't find the template it tries to resolve the template with the absolute name, usually by asking the engine.

Parameters:
engine - the engine
name - the name, relative or absolute
locale - the locale
encoding - the locale for loading
Returns:
the template or null if not found
Throws:
TemplateException - on occasion

highlight

java.lang.String highlight(java.lang.String message,
                           int line,
                           int column)
Create a highlight from the resource with the position at line and column highlighted :) May return null.

Parameters:
message - TODO
line - the line
column - the column
Returns:
the highlight or null


Copyright © 2008. All Rights Reserved.