/** * Get the mapper attribute. * @return the mapper attribute. */ public Mapper getMapper() { if (isReference()) { return getRef().mapper; } dieOnCircularReference(); return mapper; }
/** * A debug toString. * This gets a comma separated list of key=value pairs for * the properties in the set. * The output order is sorted according to the keys' <i>natural order</i>. * @return a string rep of this object. */ @Override public String toString() { if (isReference()) { return getRef().toString(); } dieOnCircularReference(); return new TreeMap<>(getPropertyMap()).entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining(", ")); }
/** * Get the dynamic attribute. * @return true if the property set is to be evaluated each time it is used. */ public boolean getDynamic() { if (isReference()) { return getRef().dynamic; } dieOnCircularReference(); return dynamic; }
/** * Fulfill the ResourceCollection contract. * @return the size of this ResourceCollection. */ @Override public int size() { return isReference() ? getRef().size() : getProperties().size(); }
/** * Fulfill the ResourceCollection contract. * @return whether this is a filesystem-only resource collection. */ @Override public boolean isFilesystemOnly() { if (isReference()) { return getRef().isFilesystemOnly(); } dieOnCircularReference(); return false; }
/** * 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(); }
getRef().addPropertyNames(names, props);
return getRef().getPropertyMap();