use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class DataAccessCompiler method doGenerate.
public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
TreeIterator<EObject> _allContents = resource.getAllContents();
Iterable<EObject> _iterable = IteratorExtensions.<EObject>toIterable(_allContents);
Iterable<DataSource> _filter = Iterables.<DataSource>filter(_iterable, DataSource.class);
final Procedure1<DataSource> _function = new Procedure1<DataSource>() {
public void apply(final DataSource it) {
Entity _resourceType = it.getResourceType();
String _entityDataAccessCategoryHeaderFileName = DataAccessCompiler.this._dataAccessClassExtensions.entityDataAccessCategoryHeaderFileName(_resourceType);
CharSequence _compileHeaderFile = DataAccessCompiler.this._entityDataAccessHeaderFileCompiler.compileHeaderFile(it);
fsa.generateFile(_entityDataAccessCategoryHeaderFileName, IosOutputConfigurationProvider.IOS_OUTPUT_DATAACCESS, _compileHeaderFile);
Entity _resourceType_1 = it.getResourceType();
String _entityDataAccessCategoryModuleFileName = DataAccessCompiler.this._dataAccessClassExtensions.entityDataAccessCategoryModuleFileName(_resourceType_1);
CharSequence _compileModuleFile = DataAccessCompiler.this._entityDataAccessModuleFileCompiler.compileModuleFile(it);
fsa.generateFile(_entityDataAccessCategoryModuleFileName, IosOutputConfigurationProvider.IOS_OUTPUT_DATAACCESS, _compileModuleFile);
}
};
IterableExtensions.<DataSource>forEach(_filter, _function);
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class EntityDataAccessExtensions method resourceType.
public Entity resourceType(final DataSourceAccessMethod it) {
EObject _eContainer = it.eContainer();
Entity _resourceType = ((DataSource) _eContainer).getResourceType();
return _resourceType;
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class EntityDataAccessGeneratorSpec method isGeneratedHeaderFileFromModel.
public void isGeneratedHeaderFileFromModel(final CharSequence expectedGeneratedCode, final String dataSourceName, final CharSequence input) {
final DataSource datasource = this.datasource(input, dataSourceName);
final CharSequence result = this._entityDataAccessHeaderFileCompiler.compileHeaderFile(datasource);
String _string = result.toString();
String _string_1 = expectedGeneratedCode.toString();
Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
Assert.<String>assertThat(_string, _equalTo);
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class RESTURLsAbsoluteRESTURLsSpec method baseUrlShouldBe.
public void baseUrlShouldBe(final CharSequence sequence, final String url) {
try {
final Model model = this._parseHelper.parse(sequence);
EList<NamedElement> _elements = model.getElements();
Iterable<DataSource> _filter = Iterables.<DataSource>filter(_elements, DataSource.class);
final DataSource datasource = IterableExtensions.<DataSource>head(_filter);
final AbsoluteRESTURL baseUrl = datasource.getBaseUrl();
String _value = this._rESTURLExtensions.value(baseUrl);
Matcher<String> _is = CoreMatchers.<String>is(url);
Assert.<String>assertThat(_value, _is);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations