Search in sources :

Example 6 with ModelDeclaration

use of org.whole.lang.models.model.ModelDeclaration in project whole by wholeplatform.

the class ModelsJavaModelGeneratorVisitor method findFirstConcreteEntity.

private String findFirstConcreteEntity(ModelDeclarations declarations) {
    IEntityIterator<ModelDeclaration> i = IteratorFactory.<ModelDeclaration>childIterator();
    i.reset(declarations);
    for (ModelDeclaration declaration : i) {
        String name = declaration.getName().wStringValue();
        if (!modelInfo.abstractTypes.contains(name))
            return name;
    }
    ModelDeclaration firstModelDeclaration = (ModelDeclaration) declarations.wGet(0);
    return firstModelDeclaration.getName().wStringValue();
}
Also used : ModelDeclaration(org.whole.lang.models.model.ModelDeclaration)

Aggregations

ModelDeclaration (org.whole.lang.models.model.ModelDeclaration)6 Test (org.junit.Test)2 ModelDeclarations (org.whole.lang.models.model.ModelDeclarations)2 Production (org.whole.lang.grammars.model.Production)1 ModelsEntityFactory (org.whole.lang.models.factories.ModelsEntityFactory)1