/** * Copies the reader list from the current Catalog to a new Catalog. * * <p>This method is used internally when constructing a new catalog. * It copies the current reader associations over to the new catalog. * </p> * * @param newCatalog The new Catalog. */ protected void copyReaders(Catalog newCatalog) { // Have to copy the readers in the right order...convert hash to arr Vector mapArr = new Vector(readerMap.size()); // Pad the mapArr out to the right length for (int count = 0; count < readerMap.size(); count++) { mapArr.add(null); } Enumeration en = readerMap.keys(); while (en.hasMoreElements()) { String mimeType = (String) en.nextElement(); Integer pos = (Integer) readerMap.get(mimeType); mapArr.set(pos.intValue(), mimeType); } for (int count = 0; count < mapArr.size(); count++) { String mimeType = (String) mapArr.get(count); Integer pos = (Integer) readerMap.get(mimeType); newCatalog.addReader(mimeType, (CatalogReader) readerArr.get(pos.intValue())); } }
/** * Copies the reader list from the current Catalog to a new Catalog. * * <p>This method is used internally when constructing a new catalog. * It copies the current reader associations over to the new catalog. * </p> * * @param newCatalog The new Catalog. */ protected void copyReaders(Catalog newCatalog) { // Have to copy the readers in the right order...convert hash to arr Vector mapArr = new Vector(readerMap.size()); // Pad the mapArr out to the right length for (int count = 0; count < readerMap.size(); count++) { mapArr.add(null); } Enumeration en = readerMap.keys(); while (en.hasMoreElements()) { String mimeType = (String) en.nextElement(); Integer pos = (Integer) readerMap.get(mimeType); mapArr.set(pos.intValue(), mimeType); } for (int count = 0; count < mapArr.size(); count++) { String mimeType = (String) mapArr.get(count); Integer pos = (Integer) readerMap.get(mimeType); newCatalog.addReader(mimeType, (CatalogReader) readerArr.get(pos.intValue())); } }
/** * Copies the reader list from the current Catalog to a new Catalog. * * <p>This method is used internally when constructing a new catalog. * It copies the current reader associations over to the new catalog. * </p> * * @param newCatalog The new Catalog. */ protected void copyReaders(Catalog newCatalog) { // Have to copy the readers in the right order...convert hash to arr Vector mapArr = new Vector(readerMap.size()); // Pad the mapArr out to the right length for (int count = 0; count < readerMap.size(); count++) { mapArr.add(null); } Enumeration en = readerMap.keys(); while (en.hasMoreElements()) { String mimeType = (String) en.nextElement(); Integer pos = (Integer) readerMap.get(mimeType); mapArr.set(pos.intValue(), mimeType); } for (int count = 0; count < mapArr.size(); count++) { String mimeType = (String) mapArr.get(count); Integer pos = (Integer) readerMap.get(mimeType); newCatalog.addReader(mimeType, (CatalogReader) readerArr.get(pos.intValue())); } }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.ExtendedXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.OASISXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.ExtendedXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.OASISXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.OASISXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }
/** * Attaches the reader to the catalog. */ private void attachReaderToCatalog (Catalog catalog) { SAXParserFactory spf = new SAXParserFactoryImpl(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.OASISXMLCatalogReader"); catalog.addReader("application/xml", saxReader); } }
/** * Setup readers. */ public void setupReaders() { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); SAXCatalogReader saxReader = new SAXCatalogReader(spf); saxReader.setCatalogParser(null, "XCatalog", "org.apache.xml.resolver.readers.XCatalogReader"); saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog", "org.apache.xml.resolver.readers.ExtendedXMLCatalogReader"); addReader("application/xml", saxReader); TR9401CatalogReader textReader = new TR9401CatalogReader(); addReader("text/plain", textReader); }