use of org.whole.lang.models.model.ForeignType in project whole by wholeplatform.
the class ModelsJavaModelGeneratorVisitor method visit.
public void visit(SupertypesOf 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().addSetAssignableFromAll(types.toArray(new String[types.size()]));
else
modelsGen.entityDescriptorEnumBuilder().addSetAssignableFromForeignType(foreignType.wStringValue(), types.toArray(new String[types.size()]));
}
use of org.whole.lang.models.model.ForeignType 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()]));
}
Aggregations