OSDN Git Service

* If automatic tagging is not used, value parameter of @ASN1Alternative for CHICE...
[bm-asn1/bm-asn1.git] / jp / bitmeister / asn1 / codec / xer / XerDecoder.java
index 4b31a4f..4991e50 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 BitMeister Inc.
+ * Copyright 2011-2012 BitMeister Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package jp.bitmeister.asn1.codec.xer;
 import static jp.bitmeister.asn1.codec.xer.XerConstants.BOOLEAN_FALSE;
 import static jp.bitmeister.asn1.codec.xer.XerConstants.BOOLEAN_TRUE;
 import static jp.bitmeister.asn1.codec.xer.XerConstants.REAL_MINUS_INFINITY;
+import static jp.bitmeister.asn1.codec.xer.XerConstants.REAL_NAN;
 import static jp.bitmeister.asn1.codec.xer.XerConstants.REAL_PLUS_INFINITY;
 
 import java.io.InputStream;
@@ -68,7 +69,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
  * <p>
  * {@code XerDecoder} is an implementation of {@code ASN1Decoder}. It reads a
  * number of bytes from an {@code InputStream} that is specified when a decoder
- * is instantiated, and decodes them to an ASN.1 data with XML Encoding Rules
+ * is instantiated, and decodes them to an ASN.1 data using XML Encoding Rules
  * (XER).
  * </p>
  * 
@@ -688,6 +689,8 @@ public class XerDecoder implements ASN1Decoder,
                                        data.set(Double.POSITIVE_INFINITY);
                                } else if (qName.equals(REAL_MINUS_INFINITY)) {
                                        data.set(Double.NEGATIVE_INFINITY);
+                               } else if (qName.equals(REAL_NAN)) {
+                                       data.set(Double.NaN);
                                }
                        }