XCMS Toolkit

schemajic.model
Class ASN1ObjectIdentifier

java.lang.Object
  extended by schemajic.model.ASN1Value
      extended by schemajic.model.ASN1ObjectIdentifier
Direct Known Subclasses:
ASN1RelativeOID, ContentType

public class ASN1ObjectIdentifier
extends ASN1Value

Models the abstract concept of the value of ASN.1 type OBJECT IDENTIFIER.

An object identifier is the name of an object. It is sometimes referred to as an "information object identifier" or "OID". This object name, a value of ASN.1 type OBJECT IDENTIFIER, is a globally unique ordered list of integers. Each integer in the list is an "object identifier component", and there must be at least two components to form a valid object identifier.

Universal class tag assignment is UNIVERSAL 6.

XML ASN.1 type name is OBJECT_IDENTIFIER. The object identifier type is a built-in ASN.1 type and has UNIVERSAL class tag number 6. This type is defined in ASN.1 standard X.680 as:

 
    ObjectIdentifierType ::= OBJECT IDENTIFIER
    
There are several different formats that can be used in with the ASN.1 Basic Value Notation and the ASN.1 XML Value Notation to create object identifier values. For example, consider these object identifiers that form the name "id-set-Griffin" which uniquely identifies the object Griffin Consulting:

   id-set OBJECT IDENTIFIER ::= { 
       joint-iso-itu-t(2) internationalRA(23) set(42) }

   id-set-vendor OBJECT IDENTIFIER ::= { id-set 9 }

   id-set-Griffin OBJECT IDENTIFIER ::= { id-set-vendor 10 }  
 
Here three object identifiers are defined using the basic value notation, id-set, id-set-vendor and id-set-Griffin. The object name id-set is used to define id-set-vendor, and the object name id-set-vendor is used to define id-set-Griffin. This value notation format which uses identifier names as components to create new object identifier values is called the "NameForm". The object identifier components 9 and 10 are in "NumberForm" format, and the components joint-iso-itu-t(2), internationalRA(23), and set(42) are in "NameAndNumberForm" format.

Each "Name" used in this format is required to be a valid ASN.1 identifier name, and must begin with a lowercase alphabetic character. Since valid types, not identifiers, begin with uppercase characters, identifier components such as US(840), which are commonly found in practice, are not valid. Such usage may sometimes be seen in older specifications and should be corrected to us(840).

Version:
1.00 - 2006/02/09
Author:
support@phillipgriffin.com

Constructor Summary
ASN1ObjectIdentifier()
          Constructor for ASN1ObjectIdentifier with array of integer values parameter.
ASN1ObjectIdentifier(ASN1ObjectIdentifier oid)
          Constructor for ASN1ObjectIdentifier with information object identifier parameter.
ASN1ObjectIdentifier(int[] arcs)
          Constructor for ASN1ObjectIdentifier with array of integer object identifier arc elements parameter.
ASN1ObjectIdentifier(java.lang.String value)
          Constructor for ASN1ObjectIdentifier with string initialization values parameter.
 
Method Summary
 java.lang.Object accept(ValueVisitor visitor, java.lang.Object object)
          Accepts a visit from the ValueVisitor
 boolean equals(java.lang.Object o)
          Returns boolean true if the value of the provided object is equal to the current value.
 int[] getArcs()
          Returns the current object identifier arc elements.
 Type getAsn1Type()
          Returns an ASN.1 OBJECT IDENTIFIER type.
 java.lang.String getCXEREncoding()
          Returns the current information object identifier encoded using the Canonical XML Encoding Rules (cXER) of ASN.1.
 int getLastArc()
          Get the last arc in the information object identifier.
 java.lang.String getName()
          Returns the current name.
 java.lang.String getStringValue()
          Gets the string value of a set of one or mor information object identifier arcs
 int hashCode()
          Override Object.hashCode() to ensure that it can be used as a valid key in a hash map.
 void setArcs(int[] arcs)
          Sets the provided information object identifier arcs as the current arcs.
 void setStringValue(java.lang.String value)
          Sets an information object identifier string value to the current set of one or more information object identifier arcs.
 boolean startsWith(ASN1ObjectIdentifier other)
          Returns true if the first other.length arcs of this oid match the arcs of the 'other' oid.
 boolean startsWith(int[] otherArcs)
          Returns true if the first other.length arcs of this oid match the arcs of the 'other' oid.
 java.lang.String toString()
          Returns an information object identifier value as a formatted string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASN1ObjectIdentifier

public ASN1ObjectIdentifier()
Constructor for ASN1ObjectIdentifier with array of integer values parameter.


ASN1ObjectIdentifier

public ASN1ObjectIdentifier(ASN1ObjectIdentifier oid)
Constructor for ASN1ObjectIdentifier with information object identifier parameter.


ASN1ObjectIdentifier

public ASN1ObjectIdentifier(int[] arcs)
Constructor for ASN1ObjectIdentifier with array of integer object identifier arc elements parameter.


ASN1ObjectIdentifier

public ASN1ObjectIdentifier(java.lang.String value)
                     throws java.text.ParseException
Constructor for ASN1ObjectIdentifier with string initialization values parameter.

Throws:
java.text.ParseException
Method Detail

getName

public java.lang.String getName()
Returns the current name.


getArcs

public int[] getArcs()
Returns the current object identifier arc elements.


setArcs

public void setArcs(int[] arcs)
Sets the provided information object identifier arcs as the current arcs.

Parameters:
arcs - a set of one or more information object identifier arcs

getLastArc

public int getLastArc()
Get the last arc in the information object identifier.

Returns:
If there are no arcs remaining, return -1, otherwise return the remaining arcs.

getStringValue

public java.lang.String getStringValue()
Gets the string value of a set of one or mor information object identifier arcs

Returns:
a string buffer of information object identifier arcs

setStringValue

public void setStringValue(java.lang.String value)
                    throws java.text.ParseException
Sets an information object identifier string value to the current set of one or more information object identifier arcs.

Parameters:
value - a provided information object identifier string
Throws:
java.text.ParseException

startsWith

public boolean startsWith(int[] otherArcs)
Returns true if the first other.length arcs of this oid match the arcs of the 'other' oid.


startsWith

public boolean startsWith(ASN1ObjectIdentifier other)
Returns true if the first other.length arcs of this oid match the arcs of the 'other' oid.


toString

public java.lang.String toString()
Returns an information object identifier value as a formatted string.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Override Object.hashCode() to ensure that it can be used as a valid key in a hash map.

Overrides:
hashCode in class java.lang.Object

getCXEREncoding

public java.lang.String getCXEREncoding()
Returns the current information object identifier encoded using the Canonical XML Encoding Rules (cXER) of ASN.1.


equals

public boolean equals(java.lang.Object o)
Returns boolean true if the value of the provided object is equal to the current value. Otherwise, returns false.

Overrides:
equals in class java.lang.Object

accept

public java.lang.Object accept(ValueVisitor visitor,
                               java.lang.Object object)
                        throws VisitorException
Accepts a visit from the ValueVisitor

Specified by:
accept in class ASN1Value
Parameters:
visitor - the function applicator (mapper), which knows how to process the given object type and apply appropriate operations to the elements of this type of object
object - an object to be visited
Returns:
a visit to the provided object
Throws:
VisitorException

getAsn1Type

public Type getAsn1Type()
Returns an ASN.1 OBJECT IDENTIFIER type.

Overrides:
getAsn1Type in class ASN1Value

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.