codec.asn1
Class ASN1NOP

java.lang.Object
  |
  +--codec.asn1.ASN1NOP
All Implemented Interfaces:
ASN1Type

public final class ASN1NOP
extends Object
implements ASN1Type

The ASN1NOP class helps to keep ASN1Types at fixed positions in the internal list. The class realize the Null Object - Pattern . If an optional ASN1Type is not present the ASN1NOP should used to fill its place. So all other ASN1Types in this ASN1Sequence remains at the same position. This class will be ignored while encoding. Other methods than getInstance() or isOptional() will throw an UnsupportedOperationException.

Author:
Frank Lautenschläger Created on 23.07.2004

Method Summary
 void checkConstraints()
          DOCUMENT ME!
 void decode(Decoder dec)
          DOCUMENT ME!
 void encode(Encoder enc)
          The encode method returns without writing anything to the encoder.
 Constraint getConstraint()
          ASN1NOP has no constraints
static ASN1NOP getInstance()
          Returns the singleton
 int getTag()
          DOCUMENT ME!
 int getTagClass()
          (non-Javadoc)
 Object getValue()
          DOCUMENT ME!
 boolean isExplicit()
          (non-Javadoc)
 boolean isOptional()
          The ASN1NOP always has the semantic of optional is true.
 boolean isType(int tag, int tagclass)
          DOCUMENT ME!
 void setConstraint(Constraint o)
          ASN1NOP needs no constraints
 void setExplicit(boolean explicit)
          (non-Javadoc)
 void setOptional(boolean optional)
          The ASN1NOP always has the semantic of optional is true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ASN1NOP getInstance()
Returns the singleton
Returns:
ASN1NOP - singleton instance

getValue

public Object getValue()
DOCUMENT ME!
Specified by:
getValue in interface ASN1Type
Returns:
null
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.getValue()

setOptional

public void setOptional(boolean optional)
The ASN1NOP always has the semantic of optional is true.
Specified by:
setOptional in interface ASN1Type
Parameters:
optional - DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.setOptional(boolean)

isOptional

public boolean isOptional()
The ASN1NOP always has the semantic of optional is true.
Specified by:
isOptional in interface ASN1Type
See Also:
ASN1Type.isOptional()

getTag

public int getTag()
DOCUMENT ME!
Specified by:
getTag in interface ASN1Type
Returns:
DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.getTag()

getTagClass

public int getTagClass()
(non-Javadoc)
Specified by:
getTagClass in interface ASN1Type
Returns:
DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.getTagClass()

setExplicit

public void setExplicit(boolean explicit)
(non-Javadoc)
Specified by:
setExplicit in interface ASN1Type
Parameters:
explicit - DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.setExplicit(boolean)

isExplicit

public boolean isExplicit()
(non-Javadoc)
Specified by:
isExplicit in interface ASN1Type
Returns:
DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.isExplicit()

isType

public boolean isType(int tag,
                      int tagclass)
DOCUMENT ME!
Specified by:
isType in interface ASN1Type
Parameters:
tag - DOCUMENT ME!
tagclass - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.isType(int, int)

encode

public void encode(Encoder enc)
The encode method returns without writing anything to the encoder.
Specified by:
encode in interface ASN1Type
Parameters:
enc - DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.encode(codec.asn1.Encoder)

decode

public void decode(Decoder dec)
DOCUMENT ME!
Specified by:
decode in interface ASN1Type
Parameters:
dec - DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.decode(codec.asn1.Decoder)

setConstraint

public void setConstraint(Constraint o)
ASN1NOP needs no constraints
Specified by:
setConstraint in interface ASN1Type
Parameters:
o - DOCUMENT ME!
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.setConstraint(codec.asn1.Constraint)

getConstraint

public Constraint getConstraint()
ASN1NOP has no constraints
Specified by:
getConstraint in interface ASN1Type
See Also:
ASN1Type.getConstraint()

checkConstraints

public void checkConstraints()
DOCUMENT ME!
Specified by:
checkConstraints in interface ASN1Type
Throws:
UnsupportedOperationException -  
See Also:
ASN1Type.checkConstraints()


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.