List<MappingFactor> results = Lists.create();
if (mapping == null) {
for (PropertyDeclaration property : sourceModel.getDeclaredProperties()) {
PropertyDeclaration targetProperty = model.findPropertyDeclaration(property.getName().identifier);
if (targetProperty != null) {
results.add(new MappingFactor(
source.getName(),
PropertyMappingKind.ANY,
source.createPropertySymbol(property.getName()),
targetProperty.getSymbol()));
}
}
} else {
for (AstPropertyMapping propertyMapping : mapping.properties) {
PropertyDeclaration targetProperty = model.findPropertyDeclaration(propertyMapping.target.identifier);
if (targetProperty != null) {
results.add(new MappingFactor(
source.getName(),
PropertyMappingKind.ANY,
source.createPropertySymbol(propertyMapping.source),
targetProperty.getSymbol()));
}