Search in sources :

Example 1 with AbstractLeafElement

use of ch.interlis.ili2c.metamodel.AbstractLeafElement in project ili2db by claeis.

the class AbstractRecordConverter method getStructWrappers.

public ArrayList<ViewableWrapper> getStructWrappers(Table structClass) {
    ArrayList<ViewableWrapper> ret = new ArrayList<ViewableWrapper>();
    ViewableWrapper structWrapper = class2wrapper.get(structClass);
    if (structWrapper != null) {
        while (structWrapper.getExtending() != null) {
            structWrapper = structWrapper.getExtending();
        }
        ret.add(structWrapper);
        return ret;
    }
    ArrayList<ExtendableContainer<AbstractLeafElement>> exts = new ArrayList<ExtendableContainer<AbstractLeafElement>>();
    exts.addAll(structClass.getDirectExtensions());
    while (exts.size() > 0) {
        structClass = (Table) exts.remove(0);
        structWrapper = class2wrapper.get(structClass);
        if (structWrapper != null) {
            while (structWrapper.getExtending() != null) {
                structWrapper = structWrapper.getExtending();
            }
            ret.add(structWrapper);
        } else {
            exts.addAll(structClass.getDirectExtensions());
        }
    }
    return ret;
}
Also used : ExtendableContainer(ch.interlis.ili2c.metamodel.ExtendableContainer) AbstractLeafElement(ch.interlis.ili2c.metamodel.AbstractLeafElement) ArrayList(java.util.ArrayList) ViewableWrapper(ch.ehi.ili2db.mapping.ViewableWrapper)

Aggregations

ViewableWrapper (ch.ehi.ili2db.mapping.ViewableWrapper)1 AbstractLeafElement (ch.interlis.ili2c.metamodel.AbstractLeafElement)1 ExtendableContainer (ch.interlis.ili2c.metamodel.ExtendableContainer)1 ArrayList (java.util.ArrayList)1