/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri, InputStream is) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri, is); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }
documentFactory.setValidating(userAgent.isXMLParserValidating()); document = documentFactory.createSVGDocument(null, new StringReader(svgText)); document = documentFactory.createSVGDocument(null, new ByteArrayInputStream(svgData));
/** * Constructs a new <code>DocumentLoader</code> with the specified XML parser. * @param userAgent the user agent to use */ public DocumentLoader(UserAgent userAgent) { this.userAgent = userAgent; documentFactory = new SAXSVGDocumentFactory (userAgent.getXMLParserClassName(), true); documentFactory.setValidating(userAgent.isXMLParserValidating()); }
/** * Constructs a new <code>DocumentLoader</code> with the specified XML parser. * @param userAgent the user agent to use */ public DocumentLoader(UserAgent userAgent) { this.userAgent = userAgent; documentFactory = new SAXSVGDocumentFactory (userAgent.getXMLParserClassName(), true); documentFactory.setValidating(userAgent.isXMLParserValidating()); }
/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }
/** * Constructs a new <code>DocumentLoader</code> with the specified XML parser. * @param userAgent the user agent to use */ public DocumentLoader(UserAgent userAgent) { this.userAgent = userAgent; documentFactory = new SAXSVGDocumentFactory (userAgent.getXMLParserClassName(), true); documentFactory.setValidating(userAgent.isXMLParserValidating()); }
/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }
/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri, InputStream is) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri, is); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }
/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri, InputStream is) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri, is); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }
/** * Returns a document from the specified uri. * @param uri the uri of the document * @exception IOException if an I/O error occured while loading * the document */ public Document loadDocument(String uri) throws IOException { Document ret = checkCache(uri); if (ret != null) return ret; SVGDocument document = documentFactory.createSVGDocument(uri); DocumentDescriptor desc = documentFactory.getDocumentDescriptor(); DocumentState state = new DocumentState(uri, document, desc); synchronized (cacheMap) { cacheMap.put(uri, state); } return state.getDocument(); }