Package de.cardcontact.tlv
Class ObjectIdentifierRegistry
- java.lang.Object
-
- de.cardcontact.tlv.ObjectIdentifierRegistry
-
public class ObjectIdentifierRegistry extends java.lang.Object
Global registry of namend object identifier- Author:
- asc
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIdentifier(java.lang.String name, java.lang.String oid)
Add a name and object identifier to the internal registryprotected static byte[]
encodeOID(java.util.List<java.lang.Integer> oid)
Helper to create value field from array of object identifier elementsstatic ObjectIdentifierRegistry
getInstance()
Gets the singleton instance of the registryjava.lang.String
getNameFor(byte[] oid)
Return a name, if any, that matches the given encoded object identifier.java.lang.String
getOIDFor(java.lang.String name)
Return the object identifier for a given name.static byte[]
parseObjectIdentifier(java.lang.String oid)
Parse a string into an object identifier.
-
-
-
Method Detail
-
getInstance
public static ObjectIdentifierRegistry getInstance()
Gets the singleton instance of the registry- Returns:
-
encodeOID
protected static byte[] encodeOID(java.util.List<java.lang.Integer> oid)
Helper to create value field from array of object identifier elements- Parameters:
oid
- List containing object identifier elements
-
parseObjectIdentifier
public static byte[] parseObjectIdentifier(java.lang.String oid)
Parse a string into an object identifier.The parser supports a dotted notation as well as a comma separated notation. The string may contain pre-defined names from the registry and local names like test(1).
- Parameters:
oid
- the string to be parsed- Returns:
- the encoded object identifier
-
addIdentifier
public void addIdentifier(java.lang.String name, java.lang.String oid)
Add a name and object identifier to the internal registry- Parameters:
name
- the object identifiers symbolic nameoid
- the object identifiers definition
-
getOIDFor
public java.lang.String getOIDFor(java.lang.String name)
Return the object identifier for a given name.- Parameters:
name
- the name to search for- Returns:
- the object identifier for the given name or null
-
getNameFor
public java.lang.String getNameFor(byte[] oid)
Return a name, if any, that matches the given encoded object identifier.- Parameters:
oid
- the encoded object identifier- Returns:
- the name or null
-
-