|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--codec.asn1.ASN1AbstractType
The basic interface for Java objects representing primitive ASN.1 types according to ITU-T Recommendation X.680.
| Constructor Summary | |
ASN1AbstractType()
|
|
| Method Summary | |
void |
checkConstraints()
Checks the constraint on this type if it is set. |
abstract void |
decode(Decoder dec)
|
abstract void |
encode(Encoder enc)
|
Constraint |
getConstraint()
Returns the Constraint of this type or
null if there is none. |
abstract int |
getTag()
Returns the corresponding ASN.1 tag. |
int |
getTagClass()
This default implementation returns UNIVERSAL. |
abstract Object |
getValue()
This abstract method should return the value wrapped by the ASN1Type. |
boolean |
isExplicit()
Returns code>true if this type is tagged EXPLICIT and false
otherwise. |
boolean |
isOptional()
|
boolean |
isType(int tag,
int tagclass)
Returns true if the given tag and tag class matches the
tag and tag class of this instance. |
void |
readExternal(ObjectInput in)
The writeExternal and readExternal methods of the Externalizable interface are implemented by a class to give the serializable class complete control over the format and contents of the stream for an object and its supertypes. |
void |
setConstraint(Constraint constraint)
Sets the Constraint of this type. |
void |
setExplicit(boolean explicit)
Sets the tagging of this type as either EXPLICIT or IMPLICIT. |
void |
setOptional(boolean optional)
Optional types may be present in an encoding but they need not be. |
void |
writeExternal(ObjectOutput out)
The writeExternal and readExternal methods of the Externalizable interface are implemented by a class to give the serializable class complete control over the format and contents of the stream for an object and its supertypes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ASN1AbstractType()
| Method Detail |
public abstract Object getValue()
getValue in interface ASN1Typepublic abstract int getTag()
getTag in interface ASN1Type
public abstract void encode(Encoder enc)
throws ASN1Exception,
IOException
encode in interface ASN1Type
public abstract void decode(Decoder dec)
throws ASN1Exception,
IOException
decode in interface ASN1Typepublic void setOptional(boolean optional)
setOptional in interface ASN1Typeoptional - true iff this type is optional.public boolean isOptional()
isOptional in interface ASN1Typetrue if this type is optional.public int getTagClass()
UNIVERSAL.getTagClass in interface ASN1Typepublic void setExplicit(boolean explicit)
setExplicit in interface ASN1Typeexplicit - true if this type shall be tagged EXPLICIT
and false if it shall be encoded IMPLICIT.public boolean isExplicit()
false
otherwise.isExplicit in interface ASN1Typetrue if this type is tagged EXPLICIT and false
if it is tagged IMPLICIT.
public boolean isType(int tag,
int tagclass)
true if the given tag and tag class matches the
tag and tag class of this instance. This method is used primarily by
decoders and variable types such as ASN1Choice and
ASN1OpenType. It enables decoders to query a
variable type whether a decoded type is accepted.
This method provides a default implementation that matches the given tag
and tag class against the values returned by getTag and
getTagClass respectively.
isType in interface ASN1Typetag - The tag to compare with.tagclass - The tag class to compare with.true if the given tag and tag class matches this
type and false otherwise.public void setConstraint(Constraint constraint)
Constraint of this type. For instance an
ASN.1 INTEGER might be constrained to a certain range such as INTEGER
(0..99). null can be passed as a constraint which disables
constraint checking.setConstraint in interface ASN1Typeconstraint - The Constraint of this type.public Constraint getConstraint()
Constraint of this type or
null if there is none.getConstraint in interface ASN1Typenull.
public void checkConstraints()
throws ConstraintException
checkConstraints in interface ASN1TypeConstraintException - if this type is not in the appropriate range of values.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - -
the stream to write the object toIOException - if an I/0 error has occuredExternalizable
public void readExternal(ObjectInput in)
throws IOException
readExternal in interface Externalizablein - -
the stream to read data from in order to restore the
objectIOException - if an I/0 error has occuredExternalizable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||