org.peaseplate.internal.locator
Class ClassLoaderTemplateLocator
java.lang.Object
org.peaseplate.locator.AbstractLocator
org.peaseplate.locator.AbstractURLBasedLocator
org.peaseplate.internal.locator.AbstractClassLoaderLocator
org.peaseplate.internal.locator.ClassLoaderTemplateLocator
- All Implemented Interfaces:
- java.io.Serializable, Locator, TemplateLocator
public class ClassLoaderTemplateLocator
- extends AbstractClassLoaderLocator
- implements TemplateLocator
A template locator that is based on an URL
- Author:
- Manfred HANTSCHEL
- See Also:
- Serialized Form
Constructor Summary |
ClassLoaderTemplateLocator(java.net.URL url,
java.lang.String resource,
java.lang.String name,
java.util.Locale locale,
java.lang.String encoding)
|
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ClassLoaderTemplateLocator
public ClassLoaderTemplateLocator(java.net.URL url,
java.lang.String resource,
java.lang.String name,
java.util.Locale locale,
java.lang.String encoding)
load
public char[] load()
throws TemplateException
- Description copied from interface:
TemplateLocator
- Returns a char array with the raw template data
Don't forget to update the timestamp and the rawSize properties
when loading the data.
- Specified by:
load
in interface TemplateLocator
- Returns:
- a char array with the raw template data
- Throws:
TemplateException
- on occasion- See Also:
TemplateLocator.load()
resolve
public Template resolve(TemplateEngine engine,
java.lang.String name,
java.util.Locale locale,
java.lang.String encoding)
throws TemplateException
- Description copied from interface:
TemplateLocator
- 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.
- Specified by:
resolve
in interface TemplateLocator
- Parameters:
engine
- the enginename
- the name, relative or absolutelocale
- the localeencoding
- the locale for loading
- Returns:
- the template or null if not found
- Throws:
TemplateException
- on occasion- See Also:
TemplateLocator.resolve(org.peaseplate.TemplateEngine, java.lang.String, java.util.Locale, java.lang.String)
highlight
public java.lang.String highlight(java.lang.String message,
int line,
int column)
- Description copied from interface:
TemplateLocator
- Create a highlight from the resource with the position at
line and column highlighted :)
May return null.
- Specified by:
highlight
in interface TemplateLocator
- Parameters:
message
- TODOline
- the linecolumn
- the column
- Returns:
- the highlight or null
- See Also:
TemplateLocator.highlight(String, int, int)
Copyright © 2008. All Rights Reserved.