GlobalContainer
Per condividere un valore fra le UDF di un mapping
public String initCounter(Container container) throws StreamTransformationException {
container.getGlobalContainer().setParameter("COUNTER", "0");
return in;
}
public String increaseCounter(Container container) throws StreamTransformationException {
int theCounter = (new Integer((String) container.getGlobalContainer().getParameter("COUNTER"))).intValue();
theCounter++;
container.getGlobalContainer().setParameter("COUNTER", String.valueOf(theCounter));
return String.valueOf(theCounter);
}