1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.scxml.model;
19
20 /***
21 * The class in this SCXML object model that corresponds to the
22 * <history> SCXML pseudo state element.
23 *
24 */
25 public class History extends TransitionTarget {
26
27 /***
28 * Whether this is a shallow or deep history, the default is shallow.
29 */
30 private boolean isDeep;
31
32 /***
33 * A conditionless transition representing the default history state
34 * and indicates the state to transition to if the parent state has
35 * never been entered before.
36 */
37 private Transition transition;
38
39 /***
40 * Default no-args constructor for XML Digester.
41 */
42 public History() {
43 super();
44 }
45
46 /***
47 * Get the transition.
48 *
49 * @return Returns the transition.
50 */
51 public final Transition getTransition() {
52 return transition;
53 }
54
55 /***
56 * Set the transition.
57 *
58 * @param transition The transition to set.
59 */
60 public final void setTransition(final Transition transition) {
61 this.transition = transition;
62 }
63
64 /***
65 * Is this history "deep" (as against "shallow").
66 *
67 * @return Returns whether this is a "deep" history
68 */
69 public final boolean isDeep() {
70 return isDeep;
71 }
72
73 /***
74 * This method is invoked by XML digester when parsing SCXML markup.
75 *
76 * @param type The history type, which can be "shallow" or
77 * "deep"
78 */
79 public final void setType(final String type) {
80 if (type.equals("deep")) {
81 isDeep = true;
82 }
83
84 }
85
86 }
87