/** * Set the metadata information (column info etc.) to be used from the given DTD input. This has precedence to the * other builder's properties. * * @param dtdStream * @throws DataSetException * @throws IOException * @return this */ public FlyWeightFlatXmlDataSetBuilder setMetaDataSetFromDtd(InputStream dtdStream) throws DataSetException, IOException { this.metaDataSet = new FlatDtdDataSet(dtdStream); return this; }
/** * Set the metadata information (column info etc.) to be used from the given DTD input. This has precedence to the * other builder's properties. * * @param dtdReader A reader that provides the DTD content * @throws DataSetException * @throws IOException * @return this */ public FlyWeightFlatXmlDataSetBuilder setMetaDataSetFromDtd(Reader dtdReader) throws DataSetException, IOException { this.metaDataSet = new FlatDtdDataSet(dtdReader); return this; }
@Override protected IDataSet fromResource(Resource resource, DataSetFormatOptions options) throws DataSetException, IOException { return new FlatDtdDataSet(new LinkedHashMapFlatDtdProducer(new InputSource(resource.getInputStream()))); } },
@Override public void startDTD(String name, String publicId, String systemId) throws SAXException { if (flatDtdLogger.isDebugEnabled()) flatDtdLogger.debug("startDTD(name={}, publicId={}, systemId={}) - start", new Object[] { name, publicId, systemId }); _dtdPresent = true; try { // Cache the DTD content to use it as metadata FlatDtdDataSet metaDataSet = new FlatDtdDataSet(); this.setConsumer(metaDataSet); // Set the metaData on the xmlProducer xmlProducer._metaDataSet = metaDataSet; super.startDTD(name, publicId, systemId); } catch (DataSetException e) { throw new SAXException(e); } } }