/** * Get the XML catalog containing entity definitions * * @return the XML catalog for the task. */ public XMLCatalog getXMLCatalog() { xmlCatalog.setProject(getProject()); return xmlCatalog; }
/** * Initialize internal instance of XMLCatalog. * Initialize XPath for parameter evaluation. * @throws BuildException on error */ @Override public void init() throws BuildException { super.init(); xmlCatalog.setProject(getProject()); xpathFactory = XPathFactory.newInstance(); xpath = xpathFactory.newXPath(); xpath.setXPathVariableResolver( variableName -> getProject().getProperty(variableName.toString())); }
/** * Set the optional classpath to the XSL processor * * @return a path instance to be configured by the Ant core. */ public Path createClasspath() { if (classpath == null) { classpath = new Path(getProject()); } return classpath.createPath(); }
/** * If a custom classpath has been defined but no loader created * yet, create the classloader and set it as the context * classloader. */ private void setupLoader() { if (classpath != null && loader == null) { loader = getProject().createClassLoader(classpath); loader.setThreadContextLoader(); } }
/** * 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); }
/** * Loads the stylesheet and set xsl:param parameters. * * @param stylesheet the file from which to load the stylesheet. * @exception BuildException if the stylesheet cannot be loaded. * @deprecated since Ant 1.7 */ @Deprecated protected void configureLiaison(final File stylesheet) throws BuildException { final FileResource fr = new FileResource(); fr.setProject(getProject()); fr.setFile(stylesheet); configureLiaison(fr); }
baseDir = getProject().getBaseDir(); File stylesheet = getProject().resolveFile(xslFile); if (!stylesheet.exists()) { final File alternative = FILE_UTILS.resolveFile(baseDir, xslFile); fr.setProject(getProject()); fr.setFile(stylesheet); styleResource = fr;
/** * Specific configuration for the TRaX liaison. * @param xsltTask the XSLTProcess task instance from which this liaison * is to be configured. */ public void configure(final XSLTProcess xsltTask) { project = xsltTask.getProject(); final XSLTProcess.Factory factory = xsltTask.getFactory(); if (factory != null) { setFactory(factory.getName()); // configure factory attributes StreamUtils.enumerationAsStream(factory.getAttributes()) .forEach(attr -> setAttribute(attr.getName(), attr.getValue())); factory.getFeatures() .forEach(feature -> setFeature(feature.getName(), feature.getValue())); } final XMLCatalog xmlCatalog = xsltTask.getXMLCatalog(); // use XMLCatalog as the entity resolver and URI resolver if (xmlCatalog != null) { setEntityResolver(xmlCatalog); setURIResolver(xmlCatalog); } // configure output properties StreamUtils.enumerationAsStream(xsltTask.getOutputProperties()) .forEach(prop -> setOutputProperty(prop.getName(), prop.getValue())); suppressWarnings = xsltTask.getSuppressWarnings(); traceConfiguration = xsltTask.getTraceConfiguration(); }