/** * Returns a new FopFactory instance that is configured using the {@link FopFactoryConfig} object that * is created when the fopConf is parsed. * * @param fopConf the fop conf configuration file to parse * @return the requested FopFactory instance. * @throws IOException * @throws SAXException */ public static FopFactory newInstance(File fopConf) throws SAXException, IOException { return new FopConfParser(fopConf).getFopFactoryBuilder().build(); }
setHyphenationBase(cfg, resourceResolver, baseURI, fopFactoryBuilder); setHyphPatNames(cfg, fopFactoryBuilder, strict); configureImageLoading(cfg.getChild("image-loading", false), strict);
addError("The lang attribute of a hyphenation-pattern configuration" + " element must exist (" + location + ")", error); } else if (!lang.matches("[a-zA-Z]{2}")) { addError("The lang attribute of a hyphenation-pattern configuration" + " element must consist of exactly two letters (" + location + ")", error); addError("The country attribute of a hyphenation-pattern configuration" + " element must consist of exactly two letters (" + location + ")", error); addError("The value of a hyphenation-pattern configuration" + " element may not be empty (" + location + ")", error);
public FopConfParser(InputStream fopConfStream, URI baseURI, EnvironmentProfile enviro) throws SAXException, IOException { DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg; try { cfg = cfgBuilder.build(fopConfStream); } catch (ConfigurationException e) { throw new FOPException(e); } // The default base URI is taken from the directory in which the fopConf resides fopFactoryBuilder = new FopFactoryBuilder(enviro).setConfiguration(cfg); configure(baseURI, enviro.getResourceResolver(), cfg); }
/** * Returns a new FopFactory instance that is configured using the {@link FopFactoryConfig} object that * is created when the fopConf is parsed. * * @param baseURI the base URI to resolve resource URIs against * @param confStream the fop conf configuration stream to parse * @return the requested FopFactory instance. * @throws SAXException * @throws IOException */ public static FopFactory newInstance(URI baseURI, InputStream confStream) throws SAXException, IOException { return new FopConfParser(confStream, baseURI).getFopFactoryBuilder().build(); }
FOPTaskStarter(Fop task) throws SAXException, IOException { this.task = task; //Set base directory if (task.getBasedir() != null) { this.baseUri = task.getBasedir().toURI(); } else { if (task.getFofile() != null) { this.baseUri = task.getFofile().getParentFile().toURI(); } } if (task.getUserconfig() != null) { FopFactoryBuilder confBuilder = new FopConfParser( task.getUserconfig()).getFopFactoryBuilder(); confBuilder.setBaseURI(baseUri); fopFactory = confBuilder.build(); } else { fopFactory = FopFactory.newInstance(baseUri); } }
} else { try { FopConfParser fopConfParser = new FopConfParser(userConfigFile, baseURI); fopFactoryBuilder = fopConfParser.getFopFactoryBuilder(); if (this.overrideTargetResolution) { fopFactoryBuilder.setTargetResolution(targetResolution);