> I want it per request not globally.
>
> How about:
>
> data.getParameters(true).setProperties(user)
>
That's not really very meaningful. If we are going
to go that route we should probably have an object
that represents a set of transformations to be
performed on the values to be set in the object.
We can leave the signature of the standard method
as is:
data.getParameters().setProperties(user)
and have another signature
data.getParameters().setProperties(user, transformations)
Where transformations might be an ArrayList of
Transformation objects that might look like something
like the following:
public interface Transformation
{
public Class getClass();
public Object transform(Object objectToTransform);
}
public class Trim implements Transformation
{
public Class getClass()
{
return String.class;
}
public Object transform(Object objectToTransform)
{
return trim((String) objectToTransform);
}
private String trim(String s)
{
// trim the string.
return trimmedString;
}
}
Cycle through the transformations performing the
desired transformations to the desired types.
This would work for stripping bad HTML out of
text, trimming strings, rounding floats, or
whatever. We could leave the setProperties()
and setProperty() in PP as they are and make
two new methods that deal with the transformations.
Then if you choose to take it raw you can, or you can apply
whatever transforms you want and we won't
make a big mess of the PP class I'm sure the above could be
implemented better but that's the general
idea.
Thoughts?
jvz.
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]