1 /* |
1 /* |
2 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
254 // these screening process is necessary due to the wobble of Float.valueOf method |
254 // these screening process is necessary due to the wobble of Float.valueOf method |
255 return Double.parseDouble(val); |
255 return Double.parseDouble(val); |
256 } |
256 } |
257 |
257 |
258 public boolean parseBoolean(String lexicalXSDBoolean) { |
258 public boolean parseBoolean(String lexicalXSDBoolean) { |
259 return _parseBoolean(lexicalXSDBoolean); |
259 Boolean b = _parseBoolean(lexicalXSDBoolean); |
|
260 return (b == null) ? false : b.booleanValue(); |
260 } |
261 } |
261 |
262 |
262 public static Boolean _parseBoolean(CharSequence literal) { |
263 public static Boolean _parseBoolean(CharSequence literal) { |
263 if (literal == null) { |
264 if (literal == null) { |
264 return null; |
265 return null; |