1 package org.andromda.cartridges.jsf.renderkit;
2
3 import java.io.IOException;
4 import java.util.UUID;
5 import javax.faces.component.UIComponent;
6 import javax.faces.context.FacesContext;
7 import javax.faces.render.Renderer;
8 import org.andromda.cartridges.jsf.component.TransactionToken;
9
10
11
12
13
14
15
16 public class TransactionTokenRenderer
17 extends Renderer
18 {
19
20
21
22 @SuppressWarnings("unchecked")
23 public void encodeBegin(
24 FacesContext context,
25 UIComponent component)
26 throws IOException
27 {
28 if (component.getParent() != null)
29 {
30 component.getParent().getAttributes().put(TransactionToken.TRANSACTION_TOKEN, UUID.randomUUID().toString());
31 }
32 }
33 }