Search in sources :

Example 11 with SimpleName

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

the class ModelsJavaModelGeneratorVisitor method visit.

public void visit(SubtypesOf entity) {
    List<String> types = new ArrayList<String>();
    AbstractPatternFilterIterator<SimpleName> i = IteratorFactory.<SimpleName>childMatcherIterator().withPattern(ModelsEntityDescriptorEnum.SimpleName);
    i.reset(entity.getTypes());
    for (SimpleName name : i) types.add(name.wStringValue());
    ForeignType foreignType = entity.getForeignType();
    if (Matcher.matchImpl(ModelsEntityDescriptorEnum.AnyType, foreignType))
        modelsGen.entityDescriptorEnumBuilder().addSetAssignableToAll(types.toArray(new String[types.size()]));
    else
        modelsGen.entityDescriptorEnumBuilder().addSetAssignableToForeignType(foreignType.wStringValue(), types.toArray(new String[types.size()]));
}
Also used : ForeignType(org.whole.lang.models.model.ForeignType) SimpleName(org.whole.lang.models.model.SimpleName) ArrayList(java.util.ArrayList)

Aggregations

SimpleName (org.whole.lang.models.model.SimpleName)11 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)2 ForeignType (org.whole.lang.models.model.ForeignType)2 Model (org.whole.lang.models.model.Model)2 IBindingManager (org.whole.lang.bindings.IBindingManager)1 IBindingScope (org.whole.lang.bindings.IBindingScope)1 IEntity (org.whole.lang.model.IEntity)1 XmlModel (org.whole.lang.models.codebase.XmlModel)1 FeatureModifiers (org.whole.lang.models.model.FeatureModifiers)1 SimpleEntity (org.whole.lang.models.model.SimpleEntity)1 QueriesEntityFactory (org.whole.lang.queries.factories.QueriesEntityFactory)1 TestingModel (org.whole.lang.testentities.codebase.TestingModel)1