Package org.applause.lang.applauseDsl

Examples of org.applause.lang.applauseDsl.Entity


  public void isValidEntityWithAttributes(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
      final Entity entity = IterableExtensions.<Entity>head(_filter);
      final EList<Attribute> attributes = entity.getAttributes();
      int _size = attributes.size();
      Matcher<Integer> _is = CoreMatchers.<Integer>is(Integer.valueOf(2));
      Assert.<Integer>assertThat(Integer.valueOf(_size), _is);
      EList<NamedElement> _elements_1 = model.getElements();
      final Function1<NamedElement,Boolean> _function = new Function1<NamedElement,Boolean>() {
View Full Code Here


  public void isValidEntityWithOneToManyRelationship(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
      final Entity person = IterableExtensions.<Entity>head(_filter);
      EList<Attribute> _attributes = person.getAttributes();
      final Attribute friends = IterableExtensions.<Attribute>head(_attributes);
      boolean _isMany = friends.isMany();
      Matcher<Boolean> _is = CoreMatchers.<Boolean>is(Boolean.valueOf(true));
      Assert.<Boolean>assertThat(Boolean.valueOf(_isMany), _is);
    } catch (Throwable _e) {
View Full Code Here

  @org.jnario.runner.Extension
  public APIClientModuleFileCompiler _aPIClientModuleFileCompiler;
 
  private Entity entity(final CharSequence input, final String entityName) {
    try {
      Entity _xblockexpression = null;
      {
        final Model model = this._parseHelper.parse(input);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
        final Function1<Entity,Boolean> _function = new Function1<Entity,Boolean>() {
          public Boolean apply(final Entity it) {
            String _name = it.getName();
            boolean _equals = Objects.equal(_name, entityName);
            return Boolean.valueOf(_equals);
          }
        };
        Entity _findFirst = IterableExtensions.<Entity>findFirst(_filter, _function);
        _xblockexpression = (_findFirst);
      }
      return _xblockexpression;
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
View Full Code Here

      throw Exceptions.sneakyThrow(_e);
    }
  }
 
  public void isGeneratedHeaderFileFromModel(final CharSequence expectedGeneratedCode, final String entityName, final CharSequence input) {
    final Entity entity = this.entity(input, entityName);
    final CharSequence result = this._aPIClientHeaderFileCompiler.compileHeaderFile(entity);
    String _string = result.toString();
    String _string_1 = expectedGeneratedCode.toString();
    Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
    Assert.<String>assertThat(_string, _equalTo);
View Full Code Here

    Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
    Assert.<String>assertThat(_string, _equalTo);
  }
 
  public void isGeneratedModuleFileFromModel(final CharSequence expectedGeneratedCode, final String entityName, final CharSequence input) {
    final Entity entity = this.entity(input, entityName);
    final CharSequence result = this._aPIClientModuleFileCompiler.compileModuleFile(entity);
    String _string = result.toString();
    String _string_1 = expectedGeneratedCode.toString();
    Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
    Assert.<String>assertThat(_string, _equalTo);
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  public void setResourceType(Entity newResourceType)
  {
    Entity oldResourceType = resourceType;
    resourceType = newResourceType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.DATA_SOURCE__RESOURCE_TYPE, oldResourceType, resourceType));
  }
View Full Code Here

  private EntityClassExtensions _entityClassExtensions;
 
  public CharSequence superTypeForwardDeclaration(final Entity it) {
    StringConcatenation _builder = new StringConcatenation();
    {
      Entity _superType = it.getSuperType();
      boolean _notEquals = (!Objects.equal(_superType, null));
      if (_notEquals) {
        _builder.newLine();
        _builder.append("@class ");
        Entity _superType_1 = it.getSuperType();
        String _typeName = this._typeExtensions.typeName(_superType_1);
        _builder.append(_typeName, "");
        _builder.append(";");
        _builder.newLineIfNotEmpty();
      }
View Full Code Here

@SuppressWarnings("all")
public class DefaultListScreenClassExtensions extends ScreenClassExtensions {
  public Entity resourceType(final Screen it) {
    DataSourceCall _datasource = it.getDatasource();
    DataSource _datasource_1 = _datasource.getDatasource();
    Entity _resourceType = _datasource_1.getResourceType();
    return _resourceType;
  }
View Full Code Here

    _builder.newLine();
    _builder.append("@interface ");
    String _name = it.getName();
    _builder.append(_name, "");
    _builder.append(" : ");
    Entity _superType = it.getSuperType();
    String _typeName = this._typeExtensions.typeName(_superType);
    _builder.append(_typeName, "");
    _builder.newLineIfNotEmpty();
    {
      EList<Attribute> _attributes = it.getAttributes();
View Full Code Here

    _builder.append("#import <Foundation/Foundation.h>");
    _builder.newLine();
    _builder.append("#import \"QuickDialogController.h\"");
    _builder.newLine();
    _builder.append("#import \"");
    Entity _resourceType = this._defaultDetailsScreenClassExtensions.resourceType(it);
    String _entityModelHeaderFileName = this._entityClassExtensions.entityModelHeaderFileName(_resourceType);
    _builder.append(_entityModelHeaderFileName, "");
    _builder.append("\"");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("@interface ");
    String _controllerClassName = this._defaultDetailsScreenClassExtensions.controllerClassName(it);
    _builder.append(_controllerClassName, "");
    _builder.append(" : QuickDialogController");
    _builder.newLineIfNotEmpty();
    _builder.append("@property (nonatomic, strong) ");
    Entity _resourceType_1 = this._defaultDetailsScreenClassExtensions.resourceType(it);
    String _typeName = this._typeExtensions.typeName(_resourceType_1);
    _builder.append(_typeName, "");
    _builder.append(" *item;");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("+ (void)presentForAddingNewItemFromParent:(UIViewController *)parent onDone:(void (^)(");
    Entity _resourceType_2 = this._defaultDetailsScreenClassExtensions.resourceType(it);
    String _typeName_1 = this._typeExtensions.typeName(_resourceType_2);
    _builder.append(_typeName_1, "");
    _builder.append(" *item))doneBlock;");
    _builder.newLineIfNotEmpty();
    _builder.append("+ (void)presentForEditingItem:(");
    Entity _resourceType_3 = this._defaultDetailsScreenClassExtensions.resourceType(it);
    String _typeName_2 = this._typeExtensions.typeName(_resourceType_3);
    _builder.append(_typeName_2, "");
    _builder.append(" *)item fromParent:(UIViewController *)parent onDone:(void (^)(");
    Entity _resourceType_4 = this._defaultDetailsScreenClassExtensions.resourceType(it);
    String _typeName_3 = this._typeExtensions.typeName(_resourceType_4);
    _builder.append(_typeName_3, "");
    _builder.append(" *editedItem))doneBlock;");
    _builder.newLineIfNotEmpty();
    _builder.append("@end");
View Full Code Here

TOP

Related Classes of org.applause.lang.applauseDsl.Entity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.