use of org.applause.lang.applauseDsl.RESTSpecification in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForUpdate.
public String dataAccessMethodNameForUpdate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.PUT);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.RESTSpecification in project applause by applause.
the class DataSourceAccessMethodImpl method basicSetRestSpecification.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRestSpecification(RESTSpecification newRestSpecification, NotificationChain msgs) {
RESTSpecification oldRestSpecification = restSpecification;
restSpecification = newRestSpecification;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.DATA_SOURCE_ACCESS_METHOD__REST_SPECIFICATION, oldRestSpecification, newRestSpecification);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.applause.lang.applauseDsl.RESTSpecification in project applause by applause.
the class DefaultListScreenEditActionCompiler method deleteMethod.
public DataSourceAccessMethod deleteMethod(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.DELETE);
return Boolean.valueOf(_equals);
}
};
Iterable<DataSourceAccessMethod> _filter = IterableExtensions.<DataSourceAccessMethod>filter(_methods, _function);
DataSourceAccessMethod _head = IterableExtensions.<DataSourceAccessMethod>head(_filter);
return _head;
}
use of org.applause.lang.applauseDsl.RESTSpecification in project applause by applause.
the class EntityDataAccessHeaderFileCompiler method compileRESTMethod.
public CharSequence compileRESTMethod(final DataSourceAccessMethod it) {
CharSequence _switchResult = null;
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
final RESTVerb _switchValue = _verb;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.GET)) {
_matched = true;
CharSequence _compileGETLISTMethod = this.compileGETLISTMethod(it);
_switchResult = _compileGETLISTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.POST)) {
_matched = true;
CharSequence _compilePOSTMethod = this.compilePOSTMethod(it);
_switchResult = _compilePOSTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.PUT)) {
_matched = true;
CharSequence _compilePUTMethod = this.compilePUTMethod(it);
_switchResult = _compilePUTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.DELETE)) {
_matched = true;
CharSequence _compileDELETEMethod = this.compileDELETEMethod(it);
_switchResult = _compileDELETEMethod;
}
}
return _switchResult;
}
use of org.applause.lang.applauseDsl.RESTSpecification in project applause by applause.
the class EntityDataAccessModuleFileCompiler method compileRESTMethod.
public CharSequence compileRESTMethod(final DataSourceAccessMethod it) {
CharSequence _switchResult = null;
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
final RESTVerb _switchValue = _verb;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.GET)) {
_matched = true;
CharSequence _compileGETLISTMethod = this.compileGETLISTMethod(it);
_switchResult = _compileGETLISTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.POST)) {
_matched = true;
CharSequence _compilePOSTMethod = this.compilePOSTMethod(it);
_switchResult = _compilePOSTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.PUT)) {
_matched = true;
CharSequence _compilePUTMethod = this.compilePUTMethod(it);
_switchResult = _compilePUTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.DELETE)) {
_matched = true;
CharSequence _compileDELETEMethod = this.compileDELETEMethod(it);
_switchResult = _compileDELETEMethod;
}
}
return _switchResult;
}
Aggregations