Processor template in Java