
cz.wicketstuff.boss.flow.annotation.FlowSwitchProcessorExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boss-flow Show documentation
Show all versions of boss-flow Show documentation
Workflow control and configuration java framework
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cz.wicketstuff.boss.flow.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import cz.wicketstuff.boss.flow.model.IFlowState;
import cz.wicketstuff.boss.flow.model.IFlowSwitchState;
/**
* Annotation to mark a method to be a condition expression.
* When the expression matches this criteria held by this annotation,
* the result of the method is used as the result of the expression.
*
* See {@link IFlowSwitchState} to understand switch states.
*
* Example:
*
* In the following example the condition method is called to get the result
* of any condition starting with 'condition' prefix.
*
* @FlowConditionProcessor(switchExpressionRegex = "switch.*")
* public boolean swtichCondition(String condition, IFlowCarter<?>> flowCarter) {
* return true;
* }
*
* @author Martin Strejc
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface FlowSwitchProcessorExpression {
/**
* The regular expression that condition name must match
* to notify. Value "" means this filter is not applied.
*
* @return regular expression state name filter
*/
String switchExpressionRegex() default "";
/**
* The regular expression that state must match
* to notify. Value "" means this filter is not applied.
*
* @return regular expression state name filter
*/
String stateNameRegex() default "";
/**
* The class that a state has to implement
* to annotated method can be used as switch expression.
*
* @return flow state implementing interface filter
*/
Class extends IFlowState> type() default IFlowState.class;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy