@@ -0,0 +1,1805 @@
+/*%0A *%0A *   Copyright 2006 The Apache Software Foundation.%0A *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  you may not use this file except in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A *%0A */%0Apackage org.apache.commons.scxml;%0A%0Aimport java.util.Iterator;%0Aimport java.util.Set;%0A%0Aimport org.apache.commons.scxml.model.TransitionTarget;%0A%0A/**%0A * Implementations of builtin functions defined by the SCXML%0A * specification.%0A *%0A * The current version of the specification defines one builtin%0A * predicate In()%0A */%0Apublic class Builtin %7B%0A%0A    /**%0A     * Implements the In() predicate for SCXML documents. The method%0A     * name chosen is different since &quot;in&quot; is a reserved token%0A     * in some expression languages.%0A     *%0A     * Does this state belong to the given Set of States.%0A     * Simple ID based comparator, assumes IDs are unique.%0A     *%0A     * @param allStates The Set of State objects to look in%0A     * @param state The State ID to compare with%0A     * @return Whether this State belongs to this Set%0A     */%0A    public static boolean isMember(final Set allStates,%0A            final String state) %7B%0A        for (Iterator i = allStates.iterator(); i.hasNext();) %7B%0A            TransitionTarget tt = (TransitionTarget) i.next();%0A            if (state.equals(tt.getId())) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A%7D%0A%0A

Factor out built-in SCXML functions, such as the In() predicate.