当前位置: 首页>>代码示例>>Java>>正文


Java Closure.execute方法代码示例

本文整理汇总了Java中org.apache.commons.collections.Closure.execute方法的典型用法代码示例。如果您正苦于以下问题:Java Closure.execute方法的具体用法?Java Closure.execute怎么用?Java Closure.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.collections.Closure的用法示例。


在下文中一共展示了Closure.execute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: up

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
private IntakeNode up(IntakeNode node, Closure closure) {
	//if(node == null)
	
	IntakeNode root = node;
	
	while (root.getParent() != null) {
		closure.execute(root);
		root = root.getParent();
	}

	return root;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:13,代码来源:IntakeNodeWalker.java

示例2: down

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
private void down(List<IntakeNode> children, Closure closure) {
	for (IntakeNode child : children) {
		if (child != null) {
			closure.execute(child);
			down(child.getChildren(), closure);
		}
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:9,代码来源:IntakeNodeWalker.java

示例3: doOnAllPluginJarChangeListener

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
private void doOnAllPluginJarChangeListener(Closure closure) {
    for (WeakReference<PluginJarChangeListener> listener : listeners) {
        PluginJarChangeListener changeListener = listener.get();
        if (changeListener == null) {
            continue;
        }

        try {
            closure.execute(changeListener);
        } catch (Exception e) {
            LOGGER.warn("Plugin listener failed", e);
        }
    }
}
 
开发者ID:gocd,项目名称:gocd,代码行数:15,代码来源:DefaultPluginJarLocationMonitor.java

示例4: tryCatch

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
private void tryCatch(User user, Closure closure, String exceptionMessage) {
    try {
        closure.execute(user);
    } catch (Throwable t) {
        LOG.warn(String.format("User: %s, Error message: %s", user.getUsername(), exceptionMessage), t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:8,代码来源:DeleteUserHelper.java

示例5: applyTransformations

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
private static void applyTransformations(Set<SecurityPolicy> policies, Object entity, PropertyAccessor propAccessor)
        throws IllegalAccessException, InvocationTargetException {
    Transformer transformer = getPropertyTransformer(policies, propAccessor);
    if (transformer != null) {
        Object originalVal = propAccessor.get(entity);
        Object transformedVal = transformer.transform(originalVal);
        propAccessor.set(entity, transformedVal);
    }
    Closure mutator = getPropertyMutator(policies, propAccessor);
    if (mutator != null) {
        mutator.execute(propAccessor.get(entity));
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:14,代码来源:SecurityPolicy.java

示例6: walk

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
/**
 * Walk entries.
 * 
 * @param handler
 *            handler to call.
 * @param filter
 *            filter to use.
 * @throws IllegalArgumentException
 *             if closure or filter is null.
 */
public void walk(final Closure handler, final Predicate filter) throws IllegalArgumentException {
    Assert.assertNotNull(handler, "Handler cannot be null");
    Assert.assertNotNull(filter, "Filter cannot be null");
    for (KeyValue<?> keyValue : this.entries.values()) {
        if (filter.evaluate(keyValue)) {
            handler.execute(keyValue);
        }
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:KeyValueSet.java

示例7: walk

import org.apache.commons.collections.Closure; //导入方法依赖的package包/类
/**
 * Walk entries.
 *
 * @param handler
 *          handler to call.
 * @param filter
 *          filter to use.
 * @throws IllegalArgumentException
 *           if closure or filter is null.
 */
public void walk( final Closure handler, final Predicate filter ) throws IllegalArgumentException {
  Assert.assertNotNull( handler, "Handler cannot be null" );
  Assert.assertNotNull( filter, "Filter cannot be null" );
  for ( KeyValue<?> keyValue : this.entries.values() ) {
    if ( filter.evaluate( keyValue ) ) {
      handler.execute( keyValue );
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:KeyValueSet.java


注:本文中的org.apache.commons.collections.Closure.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。