use of com.robotoworks.mechanoid.db.sqliteModel.ContentUri in project mechanoid by robotoworks.
the class ContentProviderContractGenerator method generateContractItemsForActions.
public CharSequence generateContractItemsForActions(final Model model, final SqliteDatabaseSnapshot snapshot) {
StringConcatenation _builder = new StringConcatenation();
{
DatabaseBlock _database = model.getDatabase();
ConfigBlock _config = _database.getConfig();
boolean _notEquals = (!Objects.equal(_config, null));
if (_notEquals) {
{
DatabaseBlock _database_1 = model.getDatabase();
ConfigBlock _config_1 = _database_1.getConfig();
EList<ConfigurationStatement> _statements = _config_1.getStatements();
Iterable<ActionStatement> _filter = Iterables.<ActionStatement>filter(_statements, ActionStatement.class);
final Function1<ActionStatement, Boolean> _function = new Function1<ActionStatement, Boolean>() {
public Boolean apply(final ActionStatement it) {
ContentUri _uri = it.getUri();
String _type = _uri.getType();
boolean _containsDefinition = snapshot.containsDefinition(_type);
return Boolean.valueOf((!_containsDefinition));
}
};
Iterable<ActionStatement> _filter_1 = IterableExtensions.<ActionStatement>filter(_filter, _function);
for (final ActionStatement action : _filter_1) {
_builder.append("public static class ");
ContentUri _uri = action.getUri();
String _type = _uri.getType();
String _pascalize = Strings.pascalize(_type);
_builder.append(_pascalize, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
CharSequence _createActionUriBuilderMethod = this.createActionUriBuilderMethod(action);
_builder.append(_createActionUriBuilderMethod, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("public static final String CONTENT_TYPE =");
_builder.newLine();
_builder.append("\t ");
_builder.append("\"vnd.android.cursor.dir/vnd.");
DatabaseBlock _database_2 = model.getDatabase();
String _name = _database_2.getName();
String _lowerCase = _name.toLowerCase();
_builder.append(_lowerCase, "\t ");
_builder.append(".");
ContentUri _uri_1 = action.getUri();
String _type_1 = _uri_1.getType();
_builder.append(_type_1, "\t ");
_builder.append("\";");
_builder.newLineIfNotEmpty();
_builder.append("}");
_builder.newLine();
_builder.newLine();
}
}
}
}
return _builder;
}
Aggregations