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

com.reprezen.genflow.rapidml.xsd.ParamsHelper Maven / Gradle / Ivy

package com.reprezen.genflow.rapidml.xsd;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.google.common.base.Objects;
import com.reprezen.genflow.api.template.IGenTemplateContext;
import com.reprezen.genflow.rapidml.xsd.Helpers;
import com.reprezen.genflow.rapidml.xsd.XMLSchemaGenTemplate;
import java.util.Map;

@SuppressWarnings("all")
public class ParamsHelper {
  private final XMLSchemaGenTemplate.Config config;
  
  public ParamsHelper(final Helpers helpers) {
    YAMLFactory _yAMLFactory = new YAMLFactory();
    ObjectMapper _objectMapper = new ObjectMapper(_yAMLFactory);
    IGenTemplateContext _context = helpers.getContext();
    Map _genTargetParameters = _context.getGenTargetParameters();
    XMLSchemaGenTemplate.Config _convertValue = _objectMapper.convertValue(_genTargetParameters, XMLSchemaGenTemplate.Config.class);
    this.config = _convertValue;
  }
  
  public boolean eltStyle() {
    XMLSchemaGenTemplate.ValueForm _valueForm = this.config.getValueForm();
    return Objects.equal(_valueForm, XMLSchemaGenTemplate.ValueForm.ELEMENT);
  }
  
  public boolean attrStyle() {
    XMLSchemaGenTemplate.ValueForm _valueForm = this.config.getValueForm();
    return Objects.equal(_valueForm, XMLSchemaGenTemplate.ValueForm.ATTRIBUTE);
  }
  
  public String getListItemElementName() {
    return this.config.getListItemElementName();
  }
  
  public boolean allowEmptyLists() {
    return this.config.isAllowEmptyLists();
  }
  
  public XMLSchemaGenTemplate.TypeNamingMethod typeNamingMethod() {
    return this.config.getTypeNamingMethod();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy