-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#60 Adding DSL support for passing in RuleExecutors. Allows for use o…
…f java 8 lambdas when defining custom rules.
- Loading branch information
Taylor Wicksell
committed
May 25, 2014
1 parent
2b60352
commit ca0e803
Showing
5 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../org/springjutsu/validation/dsl/OverloadedPropertyAwareSetterAttributeAccessStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.springjutsu.validation.dsl; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
|
||
import org.apache.commons.beanutils.MethodUtils; | ||
import org.apache.commons.beanutils.PropertyUtils; | ||
|
||
import com.fluentinterface.proxy.impl.SetterAttributeAccessStrategy; | ||
|
||
public class OverloadedPropertyAwareSetterAttributeAccessStrategy extends SetterAttributeAccessStrategy { | ||
|
||
@Override | ||
public void setPropertyValue(Object target, String property, Object value) throws IllegalAccessException, | ||
NoSuchMethodException, InvocationTargetException { | ||
MethodUtils.invokeMethod(target, PropertyUtils.getPropertyDescriptor(target, property).getWriteMethod().getName(), value); | ||
} | ||
|
||
} |
24 changes: 20 additions & 4 deletions
24
validation/src/main/java/org/springjutsu/validation/dsl/Validation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters