|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.bitmeister.asn1.type.ASN1Type
public abstract class ASN1Type
The base class for all ASN.1 types.
This class provides general interfaces and common methods for all classes
that represent ASN.1 types in this library. Any sub-classes of
ASN1Type
which to be instantiated must be declared as public
(and static
if the class is a member class), and have a
public
constructor with no argument.
User defined ASN.1 types must not extend ASN1Type
directly, but use
one of built-in (or useful) types as the base class.
Field Summary | |
---|---|
static ASN1Processor<java.lang.String,ASN1RuntimeException> |
stringBuilder
An ASN1Processor that returns a String , is used in the
toString() method. |
Constructor Summary | |
---|---|
protected |
ASN1Type()
The constructor with no argument. |
Method Summary | ||
---|---|---|
abstract
|
accept(ASN1Visitor<E> visitor)
Accepts the ASN1Visitor and calls a visit method of the
visitor. |
|
abstract void |
clear()
Clears the value of this ASN.1 data. |
|
abstract java.lang.Object |
clone()
Creates and returns a copy of this ASN.1 data. |
|
boolean |
equals(java.lang.Object other)
Tests if the type and the value of this ASN.1 data equals the other ASN.1 data. |
|
abstract int |
hashCode()
Returns a hash code value for this ASN.1 data. |
|
abstract boolean |
hasValue()
Tests if this ASN.1 data has value. |
|
static
|
instantiate(java.lang.Class<T> type)
Instantiates an ASN.1 data of the type specified by the Class
parameter. |
|
boolean |
matches(ASN1TagClass tagClass,
int tagNumber)
Tests if the ASN.1 tag matches this ASN1 type. |
|
TypeSpecification |
specification()
Returns a TypeSpecification instance that associated to this
ASN.1 type. |
|
java.lang.String |
toString()
Returns a string representation of this ASN.1 data. |
|
void |
validate()
Tests if this ASN.1 data has valid value. |
|
abstract boolean |
valueEquals(java.lang.Object other)
Tests if the value of this ASN.1 data equals the value of the other ASN.1 data. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static ASN1Processor<java.lang.String,ASN1RuntimeException> stringBuilder
ASN1Processor
that returns a String
, is used in the
toString()
method. In default, an instance of
ASN1StringBuilder
is set. To modify output of toString()
method of ASN.1 types, user defined processor can be assigned. If
null
is assigned to this field, toString()
returns the
result of Object.toString()
.
ASN1Processor
,
ASN1StringBuilder
Constructor Detail |
---|
protected ASN1Type()
Method Detail |
---|
public static <T extends ASN1Type> T instantiate(java.lang.Class<T> type)
Class
parameter.
type
- The ASN.1 type to be instantiated.
public TypeSpecification specification()
TypeSpecification
instance that associated to this
ASN.1 type.
TypeSpecification
instance.public boolean matches(ASN1TagClass tagClass, int tagNumber)
tagClass
- The ASN.1 tag class.tagNumber
- The ASN.1 tag number.
true
when the tag class and the tag number matches this
ASN.1 type.public void validate() throws ASN1InvalidDataValue
ASN1InvalidDataValue
- When the value of this data is invalid.public abstract void clear()
public abstract boolean hasValue()
true
when this ASN.1 data has value.public abstract <E extends java.lang.Throwable> void accept(ASN1Visitor<E> visitor) throws E extends java.lang.Throwable
ASN1Visitor
and calls a visit
method of the
visitor.
visitor
- The visitor.
ASN1Exception
- When an error occured in the visit
method of the
visitor.
E extends java.lang.Throwable
public abstract boolean valueEquals(java.lang.Object other)
true
when they have same value even if
their types are different.
other
- The ASN.1 data which to be compared.
true
when they have same value.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The ASN.1 data which to be compared.
true
when they have same type and value.public abstract int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public abstract java.lang.Object clone()
clone
in class java.lang.Object
Object.clone()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |