use of org.whole.lang.xsd.mapping.model.UnionMapping in project whole by wholeplatform.
the class CompiledMappingStrategy method getUnionEntityMappings.
public Collection<EntityDescriptor<?>> getUnionEntityMappings(EntityDescriptor<?> context) {
// TODO optimize
String contextURI = unparseEntityDescriptor(context);
AbstractPatternFilterIterator<UnionMapping> i2 = IteratorFactory.<UnionMapping>childMatcherIterator().withPattern(UnionMapping);
i2.reset(strategy.getMappings());
for (UnionMapping mapping : i2) if (contextURI.equals(mapping.getContextEntityType().getValue())) {
Types unionTypes = mapping.getUnionTypes();
int size = unionTypes.wSize();
List<EntityDescriptor<?>> list = new ArrayList<EntityDescriptor<?>>(size);
for (int i = 0; i < size; i++) list.add(parseEntityDescriptor(unionTypes.wGet(i).wStringValue()));
return list;
}
return Collections.emptyList();
}
Aggregations