/** * 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()); }
/** * Adds a nested filenamemapper. * @param fileNameMapper the mapper to add * @exception BuildException if more than one mapper is defined * @since Ant 1.7.0 */ public void add(final FileNameMapper fileNameMapper) throws BuildException { final Mapper mapper = new Mapper(getProject()); mapper.add(fileNameMapper); addMapper(mapper); }
/** * Set the classpath to load the FileNameMapper through via * reference (attribute). * @param ref the reference to the FileNameMapper */ public void setClasspathRef(Reference ref) { if (isReference()) { throw tooManyAttributes(); } createClasspath().setRefid(ref); }
/** * Add a Mapper * @param mapper the mapper to add */ public void addConfiguredMapper(Mapper mapper) { add(mapper.getImplementation()); }
/** * Performs the check for circular references and returns the * referenced Mapper. * @deprecated since Ant 1.7.1 because a mapper might ref a * FileNameMapper implementation directly. * @return the referenced Mapper */ @Deprecated protected Mapper getRef() { return getCheckedRef(Mapper.class, getDataTypeName()); }
if (isReference()) { dieOnCircularReference(); Reference r = getRefid(); Object o = r.getReferencedObject(getProject()); if (o instanceof FileNameMapper) { return (FileNameMapper) o; return ((Mapper) o).getImplementation(); FileNameMapper m = getImplementationClass().newInstance(); final Project p = getProject(); if (p != null) { p.setProjectReference(m);
/** * 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); }
/** * Defines the FileNameMapper to use (nested mapper element). * @return a mapper to be configured * @throws BuildException if more than one mapper defined */ public Mapper createMapper() throws BuildException { if (map != null || mapperElement != null) { throw new BuildException("Cannot define more than one mapper"); } mapperElement = new Mapper(getProject()); return mapperElement; }
/** * Cannot mix add and addconfigured in same type, so * provide this to override the add method. * @param fileNameMapper the <code>FileNameMapper</code> to add. */ public void addConfigured(FileNameMapper fileNameMapper) { add(fileNameMapper); }
/** * Create a merge mapper pointing to the specified destination file. * @param destfile <code>File</code> * @return <code>Mapper</code>. */ protected Mapper createMergeMapper(File destfile) { Mapper result = new Mapper(getProject()); result.setClassname(MergingMapper.class.getName()); result.setTo(destfile.getAbsolutePath()); return result; }
if (m != null) { stk.push(m); m.dieOnCircularReference(stk, p); stk.pop();
/** * Defines the FileNameMapper to use (nested mapper element). * @return a mapper to be configured * @throws BuildException if more than one mapper defined */ public Mapper createMapper() throws BuildException { if (map != null || mapperElement != null) { throw new BuildException("Cannot define more than one mapper"); } mapperElement = new Mapper(getProject()); return mapperElement; }
/** * Add a nested FileNameMapper. * @param fileNameMapper the mapper to add. * @since Ant 1.6.3 */ public void add(FileNameMapper fileNameMapper) { createMapper().add(fileNameMapper); }
/** * Add a <code>Mapper</code>. * @param mapper the <code>Mapper</code> to add. */ public void addConfiguredMapper(Mapper mapper) { add(mapper.getImplementation()); }
/** * Define the mapper to map source to destination files. * @return a mapper to be configured. * @exception BuildException if more than one mapper is defined. */ public Mapper createMapper() throws BuildException { if (mapperElement != null) { throw new BuildException("Cannot define more than one mapper", getLocation()); } mapperElement = new Mapper(getProject()); return mapperElement; }
/** * Add a nested FileNameMapper. * @param fileNameMapper the mapper to add. * @since Ant 1.6.3 */ public void add(FileNameMapper fileNameMapper) { createMapper().add(fileNameMapper); }
/** * get a mapper for a file * @return a filenamemapper for a file */ protected FileNameMapper getMapper() { if (mapperElement != null) { return mapperElement.getImplementation(); } return new IdentityMapper(); }
/** * Defines the FileNameMapper to use (nested mapper element). * @return a mapper to be configured * @throws BuildException if more than one mapper is defined */ public Mapper createMapper() throws BuildException { if (mapperElement != null) { throw new BuildException("Cannot define more than one mapper", getLocation()); } mapperElement = new Mapper(getProject()); return mapperElement; }