protected RenderableSVG toRenderableSVG(String svgfile, URL svgUrl) throws SAXException, IOException { RenderableSVG svg; String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); String svgUri = svgfile; // Remove parameters from file URLs, as it is not supported by Windows if ("file".equals(svgUrl.getProtocol()) && svgUrl.getQuery() != null) { int idx = svgfile.indexOf('?'); if (idx > -1) { svgUri = svgfile.substring(0, idx); } } Document doc = f.createDocument(svgUri); Map<String, String> parameters = getParametersFromUrl(svgfile); if (!parameters.isEmpty() || hasParameters(doc.getDocumentElement())) { replaceParameters(doc.getDocumentElement(), parameters); } svg = new RenderableSVG(doc); return svg; }
/** * Returns the class name of the XML parser to use. * * <p>This method first checks if any XML parser has been specified using * the <code>setXMLParserClassName</code> method. If any, this method will * return the value of the property 'org.xml.sax.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource file. */ public static String getXMLParserClassName() { if (xmlParserClassName == null) { xmlParserClassName = getParserProps().getProperty (XML_PARSER_CLASS_NAME_KEY); } return xmlParserClassName; }
String pn = XMLResourceDescriptor.getCSSParserClassName(); Parser p; try {
/** {@inheritDoc} */ protected void initialize() { if (foObjs == null && batikAvailable) { // this sets the parser that will be used // by default (SVGBrokenLinkProvider) // normally the user agent value is used try { XMLResourceDescriptor.setXMLParserClassName( getAParserClassName()); foObjs = new HashMap<String, Maker>(); foObjs.put("svg", new SE()); foObjs.put(DEFAULT, new SVGMaker()); } catch (Throwable t) { log.error("Error while initializing the Batik SVG extensions", t); // if the classes are not available // the DISPLAY is not checked batikAvailable = false; } } }
String pn = XMLResourceDescriptor.getCSSParserClassName(); Parser p; try {
/** initialize mapping */ protected void initialize() { if (foObjs == null && batikAvail) { // this sets the parser that will be used // by default (SVGBrokenLinkProvider) // normally the user agent value is used try { XMLResourceDescriptor.setXMLParserClassName( getAParserClassName()); foObjs = new HashMap<String, Maker>(); foObjs.put("batik", new SE()); foObjs.put(DEFAULT, new SVGMaker()); } catch (Throwable t) { // if the classes are not available // the DISPLAY is not checked batikAvail = false; } } }
String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); Document doc;
/** * Returns the class name of the XML parser to use. * * <p>This method first checks if any XML parser has been specified using * the <code>setXMLParserClassName</code> method. If any, this method will * return the value of the property 'org.xml.sax.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource file. */ public static String getXMLParserClassName() { if (xmlParserClassName == null) { xmlParserClassName = getParserProps().getProperty (XML_PARSER_CLASS_NAME_KEY); } return xmlParserClassName; }
String pn = XMLResourceDescriptor.getCSSParserClassName(); Parser p; try {
/** * Creates a preference manager. * @param prefFileName the name of the preference file. */ public XMLPreferenceManager(String prefFileName){ this(prefFileName, null, XMLResourceDescriptor.getXMLParserClassName()); }
/** * Returns the class name of the XML parser to use. * * <p>This method first checks if any XML parser has been specified using * the <code>setXMLParserClassName</code> method. If any, this method will * return the value of the property 'org.xml.sax.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource file. */ public static String getXMLParserClassName() { if (xmlParserClassName == null) { xmlParserClassName = getParserProps().getProperty (XML_PARSER_CLASS_NAME_KEY); } return xmlParserClassName; }
/** * Returns the XML parser class name. */ public String getXMLParserClassName() { return XMLResourceDescriptor.getXMLParserClassName(); }
/** * Returns the class name of the CSS parser to use. * * <p>This method first checks if any CSS parser has been * specified using the <code>setCSSParserClassName</code> method. If * any, this method will return the value of the property * 'org.w3c.css.sac.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource * file. */ public static String getCSSParserClassName() { if (cssParserClassName == null) { cssParserClassName = getParserProps().getProperty (CSS_PARSER_CLASS_NAME_KEY); } return cssParserClassName; }
/** * Returns the class name of the XML parser. */ public String getXMLParserClassName() { return XMLResourceDescriptor.getXMLParserClassName(); }
/** * Returns the class name of the CSS parser to use. * * <p>This method first checks if any CSS parser has been * specified using the <code>setCSSParserClassName</code> method. If * any, this method will return the value of the property * 'org.w3c.css.sac.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource * file. */ public static String getCSSParserClassName() { if (cssParserClassName == null) { cssParserClassName = getParserProps().getProperty (CSS_PARSER_CLASS_NAME_KEY); } return cssParserClassName; }
/** * Returns the XML parser to use */ public String getXMLParserClassName() { return XMLResourceDescriptor.getXMLParserClassName(); }
/** * Returns the class name of the CSS parser to use. * * <p>This method first checks if any CSS parser has been * specified using the <code>setCSSParserClassName</code> method. If * any, this method will return the value of the property * 'org.w3c.css.sac.driver' specified in the * <code>resources/XMLResourceDescriptor.properties</code> resource * file. */ public static String getCSSParserClassName() { if (cssParserClassName == null) { cssParserClassName = getParserProps().getProperty (CSS_PARSER_CLASS_NAME_KEY); } return cssParserClassName; }
/** * Creates a preference manager. * @param prefFileName the name of the preference file. */ public XMLPreferenceManager(String prefFileName){ this(prefFileName, null, XMLResourceDescriptor.getXMLParserClassName()); }
/** * Creates a preference manager. * @param prefFileName the name of the preference file. * @param defaults where to get defaults value if the value is * not specified in the file. */ public XMLPreferenceManager(String prefFileName, Map defaults){ this(prefFileName, defaults, XMLResourceDescriptor.getXMLParserClassName()); }
/** * Returns the class name of the XML parser. */ public String getXMLParserClassName() { return XMLResourceDescriptor.getXMLParserClassName(); }