/** * Add a <code>Mapper</code>. * @param mapper the <code>Mapper</code> to add. */ public void addConfiguredMapper(Mapper mapper) { add(mapper.getImplementation()); }
return ((Mapper) o).getImplementation();
/** * get a mapper for a file * @return a filenamemapper for a file */ protected FileNameMapper getMapper() { if (mapperElement != null) { return mapperElement.getImplementation(); } return new IdentityMapper(); }
/** * Add a <code>Mapper</code>. * @param mapper the <code>Mapper</code> to add. * @since Ant 1.6.3 */ public void addConfiguredMapper(Mapper mapper) { add(mapper.getImplementation()); }
/** * Add a Mapper * @param mapper the mapper to add */ public void addConfiguredMapper(Mapper mapper) { add(mapper.getImplementation()); }
private FileNameMapper getMapper() { if (mapperElement == null) { MergingMapper mm = new MergingMapper(); mm.setTo(targetFile.getAbsolutePath()); return mm; } return mapperElement.getImplementation(); } }
/** * returns the mapper to use based on nested elements or the * flatten attribute. */ private FileNameMapper getMapper() { FileNameMapper mapper = null; if (mapperElement != null) { mapper = mapperElement.getImplementation(); } else if (flatten) { mapper = new FlatFileNameMapper(); } else { mapper = new IdentityMapper(); } return mapper; }
private Collection<Resource> getCollection() { FileNameMapper m = mapper == null ? new IdentityMapper() : mapper.getImplementation(); Stream<MappedResource> stream; if (enableMultipleMappings) { stream = nested.stream() .flatMap(r -> Stream.of(m.mapFileName(r.getName())) .filter(Objects::nonNull) .map(MergingMapper::new) .map(mm -> new MappedResource(r, mm))); } else { stream = nested.stream().map(r -> new MappedResource(r, m)); } return stream.collect(Collectors.toList()); }
/** * Check the configuration of this ExecuteOn instance. */ @Override protected void checkConfiguration() { // * @TODO using taskName here is brittle, as a user could override it. // * this should probably be modified to use the classname instead. if ("execon".equals(getTaskName())) { log("!! execon is deprecated. Use apply instead. !!"); } super.checkConfiguration(); if (filesets.isEmpty() && resources == null) { throw new BuildException("no resources specified", getLocation()); } if (targetFilePos != null && mapperElement == null) { throw new BuildException("targetfile specified without mapper", getLocation()); } if (destDir != null && mapperElement == null) { throw new BuildException("dest specified without mapper", getLocation()); } if (mapperElement != null) { mapper = mapperElement.getImplementation(); } }
/** * Checks to make sure all settings are kosher. In this case, it * means that the targetdir attribute has been set and we have a mapper. */ @Override public void verifySettings() { if (targetdir == null) { setError("The targetdir attribute is required."); } if (map == null) { if (mapperElement == null) { map = new IdentityMapper(); } else { map = mapperElement.getImplementation(); if (map == null) { setError("Could not set <mapper> element."); } } } }
/** * Checks to make sure all settings are kosher. In this case, it * means that the dest attribute has been set and we have a mapper. */ @Override public void verifySettings() { if (targetdir == null) { setError("The targetdir attribute is required."); } if (map == null) { if (mapperElement == null) { map = new IdentityMapper(); } else { map = mapperElement.getImplementation(); if (map == null) { setError("Could not set <mapper> element."); } } } }
/** * Add a nested <code>FileNameMapper</code>. * @param fileNameMapper the <code>FileNameMapper</code> to add. */ public void add(FileNameMapper fileNameMapper) { if (isReference()) { throw noChildrenAllowed(); } if (container == null) { if (type == null && classname == null) { container = new CompositeMapper(); } else { FileNameMapper m = getImplementation(); if (m instanceof ContainerMapper) { container = (ContainerMapper) m; } else { throw new BuildException(String.valueOf(m) + " mapper implementation does not support nested mappers!"); } } } container.add(fileNameMapper); setChecked(false); }
upToDate = sfs.restrict(new String[] {sourceFile.getAbsolutePath()}, null, null, mapperElement.getImplementation()).length == 0;
final FileNameMapper mapper = mapperElement.getImplementation(); final String[] d = mapper.mapFileName(source.toString()); if (d == null) {
FileNameMapper mapperImpl = mapper == null ? new IdentityMapper() : mapper.getImplementation(); for (Resource r : resources) { String[] mapped = mapperImpl.mapFileName(String.valueOf(r));
final FileNameMapper m = myMapper == null ? null : myMapper.getImplementation();
: mapperElement.getImplementation();
m = mapper.getImplementation();
try { inputTargets = inputMapper.getImplementation().mapFileName(sourcefile); } catch (NullPointerException enPeaEx) { if (sourcefile != null) { try { outputTargets = outputMapper.getImplementation().mapFileName(sourcefile); } catch (NullPointerException enPeaEx) { if (sourcefile != null) { try { errorTargets = errorMapper.getImplementation().mapFileName(sourcefile); } catch (NullPointerException enPeaEx) { if (sourcefile != null) {
/** * Defines the mapper to map source to destination files. * * @param mapper the mapper to use * @throws BuildException if more than one mapper is defined */ public void addMapper(Mapper mapper) throws BuildException { add(mapper.getImplementation()); }