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

net.jangaroo.exml.generator.ExmlComponentClassModel Maven / Gradle / Ivy

There is a newer version: 4.1.0-alpha-8
Show newest version
package net.jangaroo.exml.generator;

import net.jangaroo.exml.model.ExmlModel;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * An EXML component to be rendered using Freemarker.
 */
public class ExmlComponentClassModel {
  private ExmlModel model;
  private String formattedConfig;

  public ExmlComponentClassModel(ExmlModel model) {
    this.model = model;
    this.formattedConfig = model.getJsonObject().toString(2, 4).trim();
  }

  public ExmlModel getModel() {
    return model;
  }

  public String getFormattedCfgDefaults() {
    return model.getCfgDefaults().toString(2, 4).trim();
  }

  public String getFormattedConfig() {
    return formattedConfig;
  }

  public Set getAllImports() {
    LinkedHashSet result = new LinkedHashSet();
    result.add("ext.Ext");
    result.add("net.jangaroo.ext.Exml");
    result.addAll(model.getImports());
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy