< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java

Print this page

        

*** 24,33 **** --- 24,35 ---- */ package com.sun.org.apache.xalan.internal.utils; import com.sun.org.apache.xalan.internal.XalanConstants; + import java.util.concurrent.CopyOnWriteArrayList; + import org.xml.sax.SAXException; /** * This class is not the same as that in Xerces. It is used to manage the * state of corresponding Xerces properties and pass the values over to
*** 413,422 **** --- 415,441 ---- } } } + // Array list to store printed warnings for each SAX parser used + private static final CopyOnWriteArrayList<String> printedWarnings = new CopyOnWriteArrayList<>(); + + /** + * Prints out warnings if a parser does not support the specified feature/property. + * + * @param parserClassName the name of the parser class + * @param propertyName the property name + * @param exception the exception thrown by the parser + */ + public static void printWarning(String parserClassName, String propertyName, SAXException exception) { + String key = parserClassName+":"+propertyName; + if (printedWarnings.addIfAbsent(key)) { + System.err.println( "Warning: "+parserClassName+": "+exception.getMessage()); + } + } + /** * Read from system properties, or those in jaxp.properties * * @param property the type of the property * @param sysPropertyName the name of system property
< prev index next >