Package com.oss.asn1
Class AbstractData
java.lang.Object
com.oss.asn1.AbstractData
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
AbstractBinary
,AbstractCollection
,AbstractContainer
,AbstractISO8601Time
,AbstractObjectIdentifier
,AbstractOpenType
,AbstractReal
,AbstractString
,AbstractTime
,ASN1Type
,BOOLEAN
,Choice
,Enumerated
,HugeBinaryString
,HugeContainer
,HugeInteger
,HugeRestrictedString
,INTEGER
,Null
The AbstractData class represents the base class for all OSS ASN.1/Java
universal classes.
- Since:
- ASN.1/Java 1.0-beta A
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Returned by compareTo() if the value of the object calling compareTo() is equal to the value of the object being passed to compareTo().static final int
Returned by compareTo() if the value of the object calling compareTo() is greater than the value of the object being passed to compareTo().static final int
Returned by compareTo() if the value of the object calling compareTo() is less than the value of the object being passed to compareTo(). -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
abstractEqualTo
(AbstractData that) The abstract method used to compare AbstractData objects for equality.clone()
Create a deep copy of 'this' object.void
delete()
Destroy the instance of the AbstractData.boolean
Compares two objects for equality.Get the type descriptor (TypeInfo) of AbstractData objects.int
hashCode()
Returns a hash code value of this object.boolean
Tells if this AbstractData can be encoded/decoded.boolean
isPDU()
Tells if this AbstractData represents a PDU.final boolean
isValid()
Provides constraint checking of 'this' object by calling methods from the validator package.final String
toString()
Provides the conversion of 'this' object into the Java String object containing the ASN.1 value notation format.final String
toString
(ASN1ValueFormat fmt) Provides the conversion of 'this' object into the Java String object containing the ASN.1 value notation format.
-
Field Details
-
LESS_THAN
public static final int LESS_THANReturned by compareTo() if the value of the object calling compareTo() is less than the value of the object being passed to compareTo().- See Also:
-
EQUALS
public static final int EQUALSReturned by compareTo() if the value of the object calling compareTo() is equal to the value of the object being passed to compareTo().- See Also:
-
GREATER_THAN
public static final int GREATER_THANReturned by compareTo() if the value of the object calling compareTo() is greater than the value of the object being passed to compareTo().- See Also:
-
-
Method Details
-
abstractEqualTo
The abstract method used to compare AbstractData objects for equality. This method allows you to compare the values of ASN.1/Java objects in an abstract manner, while preserving the compile-time type checking provided by the various equalTo() methods defined in the built-in classes (or their superclasses).- Parameters:
that
- an object to compare 'this' object with.- Returns:
- boolean value specifying whether or not contents of 'this' and 'that' objects are equal.
-
equals
Compares two objects for equality. Descendants of AbstractData also provide equalTo() method for comparing objects for equality in type-safe manner. The equalTo() methods provide more efficient solution for checking equality, so using equalTo() is recommended. -
getTypeInfo
Get the type descriptor (TypeInfo) of AbstractData objects. This method is overridden in each generated class.- Returns:
- reference to TypeInfo containing metadata information of 'this' object.
- Throws:
MetadataException
- if an error occurs when the metadata is accessed.
-
isValid
Provides constraint checking of 'this' object by calling methods from the validator package.- Returns:
- boolean value specifying whether or not the value of 'this' object is valid.
- Throws:
ValidateNotSupportedException
- is thrown if validation is not supportedValidateFailedException
- is thrown if validation fails
-
isEncodable
public boolean isEncodable()Tells if this AbstractData can be encoded/decoded. Subclasses that implement data types, which are not eligible for encoding, must override this method to returnfalse
.- Returns:
true
if the object may be encoded/decoded
-
isPDU
public boolean isPDU()Tells if this AbstractData represents a PDU. Subclasses that implement data types, which are PDUs, must override this method to returntrue
.- Returns:
true
if the object is a PDU.
-
toString
Provides the conversion of 'this' object into the Java String object containing the ASN.1 value notation format. -
toString
Provides the conversion of 'this' object into the Java String object containing the ASN.1 value notation format. If the conversion is aborted due an error the method returnsnull
.- Parameters:
fmt
- specifies options to customize the format of the ASN.1 value notation.- Returns:
- String containing the ASN.1 value notation of 'this' object.
-
clone
Create a deep copy of 'this' object.- Returns:
- copy of '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. -
hashCode
public int hashCode()Returns a hash code value of this object. This method always return 0. This implementation of the hashCode() is provided in order to satisfy hashCode() method requirements in respect to the equals() method, that equal objects have the same hash code.
-