use of org.apache.tools.ant.types.resources.MappedResource in project ant by apache.
the class PropertySet method iterator.
/**
* Fulfill the ResourceCollection interface.
* @return an Iterator of Resources.
* @since Ant 1.7
*/
@Override
public Iterator<Resource> iterator() {
if (isReference()) {
return getRef().iterator();
}
dieOnCircularReference();
Stream<Resource> result = getPropertyNames(getEffectiveProperties()).stream().map(name -> new PropertyResource(getProject(), name));
Optional<FileNameMapper> m = Optional.ofNullable(getMapper()).map(Mapper::getImplementation);
if (m.isPresent()) {
result = result.map(p -> new MappedResource(p, m.get()));
}
return result.iterator();
}
Aggregations