net.jangaroo.exml.generator.ExmlComponentClassModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exml-compiler Show documentation
Show all versions of exml-compiler Show documentation
parses an EXML and generates an AS config class
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