Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jharks.workflow;
  
  
  import java.util.List;
  import java.util.Set;
  
The org.jharks.workflow.StateImpl class models a basic state object. The state represents a finite point in a path. In the case of ParentLink it represents the screen that a user is currently at within the survey. The StateImpl object is associated with one to multiple Transition objects, which allow for movement to another state.

Author(s):
Michael J. Rizzo
Version:
1.0
 
 
 public class StateImpl implements State {

    
The logger for the module.
 
     protected Log logger = LogFactory.getLog(getClass().getName());
    
    
The name of the StateImpl instance.
 
     private String name;

    
List of transition objects.
 
     private List<Transitiontransitions;
    
    
The name of the associated view.
 
     private String viewName;
    
    
The classname of a specified view filter.
 
     private String viewFilterClassname;
    
    
The key label for a configured default state.
 
     private String defaultNextState;
    
    
The set of state properties
 
     private Set<WorkFlowPropertyproperties;
    
    
The initializer object
 
     private StateInitializer si
    
    
The post processor object
 
     private PostProcessor pp;
     
     private boolean initialized = false;
    
    
Attribute indicating wether state is an end state or not.
 
     private boolean endState = false;
    
    
Attribute indicating whether back navigation from the state should be supported by the view controller.
 
     private boolean allowBackNavigation = false;
    
    
Constructor that initializes the transition list.
 
     public StateImpl() {
          = new ArrayList<Transition>();
     }
    
    
Simple getter method that retrieves the name attribute.

Returns:
the name attribute.
 
     public String getName() {
         return ;
     }

    
Simple setter method that sets the name attribute.

Parameters:
name the String value to set as the name.
 
     public void setName(String name) {
         this. = name;
     }

    
Set the object properties.

Parameters:
value the set of properties.
 
     public void setProperties(Set<WorkFlowPropertyvalue) {
         this. = value;
     }

    
Add a property.

Parameters:
element the object to add to the property set.
 
     public void addProperty(WorkFlowProperty element) {
         .add(element);
     }

    
Check if property set is empty.

Returns:
true is the property set contains no elements.
    public boolean isPropertySetEmpty() {
        return .isEmpty();
    }

    
Clear the property set.
    public void clearPropertySet() {
        .clear();
    }

    
Method that returns the Set of properties associated with a StateImpl object.

Returns:
the Set of properties.
See also:
State.getProperties()
    public Set<WorkFlowPropertygetProperties() {
        return this.;
    }

    
Method that allows for the retrieval of a List of Transition objects available on a StateImpl object.

Returns:
the list of Transition instances.
    public List<TransitiongetTransitions() {
        return this.;
    }

    
Sets the Transition objects available on a StateImpl object.

Parameters:
value a list of transition objects.
    public void setTransitions(List<Transitionvalue) {
        this. = value;
    }

    
Retrieve a Transition instance by an index.

Parameters:
i the index.
Returns:
the Transition instance at the passed index.
    public Transition getTransitions(int i) {
        return (Transition.get(i);
    }

    
Add a Transition object for the state.

Parameters:
tran the Transition instance to add.
    public void addTransition(Transition tran) {
       .add(tran);
    }
    
    
Set a initialization action for the StateImpl instance.

Parameters:
si a StateInitializer instance.
    public void setInitializer(StateInitializer si) {
       if (.isDebugEnabled()) 
           .debug("Configuring StateInitializer for StateImpl: [" + 
                   this.getName() + "]");
       this. = si;
    }
    
    
Retrieves the configured StateInitializer object if one exists.

Returns:
the StateInitializer instance for this object if exists or return null.
    public StateInitializer getInitializer() {
        return this.;
    }
    
    
Set a post processor for the StateImpl instance.

Parameters:
pp a PostProcessor instance.
    public void setPostProcessor(PostProcessor pp) {
       if (.isDebugEnabled()) 
           .debug("Configuring PostProcessor for StateImpl: [" + 
                   this.getName() + "]");
       this. = pp;
    }
    
    
Retrieves the configured PostProcesor object if one exists.

Returns:
the PostProcessor instance for this object if exists or return null.
    public PostProcessor getPostProcessor() {
        return this.;
    }

    
Returns the view name associated with the StateImpl.

Returns:
Returns the viewName.
    public String getViewName() {
        return this.;
    }
    
    
Set the associated view name of the StateImpl.

Parameters:
viewName The viewName to set.
    public void setViewName(String viewName) {
        this. = viewName;
    }
    
    
Return the name of the view filter classname.

Returns:
the view filter classname.
	}

Set the view filter classname.

Parameters:
viewFilterClassname the classname to set for a view filter.
	public void setViewFilterClassname(String viewFilterClassname) {
		this. = viewFilterClassname;
	}

Returns the default next state label associated with the StateImpl.

Returns:
Returns the key label of the configured default next state or null.
    public String getDefaultNextState() {
        return this.;
    }
    
    
Set the associated default next state label.

Parameters:
stateKey stateKey the key label of the configured state..
    public void setDefaultNextState(String stateKey) {
        this. = stateKey;
    }
    
    
Return whether object is initialized or not.

Returns:
Returns the initalized state.
    public boolean isInitialized() {
        return ;
    }
    
Set initialized flag.

Parameters:
initialized The initalized state to set.
    public void setInitialized(boolean initialized) {
        this. = initialized;
    }

    
Returns indicator for whether state is an end state.

Returns:
true if the state is an end state.
    public boolean isEndState() {
        return ;
    }

    
Sets whether the state is an end state. A state is not an end state by default.

Parameters:
endState The flag indicator for whether end state or not.
    public void setEndState(boolean endState) {
        this. = endState;
    }

    
Indicates whether the view controller should support back navigation from this current state.

Returns:
true if back navigation should be supported for this site.
	public boolean isAllowBackNavigation() {
	}

Set whether the state is being indicated to support back navigation.

Parameters:
allowBackNavigation the flag indicator for whether back navigation should be supported.
	public void setAllowBackNavigation(boolean allowBackNavigation) {
		this. = allowBackNavigation;
	}
    
    
New to GrepCode? Check out our FAQ X