codec.asn1
Class AbstractOIDRegistry

java.lang.Object
  |
  +--codec.asn1.OIDRegistry
        |
        +--codec.asn1.AbstractOIDRegistry
Direct Known Subclasses:
PKCS12OIDRegistry, PKCSRegistry

public abstract class AbstractOIDRegistry
extends OIDRegistry

This class maps ASN.1 object identifiers onto ASN.1 types suitable for decoding the structure defined by the given OID.

Author:
Volker Roth

Constructor Summary
AbstractOIDRegistry()
          Creates an OID registry.
AbstractOIDRegistry(OIDRegistry parent)
          Creates an OID registry with the given parent.
 
Method Summary
protected  ASN1Type getLocalASN1Type(ASN1ObjectIdentifier oid)
          Retrieves an ASN.1 type for the given OID or null if no such type was found.
protected abstract  Map getOIDMap()
          Returns the mapping from OID to ASN.1 types.
protected abstract  String getPrefix()
          Returns the prefix that is prepended to strings in the mapping returned by getOIDMap() in order to form the fully qualified class name.
protected static void loadOIDMap(Map map, String path)
          Loads the OID mappings of this registry into the given Map.
 
Methods inherited from class codec.asn1.OIDRegistry
addOIDRegistry, equals, getASN1Type, getDefaultRegistry, getGlobalOIDRegistry, getLocalASN1Type, hashCode, removeOIDRegistry
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOIDRegistry

public AbstractOIDRegistry()
Creates an OID registry.

AbstractOIDRegistry

public AbstractOIDRegistry(OIDRegistry parent)
Creates an OID registry with the given parent. If an OID is not found by this registry then the search is delegated to the parent registry.
Parameters:
parent - The parent OID registry.
Method Detail

loadOIDMap

protected static void loadOIDMap(Map map,
                                 String path)
Loads the OID mappings of this registry into the given Map. OID mappings are defined in OID definition files which are loaded from the CLASSPATH. OID definition files are simple properties files which map an OID to the name of the class which implements the structure identifier by that OID.

The name of such files is oidn.map where n is a running count starting from 0. All files with consecutive numbering are loaded.

Parameters:
map - The map to load to.
path - The path relativ to the class path from which the mappings are loaded.

getPrefix

protected abstract String getPrefix()
Returns the prefix that is prepended to strings in the mapping returned by getOIDMap() in order to form the fully qualified class name.
Returns:
The prefix of class names in the mapping.

getOIDMap

protected abstract Map getOIDMap()
Returns the mapping from OID to ASN.1 types. Types may be given as a string representing the postfix of the class name implementing the type, or a class object. If the mapping contains a string then this string is replaced by the corresponding class when this type is first referenced.

The map must always be the same since it might be modified as described above.

Returns:
The OID to class (name) mapping.

getLocalASN1Type

protected ASN1Type getLocalASN1Type(ASN1ObjectIdentifier oid)
Retrieves an ASN.1 type for the given OID or null if no such type was found.
Overrides:
getLocalASN1Type in class OIDRegistry
Parameters:
oid - The OID
Returns:
The ASN.1 type for the given OID


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.