use of org.whole.lang.codebase.StringPersistenceProvider in project whole by wholeplatform.
the class PerformHandler method defineBindings.
protected void defineBindings(String behaviorXwl, String predicateXwl, IBindingManager bm) throws Exception {
IPersistenceKit persistenceKit = ReflectionFactory.getDefaultPersistenceKit();
bm.wDef("behaviorEntity", persistenceKit.readModel(new StringPersistenceProvider(behaviorXwl)));
bm.wDef("predicateEntity", persistenceKit.readModel(new StringPersistenceProvider(predicateXwl)));
}
use of org.whole.lang.codebase.StringPersistenceProvider in project whole by wholeplatform.
the class LaunchConfigurationUtils method loadBindingScope.
@SuppressWarnings("unchecked")
public static IBindingScope loadBindingScope(ILaunchConfiguration configuration) throws CoreException {
Map<String, String> environmentMap = configuration.getAttribute(ENVIRONMENT, (Map<String, String>) null);
IBindingScope scope = BindingManagerFactory.instance.createSimpleScope();
if (environmentMap == null)
return scope;
for (String name : environmentMap.keySet()) try {
IEntity entity = XmlBuilderPersistenceKit.instance().readModel(new StringPersistenceProvider(environmentMap.get(name)));
scope.wDef(name, entity);
} catch (Exception e) {
WholePlugin.log(e);
}
return scope;
}
use of org.whole.lang.codebase.StringPersistenceProvider in project whole by wholeplatform.
the class LaunchConfigurationUtils method saveBindingScope.
public static void saveBindingScope(ILaunchConfigurationWorkingCopy configuration, IBindingScope scope) {
Map<String, String> environmentMap = new HashMap<String, String>();
for (String name : scope.wLocalNames()) try {
StringPersistenceProvider pp = new StringPersistenceProvider();
XmlBuilderPersistenceKit.instance().writeModel(scope.wGet(name), pp);
environmentMap.put(name, pp.getStore());
} catch (Exception e) {
WholePlugin.log(e);
}
configuration.setAttribute(ENVIRONMENT, environmentMap);
}
use of org.whole.lang.codebase.StringPersistenceProvider in project whole by wholeplatform.
the class WholeModelWizardPage1 method getInitialContents.
protected InputStream getInitialContents() {
IEntity model = templateFactory.create(templates[templateCombo.getSelectionIndex()]);
persistenceKit = getPersistenceKit(saveAsCombo);
try {
IPersistenceProvider pp = new StringPersistenceProvider();
defineResourceBindings(pp.getBindings(), fileHandle);
persistenceKit.writeModel(model, pp);
return pp.openInputStream();
} catch (Exception e) {
throw new IllegalStateException("error writing file contents", e);
}
}
use of org.whole.lang.codebase.StringPersistenceProvider in project whole by wholeplatform.
the class ActionCallHandler method defineBindings.
protected void defineBindings(String functionUri, String predicateXwl, String analyzing, IBindingManager bm) throws Exception {
IPersistenceKit persistenceKit = ReflectionFactory.getDefaultPersistenceKit();
bm.wDefValue("analyzing", Boolean.parseBoolean(analyzing));
bm.wDefValue("functionUri", functionUri);
bm.wDef("predicateEntity", persistenceKit.readModel(new StringPersistenceProvider(predicateXwl)));
}
Aggregations