1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.commons.scxml2.model; 18 19 /** 20 * The class in this SCXML object model that corresponds to the 21 * <onexit> SCXML element, which is an optional property 22 * holding executable content to be run upon exiting the parent 23 * State or Parallel. 24 * 25 */ 26 public class OnExit extends Executable { 27 28 /** 29 * Serial version UID. 30 */ 31 private static final long serialVersionUID = 1L; 32 33 /** 34 * An indicator whether to raise the non-standard "exit.state.id" internal event after executing this OnExit 35 */ 36 private Boolean raiseEvent; 37 38 /** 39 * Constructor. 40 */ 41 public OnExit() { 42 super(); 43 } 44 45 /** 46 * Set the EnterableState parent. 47 * 48 * @param parent The parent to set. 49 */ 50 @Override 51 public final void setParent(final EnterableState parent) { 52 super.setParent(parent); 53 } 54 55 /** 56 * @return Returns true if the non-standard internal "exit.state.id" event will be raised after executing this OnExit 57 */ 58 public final boolean isRaiseEvent() { 59 return raiseEvent != null && raiseEvent; 60 } 61 62 /** 63 * @return Returns the indicator whether to raise the non-standard "exit.state.id" internal event after executing 64 * this OnExit. When null no event will be raised 65 */ 66 public final Boolean getRaiseEvent() { 67 return raiseEvent; 68 } 69 70 /** 71 * Set the indicator whether to raise the non-standard "exit.state.id" internal event after executing this OnExit. 72 * @param raiseEvent The indicator, when null no event will be raised 73 */ 74 public final void setRaiseEvent(final Boolean raiseEvent) { 75 this.raiseEvent = raiseEvent; 76 } 77 } 78