All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.reprezen.genflow.rapidml.wadl.xtend.ParamsHelper Maven / Gradle / Ivy

The newest version!
package com.reprezen.genflow.rapidml.wadl.xtend;

import com.google.common.base.Objects;
import com.google.common.collect.Maps;
import com.reprezen.genflow.api.trace.GenTemplateTrace;
import com.reprezen.genflow.api.trace.GenTemplateTraceItem;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;

@SuppressWarnings("all")
public class ParamsHelper {
  private final Map xsdParams;
  
  public ParamsHelper(final GenTemplateTrace trace) {
    Map _elvis = null;
    final Function1 _function = (GenTemplateTraceItem it) -> {
      String _type = it.getType();
      return Boolean.valueOf(Objects.equal(_type, "params"));
    };
    GenTemplateTraceItem _findFirst = IterableExtensions.findFirst(trace.getTraceItems(), _function);
    Map _properties = null;
    if (_findFirst!=null) {
      _properties=_findFirst.getProperties();
    }
    if (_properties != null) {
      _elvis = _properties;
    } else {
      HashMap _newHashMap = Maps.newHashMap();
      _elvis = _newHashMap;
    }
    this.xsdParams = _elvis;
  }
  
  public boolean isEltStyle() {
    String _valueForm = this.getValueForm();
    return Objects.equal(_valueForm, "ELEMENT");
  }
  
  public boolean isAttrStyle() {
    String _valueForm = this.getValueForm();
    return Objects.equal(_valueForm, "ATTRIBUTE");
  }
  
  private String getValueForm() {
    String _elvis = null;
    String _get = this.xsdParams.get("valueForm");
    if (_get != null) {
      _elvis = _get;
    } else {
      _elvis = "ATTRIBUTE";
    }
    return _elvis;
  }
  
  public String getListItemElementName() {
    String _elvis = null;
    String _get = this.xsdParams.get("listItemElementName");
    if (_get != null) {
      _elvis = _get;
    } else {
      _elvis = "item";
    }
    return _elvis;
  }
  
  public Boolean isAllowEmptyLists() {
    String _elvis = null;
    String _get = this.xsdParams.get("allowEmptyLists");
    if (_get != null) {
      _elvis = _get;
    } else {
      _elvis = "false";
    }
    return Boolean.valueOf(_elvis);
  }
  
  public String getTypeNamingMethod() {
    String _elvis = null;
    String _get = this.xsdParams.get("typeNamingMethod");
    if (_get != null) {
      _elvis = _get;
    } else {
      _elvis = "SIMPLE_NAME";
    }
    return _elvis;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy