Documentation ¶
Index ¶
- Constants
- func BeanCondition(selector SpringCore.BeanSelector) *beanCondition
- func ConditionGroup(op ConditionOp, cond ...SpringCore.Condition) *conditionGroup
- func ExpressionCondition(expression string) *expressionCondition
- func FunctionCondition(fn ConditionFunc) *functionCondition
- func MissingBeanCondition(selector SpringCore.BeanSelector) *missingBeanCondition
- func MissingPropertyCondition(name string) *missingPropertyCondition
- func NotCondition(cond SpringCore.Condition) *notCondition
- func ProfileCondition(profile string) *profileCondition
- func PropertyCondition(name string) *propertyCondition
- func PropertyValueCondition(name string, havingValue interface{}, options ...PropertyValueConditionOption) *propertyValueCondition
- type ConditionFunc
- type ConditionOp
- type Conditional
- func On(cond SpringCore.Condition) *Conditional
- func OnBean(selector SpringCore.BeanSelector) *Conditional
- func OnExpression(expression string) *Conditional
- func OnMatches(fn ConditionFunc) *Conditional
- func OnMissingBean(selector SpringCore.BeanSelector) *Conditional
- func OnMissingProperty(name string) *Conditional
- func OnOptionalPropertyValue(name string, havingValue interface{}) *Conditional
- func OnProfile(profile string) *Conditional
- func OnProperty(name string) *Conditional
- func OnPropertyValue(name string, havingValue interface{}, options ...PropertyValueConditionOption) *Conditional
- func (c *Conditional) And() *Conditional
- func (c *Conditional) Empty() bool
- func (c *Conditional) Matches(ctx SpringCore.ApplicationContext) bool
- func (c *Conditional) OnBean(selector SpringCore.BeanSelector) *Conditional
- func (c *Conditional) OnCondition(cond SpringCore.Condition) *Conditional
- func (c *Conditional) OnConditionNot(cond SpringCore.Condition) *Conditional
- func (c *Conditional) OnExpression(expression string) *Conditional
- func (c *Conditional) OnMatches(fn ConditionFunc) *Conditional
- func (c *Conditional) OnMissingBean(selector SpringCore.BeanSelector) *Conditional
- func (c *Conditional) OnMissingProperty(name string) *Conditional
- func (c *Conditional) OnOptionalPropertyValue(name string, havingValue interface{}) *Conditional
- func (c *Conditional) OnProfile(profile string) *Conditional
- func (c *Conditional) OnProperty(name string) *Conditional
- func (c *Conditional) OnPropertyValue(name string, havingValue interface{}, options ...PropertyValueConditionOption) *Conditional
- func (c *Conditional) Or() *Conditional
- type PropertyValueConditionOption
Constants ¶
const ( ConditionOr = ConditionOp(1) // 至少一个满足 ConditionAnd = ConditionOp(2) // 所有都要满足 ConditionNone = ConditionOp(3) // 没有一个满足 )
Variables ¶
This section is empty.
Functions ¶
func BeanCondition ¶
func BeanCondition(selector SpringCore.BeanSelector) *beanCondition
BeanCondition beanCondition 的构造函数
func ConditionGroup ¶
func ConditionGroup(op ConditionOp, cond ...SpringCore.Condition) *conditionGroup
ConditionGroup conditions 的构造函数
func ExpressionCondition ¶
func ExpressionCondition(expression string) *expressionCondition
ExpressionCondition expressionCondition 的构造函数
func FunctionCondition ¶
func FunctionCondition(fn ConditionFunc) *functionCondition
FunctionCondition functionCondition 的构造函数
func MissingBeanCondition ¶
func MissingBeanCondition(selector SpringCore.BeanSelector) *missingBeanCondition
MissingBeanCondition missingBeanCondition 的构造函数
func MissingPropertyCondition ¶
func MissingPropertyCondition(name string) *missingPropertyCondition
MissingPropertyCondition missingPropertyCondition 的构造函数
func NotCondition ¶
func NotCondition(cond SpringCore.Condition) *notCondition
NotCondition notCondition 的构造函数
func ProfileCondition ¶
func ProfileCondition(profile string) *profileCondition
ProfileCondition profileCondition 的构造函数
func PropertyCondition ¶
func PropertyCondition(name string) *propertyCondition
PropertyCondition propertyCondition 的构造函数
func PropertyValueCondition ¶
func PropertyValueCondition(name string, havingValue interface{}, options ...PropertyValueConditionOption) *propertyValueCondition
PropertyValueCondition propertyValueCondition 的构造函数
Types ¶
type ConditionFunc ¶
type ConditionFunc func(ctx SpringCore.ApplicationContext) bool
ConditionFunc 定义 Condition 接口 Matches 方法的类型
type Conditional ¶
type Conditional struct {
// contains filtered or unexported fields
}
Conditional Condition 计算式
func OnBean ¶
func OnBean(selector SpringCore.BeanSelector) *Conditional
OnBean 返回设置了 beanCondition 的 Conditional 对象
func OnExpression ¶
func OnExpression(expression string) *Conditional
OnExpression 返回设置了 expressionCondition 的 Conditional 对象
func OnMatches ¶
func OnMatches(fn ConditionFunc) *Conditional
OnMatches 返回设置了 functionCondition 的 Conditional 对象
func OnMissingBean ¶
func OnMissingBean(selector SpringCore.BeanSelector) *Conditional
OnMissingBean 返回设置了 missingBeanCondition 的 Conditional 对象
func OnMissingProperty ¶
func OnMissingProperty(name string) *Conditional
OnMissingProperty 返回设置了 missingPropertyCondition 的 Conditional 对象
func OnOptionalPropertyValue ¶
func OnOptionalPropertyValue(name string, havingValue interface{}) *Conditional
OnOptionalPropertyValue 返回属性值不存在时默认条件成立的 Conditional 对象
func OnProfile ¶
func OnProfile(profile string) *Conditional
OnProfile 返回设置了 profileCondition 的 Conditional 对象
func OnProperty ¶
func OnProperty(name string) *Conditional
OnProperty 返回设置了 propertyCondition 的 Conditional 对象
func OnPropertyValue ¶
func OnPropertyValue(name string, havingValue interface{}, options ...PropertyValueConditionOption) *Conditional
OnPropertyValue 返回设置了 propertyValueCondition 的 Conditional 对象
func (*Conditional) Matches ¶
func (c *Conditional) Matches(ctx SpringCore.ApplicationContext) bool
Matches 成功返回 true,失败返回 false
func (*Conditional) OnBean ¶
func (c *Conditional) OnBean(selector SpringCore.BeanSelector) *Conditional
OnBean 设置一个 beanCondition
func (*Conditional) OnCondition ¶
func (c *Conditional) OnCondition(cond SpringCore.Condition) *Conditional
OnCondition 设置一个 Condition
func (*Conditional) OnConditionNot ¶
func (c *Conditional) OnConditionNot(cond SpringCore.Condition) *Conditional
OnConditionNot 设置一个取反的 Condition
func (*Conditional) OnExpression ¶
func (c *Conditional) OnExpression(expression string) *Conditional
OnExpression 设置一个 expressionCondition
func (*Conditional) OnMatches ¶
func (c *Conditional) OnMatches(fn ConditionFunc) *Conditional
OnMatches 设置一个 functionCondition
func (*Conditional) OnMissingBean ¶
func (c *Conditional) OnMissingBean(selector SpringCore.BeanSelector) *Conditional
OnMissingBean 设置一个 missingBeanCondition
func (*Conditional) OnMissingProperty ¶
func (c *Conditional) OnMissingProperty(name string) *Conditional
OnMissingProperty 设置一个 missingPropertyCondition
func (*Conditional) OnOptionalPropertyValue ¶
func (c *Conditional) OnOptionalPropertyValue(name string, havingValue interface{}) *Conditional
OnOptionalPropertyValue 设置一个 propertyValueCondition,当属性值不存在时默认条件成立
func (*Conditional) OnProfile ¶
func (c *Conditional) OnProfile(profile string) *Conditional
OnProfile 设置一个 profileCondition
func (*Conditional) OnProperty ¶
func (c *Conditional) OnProperty(name string) *Conditional
OnProperty 设置一个 propertyCondition
func (*Conditional) OnPropertyValue ¶
func (c *Conditional) OnPropertyValue(name string, havingValue interface{}, options ...PropertyValueConditionOption) *Conditional
OnPropertyValue 设置一个 propertyValueCondition
type PropertyValueConditionOption ¶
type PropertyValueConditionOption func(*propertyValueCondition)
func MatchIfMissing ¶
func MatchIfMissing(matchIfMissing bool) PropertyValueConditionOption
MatchIfMissing 当属性值不存在时是否匹配判断条件