Search in sources :

Example 1 with ICloneable

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();
}
Also used : ICloneable(org.whole.lang.operations.ICloneable) IEntity(org.whole.lang.model.IEntity) IBindingManager(org.whole.lang.bindings.IBindingManager)

Aggregations

IBindingManager (org.whole.lang.bindings.IBindingManager)1 IEntity (org.whole.lang.model.IEntity)1 ICloneable (org.whole.lang.operations.ICloneable)1