| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.seasar.teeda.core.mock; |
| 17 | |
|
| 18 | |
import javax.faces.FacesException; |
| 19 | |
import javax.faces.context.FacesContext; |
| 20 | |
import javax.faces.event.PhaseListener; |
| 21 | |
|
| 22 | |
import org.seasar.framework.util.ArrayUtil; |
| 23 | |
|
| 24 | |
public class MockLifecycleImpl extends MockLifecycle { |
| 25 | |
|
| 26 | 2684 | private PhaseListener[] phaseListeners_ = new PhaseListener[0]; |
| 27 | |
|
| 28 | 2684 | public MockLifecycleImpl() { |
| 29 | 2684 | } |
| 30 | |
|
| 31 | |
public void addPhaseListener(PhaseListener listener) { |
| 32 | 1346 | phaseListeners_ = (PhaseListener[]) ArrayUtil.add(phaseListeners_, |
| 33 | |
listener); |
| 34 | 1346 | } |
| 35 | |
|
| 36 | |
public void execute(FacesContext context) throws FacesException { |
| 37 | 0 | } |
| 38 | |
|
| 39 | |
public PhaseListener[] getPhaseListeners() { |
| 40 | 7 | return phaseListeners_; |
| 41 | |
} |
| 42 | |
|
| 43 | |
public void removePhaseListener(PhaseListener listener) { |
| 44 | 0 | phaseListeners_ = (PhaseListener[]) ArrayUtil.remove(phaseListeners_, |
| 45 | |
listener); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
public void render(FacesContext context) throws FacesException { |
| 49 | 0 | } |
| 50 | |
|
| 51 | |
public PhaseListener[] clearAllPhaseListener() { |
| 52 | |
try { |
| 53 | 8 | return phaseListeners_; |
| 54 | |
} finally { |
| 55 | 8 | setupDefaultPhaseListener(); |
| 56 | |
} |
| 57 | |
} |
| 58 | |
|
| 59 | |
public void setupDefaultPhaseListener() { |
| 60 | 8 | phaseListeners_ = new PhaseListener[0]; |
| 61 | 8 | } |
| 62 | |
|
| 63 | |
public void setupDefaultPhaseListener(PhaseListener[] listeners) { |
| 64 | 7 | phaseListeners_ = listeners; |
| 65 | 7 | } |
| 66 | |
|
| 67 | |
} |