net.jangaroo.exml.model.AbstractConfigClassToExmlElementAdapter 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 java.util.List;
/**
* An abstract adapter from config class to EXML element.
*/
public abstract class AbstractConfigClassToExmlElementAdapter implements ExmlElement {
protected ConfigClass configClass;
private String ns;
private ExmlElement superElement;
public AbstractConfigClassToExmlElementAdapter(ConfigClass configClass) {
this.configClass = configClass;
}
@Override
public String getNamespace() {
return "exml:" + getPackage();
}
@Override
public void setNs(String shortNamespace) {
ns = shortNamespace;
}
@Override
public String getNs() {
return ns;
}
@Override
public abstract String getTypeName();
@Override
public String getFullTypeName() {
return getNs() + ":" + getTypeName();
}
@Override
public String getDescription() {
return configClass.getDescription();
}
@Override
public List getDirectCfgs() {
return configClass.getDirectCfgs();
}
@Override
public ExmlElement getSuperElement() {
if (superElement == null) {
if (configClass.getSuperClass() == null) {
return null;
}
superElement = createAdapter(configClass.getSuperClass());
}
return superElement;
}
protected abstract ExmlElement createAdapter(ConfigClass configClass);
@Override
public String toString() {
return "<" + getNamespace() + ":" + getName() + ">";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy