BOOLEAN

The ASN.1 BOOLEAN type is converted to a Java class that extends the Asn1Boolean run-time class. This base class encapsulates the following public member variable:

   public boolean value;

This is where the Boolean value to be encoded is stored. It also contains the result of a decode operation. Since it is public, it can be accessed directly to get or set the value. The generated constructors can also be used to set the value.

The following shows the basic mapping from ASN.1 type to Java class definition:

ASN.1 Production

   <name> ::= BOOLEAN

XSD Type

   <xsd:boolean>

Generated Java class

   public class <name> extends Asn1Boolean { 
      public <name> ()
      { 
         super(); 
      } 
   
      public <name> (boolean value_) 
      { 
         super (value_); 
      }
   }

This definition assumes a simple assignment of the form "<name> ::= BOOLEAN" (i.e., no tagging or subtypes have been added to the BOOLEAN declaration). In this case, no specific encode or decode methods are generated – calls to these methods pass through to the generic calls defined in the base class. This is true of all other primitive type declarations as well unless otherwise noted.