Package com.oss.asn1
Class RelaySafeChoice
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.Choice
com.oss.asn1.RelaySafeChoice
- All Implemented Interfaces:
Serializable
,Cloneable
The RelaySafeChoice class represents the ASN.1 CHOICE type but has
additional ability to store unknown extension and make it available for
further relaying.
- Since:
- ASN.1/Java 1.0-beta A
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.RelaySafeChoice
(AbstractData chosen) Construct a RelaySafeChoice with the chosen component.RelaySafeChoice
(AbstractData chosen, int selector) Construct a RelaySafeChoice with the chosen component. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addUnknownExtension
(byte[] unknownExtension, String relayID) Saves the encoding of the unknown extension for further relaying.clone()
Clone 'this' object.void
delete()
Destroy the instance of the AbstractData.final String
Returns the identification of the coder that decoded the unknown extension, saved by theaddUnknownExtension
method.final byte[]
Returns the unknown extension saved for relaying.final void
setChosenValue
(AbstractData value) Overrides thesetChosenValue
method of the superclass to clean up the unknown extension.Methods inherited from class com.oss.asn1.Choice
equalTo, getChosenFlag, getChosenValue, hashCode, hasUnknownExtension
Methods inherited from class com.oss.asn1.AbstractData
equals, getTypeInfo, isEncodable, isPDU, isValid, toString, toString
-
Constructor Details
-
RelaySafeChoice
public RelaySafeChoice()The default constructor. -
RelaySafeChoice
Construct a RelaySafeChoice with the chosen component.- Parameters:
chosen
- the component that is being chosen.
-
RelaySafeChoice
Construct a RelaySafeChoice with the chosen component.- Parameters:
chosen
- the component that is being chosen.selector
- the integer value indicating the chosen component.
-
-
Method Details
-
setChosenValue
Overrides thesetChosenValue
method of the superclass to clean up the unknown extension.- Parameters:
value
- the AbstractData object that is the chosen component.
-
getUnknownExtension
public final byte[] getUnknownExtension()Returns the unknown extension saved for relaying. The unknown extension is represented by the byte array that contains the encoding of the unknown extension with the transfer syntax, identified by thegetRelayID
method.- Returns:
- encoding of the unknown extension
-
addUnknownExtension
Saves the encoding of the unknown extension for further relaying. The unknown extension is represented by the byte array that contains the encoding of the unknown extension with the transfer syntax, identified by therelayID
parameter.- Parameters:
unknownExtension
- encoding of the unknown extensionrelayID
- string that identifies the coder that decoded the unknown extension
-
getRelayID
Returns the identification of the coder that decoded the unknown extension, saved by theaddUnknownExtension
method.- Returns:
- string that identifies the coder that decoded the unknown extension.
-
clone
Clone 'this' object. -
delete
public void delete()Destroy the instance of the AbstractData. The contract of this method is to facilitate garbage collection by explicit destruction of the data that is no longer needed.
-