net.jangaroo.exml.model.ExmlModel 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.model;
import net.jangaroo.jooc.json.JsonObject;
import net.jangaroo.exml.utils.ExmlUtils;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
public class ExmlModel extends DescriptionHolder {
private String packageName;
private String className;
private String superClassName;
private Set imports = new LinkedHashSet();
private List annotations = new ArrayList();
private List vars = new ArrayList();
private JsonObject jsonObject = new JsonObject();
private ConfigClass configClass;
private JsonObject cfgDefaults = new JsonObject();
public String getPackageName() {
return packageName;
}
public String getClassName() {
return className;
}
public String getFullClassName() {
return packageName.length() > 0 ? packageName + "." + className : className;
}
public String getSuperClassName() {
return superClassName;
}
public Set getImports() {
return imports;
}
public List getAnnotations() {
return annotations;
}
public List getVars() {
return vars;
}
public void addVar(Declaration var) {
vars.add(var);
addImport(var.getType());
}
public JsonObject getJsonObject() {
return jsonObject;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public void setClassName(String className) {
this.className = className;
}
public void setSuperClassName(String superClassName) {
this.superClassName = superClassName;
}
public void addImport(String importedClassName) {
ExmlUtils.addImport(imports, importedClassName);
}
public void addAnnotation(String annotation) {
annotations.add(annotation);
}
public ConfigClass getConfigClass() {
return configClass;
}
public void setConfigClass(ConfigClass configClass) {
this.configClass = configClass;
addImport(configClass.getFullName());
}
public JsonObject getCfgDefaults() {
return cfgDefaults;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy