Mercurial > dive4elements > framework
comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java @ 350:ab743e750ac6
Changed namespace awareness in XML parsing to use no auto-boxing. Fixed a stranged compilation bug with OpenJDK.
artifacts/trunk@3311 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 23 Nov 2011 17:17:39 +0000 |
parents | b3eb029e07dd |
children | 6431b7efe240 |
comparison
equal
deleted
inserted
replaced
349:b3eb029e07dd | 350:ab743e750ac6 |
---|---|
209 return null; | 209 return null; |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 public static final Document parseDocument(InputStream inputStream) { | 213 public static final Document parseDocument(InputStream inputStream) { |
214 return parseDocument(inputStream, true); | 214 return parseDocument(inputStream, Boolean.TRUE); |
215 } | 215 } |
216 | 216 |
217 public static final Document parseDocument(InputStream inputStream, Boolean namespaceAware) { | 217 public static final Document parseDocument( |
218 InputStream inputStream, | |
219 Boolean namespaceAware | |
220 ) { | |
218 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); | 221 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
219 | 222 |
220 if (namespaceAware != null) { | 223 if (namespaceAware != null) { |
221 factory.setNamespaceAware(namespaceAware); | 224 factory.setNamespaceAware(namespaceAware.booleanValue()); |
222 } | 225 } |
223 | 226 |
224 try { | 227 try { |
225 return factory.newDocumentBuilder().parse(inputStream); | 228 return factory.newDocumentBuilder().parse(inputStream); |
226 } | 229 } |