001/**
002 * Copyright 2005-2015 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.uif.lifecycle;
017
018/**
019 * Represents a discrete task within the view lifecycle. 
020 * 
021 * @author Kuali Rice Team (rice.collab@kuali.org)
022 * @param <T> top level lifecycle element type this task applies to
023 */
024public interface ViewLifecycleTask<T> extends Runnable {
025    
026    /**
027     * Gets the top level lifecycle element type that this task applies to.
028     * 
029     * <p>
030     * If an element is not a subclass of this type, then the task will not be performed on that
031     * element.
032     * </p>
033     * 
034     * @return lifecycle element type
035     */
036    Class<T> getElementType();
037
038    /**
039     * Gets the phase this lifecycle task is a part of.
040     * 
041     * @return lifecycle phase
042     */
043    LifecycleElementState getElementState();
044
045    /**
046     * @see #getElementState()
047     */
048    void setElementState(LifecycleElementState lifecycleElementState);
049    
050}