com.googlecode.aviator.runtime.function.FunctionUtils Java Examples

The following examples show how to use com.googlecode.aviator.runtime.function.FunctionUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RegexFunction.java    From binlake with Apache License 2.0 5 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String pattern = FunctionUtils.getStringValue(arg1, env);
    String text = FunctionUtils.getStringValue(arg2, env);
    Perl5Matcher matcher = new Perl5Matcher();
    boolean isMatch = matcher.matches(text, PatternUtils.getPattern(pattern));
    return AviatorBoolean.valueOf(isMatch);
}
 
Example #2
Source File: RegexFunction.java    From canal-1.1.3 with Apache License 2.0 5 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String pattern = FunctionUtils.getStringValue(arg1, env);
    String text = FunctionUtils.getStringValue(arg2, env);
    Perl5Matcher matcher = new Perl5Matcher();
    boolean isMatch = matcher.matches(text, PatternUtils.getPattern(pattern));
    return AviatorBoolean.valueOf(isMatch);
}
 
Example #3
Source File: RegexFunction.java    From canal with Apache License 2.0 5 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String pattern = FunctionUtils.getStringValue(arg1, env);
    String text = FunctionUtils.getStringValue(arg2, env);
    Perl5Matcher matcher = new Perl5Matcher();
    boolean isMatch = matcher.matches(text, PatternUtils.getPattern(pattern));
    return AviatorBoolean.valueOf(isMatch);
}
 
Example #4
Source File: RegexFunction.java    From canal with Apache License 2.0 5 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String pattern = FunctionUtils.getStringValue(arg1, env);
    String text = FunctionUtils.getStringValue(arg2, env);
    Perl5Matcher matcher = new Perl5Matcher();
    boolean isMatch = matcher.matches(text, PatternUtils.getPattern(pattern));
    return AviatorBoolean.valueOf(isMatch);
}
 
Example #5
Source File: KeyMatch3Func.java    From jcasbin with Apache License 2.0 4 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String key1 = FunctionUtils.getStringValue(arg1, env);
    String key2 = FunctionUtils.getStringValue(arg2, env);

    return AviatorBoolean.valueOf(BuiltInFunctions.keyMatch3(key1, key2));
}
 
Example #6
Source File: KeyMatchFunc.java    From jcasbin with Apache License 2.0 4 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String key1 = FunctionUtils.getStringValue(arg1, env);
    String key2 = FunctionUtils.getStringValue(arg2, env);

    return AviatorBoolean.valueOf(BuiltInFunctions.keyMatch(key1, key2));
}
 
Example #7
Source File: IPMatchFunc.java    From jcasbin with Apache License 2.0 4 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String ip1 = FunctionUtils.getStringValue(arg1, env);
    String ip2 = FunctionUtils.getStringValue(arg2, env);

    return AviatorBoolean.valueOf(BuiltInFunctions.ipMatch(ip1, ip2));
}
 
Example #8
Source File: KeyMatch2Func.java    From jcasbin with Apache License 2.0 4 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String key1 = FunctionUtils.getStringValue(arg1, env);
    String key2 = FunctionUtils.getStringValue(arg2, env);

    return AviatorBoolean.valueOf(BuiltInFunctions.keyMatch2(key1, key2));
}
 
Example #9
Source File: RegexMatchFunc.java    From jcasbin with Apache License 2.0 4 votes vote down vote up
public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
    String key1 = FunctionUtils.getStringValue(arg1, env);
    String key2 = FunctionUtils.getStringValue(arg2, env);

    return AviatorBoolean.valueOf(BuiltInFunctions.regexMatch(key1, key2));
}