use of org.whole.lang.operations.ICloneable in project whole by wholeplatform.
the class CompoundResourceRegistry method getFunctionCode.
@SuppressWarnings("unchecked")
public <B extends ICloneable> B getFunctionCode(String functionUri, boolean loadOnDemand, IBindingManager bm) {
ICloneable functionCode = uriCodeMap.get(functionUri);
if (functionCode == null) {
IEntity functionModel = getFunctionModel(functionUri, loadOnDemand, bm);
functionCode = uriCodeMap.get(functionUri);
if (functionModel != null && functionCode == null) {
IBindingManager args = BindingManagerFactory.instance.createArguments();
DynamicCompilerOperation.compile(functionModel, args);
functionCode = uriCodeMap.get(functionUri);
}
}
if (functionCode == null)
// TODO should be configurable
functionCode = IteratorFactory.emptyIterator();
return (B) functionCode.clone();
}
Aggregations