| java.lang.Object org.vfny.geoserver.wms.responses.featureInfo.FeatureTemplate
FeatureTemplate | public class FeatureTemplate (Code) | | Executes a template for a feature.
Usage:
Feature feature = ... //some feature
Writer writer = ... //some writer
FeatureTemplate template = new FeatureTemplate();
//title
template.title( feature );
//description
template.description( feature );
For performance reasons the template lookups will be cached, so it's advised to
use the same FeatureTemplate object in a loop that encodes various features, but not
to cache it for a long time (static reference).
Moreover, FeatureTemplate is not thread safe, so instantiate one for each thread.
author: Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org author: Andrea Aime, TOPP |
Method Summary | |
public void | description(Feature feature, OutputStream output) Executes the description template for a feature writing the results to an
output stream. | public void | description(Feature feature, Writer writer) Executes the description template for a feature writing the results to a
writer. | public String | description(Feature feature) Executes the description template for a feature returning the result as a
string. | public void | template(Feature feature, Writer writer, String template, Class lookup) Executes a template for the feature writing the results to a writer.
The template to execute is secified via the template, and
lookup parameters. | public void | template(Feature feature, OutputStream output, String template, Class lookup) Executes a template for the feature writing the results to an output stream.
The template to execute is secified via the template, and
lookup parameters. | public String | template(Feature feature, String template, Class lookup) Executes a template for the feature returning the result as a string.
The template to execute is secified via the template, and
lookup parameters. | public void | title(Feature feature, OutputStream output) Executes the title template for a feature writing the results to an
output stream. | public void | title(Feature feature, Writer writer) Executes the title template for a feature writing the results to a
writer. | public String | title(Feature feature) Executes the title template for a feature returning the result as a
string. |
DATETIME_FORMAT | public static SimpleDateFormat DATETIME_FORMAT(Code) | | Default datetime format produced by templates
|
caw | CharArrayWriter caw(Code) | | Cached writer used for plain conversion from Feature to String. Improves performance
significantly compared to an OutputStreamWriter over a ByteOutputStream.
|
templateCache | Map templateCache(Code) | | Template cache used to avoid paying the cost of template lookup for each feature
|
templateConfig | static Configuration templateConfig(Code) | | The template configuration used for placemark descriptions
|
description | public void description(Feature feature, OutputStream output) throws IOException(Code) | | Executes the description template for a feature writing the results to an
output stream.
This method is convenience for:
description( feature, new OutputStreamWriter( output ) );
Parameters: feature - The feature to execute the template against. Parameters: output - The output to write the result of the template to. throws: IOException - Any errors that occur during execution of the template. |
description | public void description(Feature feature, Writer writer) throws IOException(Code) | | Executes the description template for a feature writing the results to a
writer.
Parameters: feature - The feature to execute the template against. Parameters: writer - The writer to write the template output to. throws: IOException - Any errors that occur during execution of the template. |
description | public String description(Feature feature) throws IOException(Code) | | Executes the description template for a feature returning the result as a
string.
Parameters: feature - The feature to execute the template against. throws: IOException - Any errors that occur during execution of the template. |
template | public void template(Feature feature, Writer writer, String template, Class lookup) throws IOException(Code) | | Executes a template for the feature writing the results to a writer.
The template to execute is secified via the template, and
lookup parameters. The lookup is used to specify the
class from which template shoould be loaded relative to in teh
case where the user has not specified an override in the data directory.
Parameters: feature - The feature to execute the template against. Parameters: writer - The writer for output. Parameters: template - The template name. Parameters: lookup - The class to lookup the template relative to. |
template | public void template(Feature feature, OutputStream output, String template, Class lookup) throws IOException(Code) | | Executes a template for the feature writing the results to an output stream.
The template to execute is secified via the template, and
lookup parameters. The lookup is used to specify the
class from which template shoould be loaded relative to in teh
case where the user has not specified an override in the data directory.
Parameters: feature - The feature to execute the template against. Parameters: output - The output. Parameters: template - The template name. Parameters: lookup - The class to lookup the template relative to. |
template | public String template(Feature feature, String template, Class lookup) throws IOException(Code) | | Executes a template for the feature returning the result as a string.
The template to execute is secified via the template, and
lookup parameters. The lookup is used to specify the
class from which template shoould be loaded relative to in teh
case where the user has not specified an override in the data directory.
Parameters: feature - The feature to execute the template against. Parameters: template - The template name. Parameters: lookup - The class to lookup the template relative to. |
title | public void title(Feature feature, OutputStream output) throws IOException(Code) | | Executes the title template for a feature writing the results to an
output stream.
This method is convenience for:
description( feature, new OutputStreamWriter( output ) );
Parameters: feature - The feature to execute the template against. Parameters: output - The output to write the result of the template to. throws: IOException - Any errors that occur during execution of the template. |
title | public void title(Feature feature, Writer writer) throws IOException(Code) | | Executes the title template for a feature writing the results to a
writer.
Parameters: feature - The feature to execute the template against. Parameters: writer - The writer to write the template output to. throws: IOException - Any errors that occur during execution of the template. |
title | public String title(Feature feature) throws IOException(Code) | | Executes the title template for a feature returning the result as a
string.
Parameters: feature - The feature to execute the template against. throws: IOException - Any errors that occur during execution of the template. |
|
|