terp - the Codemesh Modular
Template Interpreter v1.3.337

com.codemesh.terp.api
Interface Transformer<T>

All Known Subinterfaces:
Formatter
All Known Implementing Classes:
Formatter.AbstractFormatter, Formatter.Base64, Formatter.Capitalize, Formatter.Namefy, Formatter.Pad, Formatter.Remove, Formatter.Replace, Formatter.TextFormatter, Formatter.ToAscii, Formatter.ToLowercase, Formatter.ToSlug, Formatter.ToUppercase, Formatter.ToXml, Formatter.Trim, Scalar.AbstractScalarTransformer, Scalar.Concatenate, Transformer.AbstractTransformer, Transformer.LineBreaker

public interface Transformer<T>

The interface used to transform an item into another item, for example in collection enumerators etc.


Nested Class Summary
static class Transformer.AbstractTransformer<T>
           
static class Transformer.LineBreaker
           
 
Field Summary
static java.util.List<java.lang.Object> NO_ARGS
           
static java.lang.String[] NO_PARAM_NAMES
           
 
Method Summary
 java.lang.String getItemName()
          Returns the name used for the item that is being transformed.
 java.lang.String[] getParamNames()
          Returns the parameter names.
 T transform(java.lang.Object item)
          Transforms an item into another item of a specified type.
 T transform(java.lang.Object item, java.util.List<java.lang.Object> args)
          Transforms an item into another item, taking optional arguments into account.
 T transform(java.lang.Object item, java.util.List<java.lang.Object> args, TerpContext ctx)
          Transforms an item into another item, taking optional arguments into account.
 

Field Detail

NO_ARGS

static final java.util.List<java.lang.Object> NO_ARGS

NO_PARAM_NAMES

static final java.lang.String[] NO_PARAM_NAMES
Method Detail

getItemName

java.lang.String getItemName()
Returns the name used for the item that is being transformed.

Returns:
a name.

getParamNames

java.lang.String[] getParamNames()
Returns the parameter names.

Returns:
an array of names.

transform

T transform(java.lang.Object item)
Transforms an item into another item of a specified type.

Parameters:
item - the item to transform.
Returns:
the transformed item.

transform

T transform(java.lang.Object item,
            java.util.List<java.lang.Object> args)
Transforms an item into another item, taking optional arguments into account.

Parameters:
item - the item to transform.
args - the optional arguments.
Returns:
the transformed item.

transform

T transform(java.lang.Object item,
            java.util.List<java.lang.Object> args,
            TerpContext ctx)
Transforms an item into another item, taking optional arguments into account.

Parameters:
item - the item to transform.
args - the optional arguments.
ctx - the context in which the transformation occurs.
Returns:
the transformed item.

terp - the Codemesh Modular
Template Interpreter v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.