OK for the text symbolizer, I have replaced the code as you said.
Regarding the evaluate method, I have evaluated the two parameters
against the object as you said (see below).
I have built the formatter from the string result.
But then, I don't know what to return. I have tried (T)
formatter.format(propertyString), but it doesn't seem to work.
propertyName is equal to "depth", and my propertyString is null... If
I don't know I have a feature as an object, how do I retrieve the
"depth" attribute value ?
I guess I missed something :-D
public final <T> T evaluate(final Object object, final Class<T>
context) {
Expression propertyName = parameters.get(0);
Expression format = parameters.get(1);
String propertyString = propertyName.evaluate(object,
String.class);
String formatString = format.evaluate(object, String.class);
return (T) formatter.format(propertyString);
}
Le 3 mars 09 à 17:08, Andrea Aime a écrit :
> You're not supposed to know. You have expressions as parameters,
> evaluate the first against the object and ask for a String.class
> result
> type, evaluate the second and do the same.
> Then use the two results to perform the formatting, and return the
> resulting value.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users