jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java
changeset 27837 86d4f46e622a
parent 25871 b80b84e87032
child 33547 e4c76ac38b12
equal deleted inserted replaced
27581:9fffb959eb41 27837:86d4f46e622a
   480         private static final java.lang.String P_MAX_CHILDREN_PER_ELEMENT = "com.ctc.wstx.maxChildrenPerElement";
   480         private static final java.lang.String P_MAX_CHILDREN_PER_ELEMENT = "com.ctc.wstx.maxChildrenPerElement";
   481         private static final java.lang.String P_MAX_ELEMENT_COUNT = "com.ctc.wstx.maxElementCount";
   481         private static final java.lang.String P_MAX_ELEMENT_COUNT = "com.ctc.wstx.maxElementCount";
   482         private static final java.lang.String P_MAX_ELEMENT_DEPTH = "com.ctc.wstx.maxElementDepth";
   482         private static final java.lang.String P_MAX_ELEMENT_DEPTH = "com.ctc.wstx.maxElementDepth";
   483         private static final java.lang.String P_MAX_CHARACTERS = "com.ctc.wstx.maxCharacters";
   483         private static final java.lang.String P_MAX_CHARACTERS = "com.ctc.wstx.maxCharacters";
   484         private static final java.lang.String P_INTERN_NSURIS = "org.codehaus.stax2.internNsUris";
   484         private static final java.lang.String P_INTERN_NSURIS = "org.codehaus.stax2.internNsUris";
       
   485         private static final java.lang.String P_RETURN_NULL_FOR_DEFAULT_NAMESPACE = "com.ctc.wstx.returnNullForDefaultNamespace";
   485 
   486 
   486         public Woodstox(XMLInputFactory xif) {
   487         public Woodstox(XMLInputFactory xif) {
   487             super(xif);
   488             super(xif);
   488 
   489 
   489             if (xif.isPropertySupported(P_INTERN_NSURIS)) {
   490             if (xif.isPropertySupported(P_INTERN_NSURIS)) {
   549                 );
   550                 );
   550                 xif.setProperty(P_MAX_CHARACTERS, maxCharacters);
   551                 xif.setProperty(P_MAX_CHARACTERS, maxCharacters);
   551                 if (LOGGER.isLoggable(Level.FINE)) {
   552                 if (LOGGER.isLoggable(Level.FINE)) {
   552                     LOGGER.log(Level.FINE, P_MAX_CHARACTERS + " is {0}", maxCharacters);
   553                     LOGGER.log(Level.FINE, P_MAX_CHARACTERS + " is {0}", maxCharacters);
   553                 }
   554                 }
       
   555             }
       
   556             //Using try/catch instead of isPropertySupported because Woodstox
       
   557             //isPropertySupported is not always reliable
       
   558             try {
       
   559                 //this is needed to make sure Woodstox behavior is spec compliant for
       
   560                 //calls to XMLStreamReader.getNamespacePrefix
       
   561                 xif.setProperty(P_RETURN_NULL_FOR_DEFAULT_NAMESPACE, Boolean.TRUE);
       
   562                 if (LOGGER.isLoggable(Level.FINE)) {
       
   563                     LOGGER.log(Level.FINE, P_RETURN_NULL_FOR_DEFAULT_NAMESPACE + " is {0}", xif.getProperty(P_RETURN_NULL_FOR_DEFAULT_NAMESPACE));
       
   564                 }
       
   565             } catch (Throwable t) {
       
   566                 //ignore - this should not happen Woodstox 4.1.2 or later (maybe older version of Woodstox).
       
   567                 LOGGER.log(Level.WARNING, "Expected property not found in Woodstox input factory: '{0}'", P_RETURN_NULL_FOR_DEFAULT_NAMESPACE);
   554             }
   568             }
   555         }
   569         }
   556 
   570 
   557         @Override
   571         @Override
   558         public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
   572         public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {