Search in sources :

Example 1 with URLPersistenceProvider

use of org.whole.lang.codebase.URLPersistenceProvider in project whole by wholeplatform.

the class ReusablesDynamicCompilerVisitor method visit.

@Override
public void visit(URL entity) {
    entity.getPersistence().accept(this);
    IEntityIterator<?> persistenceIterator = getResultIterator();
    entity.getContent().accept(this);
    IEntityIterator<?> contentIterator = getResultIterator();
    setResultIterator(IteratorFactory.composeIterator(IteratorFactory.singleValuedRunnableIterator(new ResourcePersistenceRunnable() {

        protected IPersistenceProvider getPersistenceProvider(String path, IBindingManager bm) {
            try {
                return new URLPersistenceProvider(new java.net.URL(path), bm);
            } catch (MalformedURLException e) {
                throw new WholeIllegalArgumentException(e).withSourceEntity(entity).withBindings(bm);
            }
        }
    }, new int[] { 0 }, persistenceIterator).withSourceEntity(entity), contentIterator));
}
Also used : MalformedURLException(java.net.MalformedURLException) IBindingManager(org.whole.lang.bindings.IBindingManager) URLPersistenceProvider(org.whole.lang.codebase.URLPersistenceProvider) WholeIllegalArgumentException(org.whole.lang.exceptions.WholeIllegalArgumentException)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 IBindingManager (org.whole.lang.bindings.IBindingManager)1 URLPersistenceProvider (org.whole.lang.codebase.URLPersistenceProvider)1 WholeIllegalArgumentException (org.whole.lang.exceptions.WholeIllegalArgumentException)1