Constructs a DOFObjectID from a String in the standard string format defined by the OpenDOF Technical Committee.
Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax
C#
public static DOFObjectID create( string format )
Parameters
- format
- Type: SystemString
The standard format string for the object identifier.
Return Value
Type: DOFObjectIDThe newly created object identifier.
Remarks
- The string must be enclosed in square braces ([]).
- Within the square braces the format is <class identifier>:<OID data>.
- Hexadecimal values in the OID data must be enclosed in curly braces ({}).
- The OID data may contain spaces if the OID class definition permits them; however, the string must not contain any spaces outside the data field.
DOFObjectID myOID = DOFObjectID.create("[128:{050234706bb1453289d9461055cef60c}]");The following is an example of how to create a domain class DOFObjectID:
DOFObjectID myOID = DOFObjectID.create("[6:provider.opendof.org]");The following is an example of how to create an email class DOFObjectID:
DOFObjectID myOID = DOFObjectID.create("[3:provider@opendof.org]");Attributes can be added to the standard string format to create an OID with attributes. To format an attribute in the standard string format, you must know its attribute identifier. Attribute identifiers, like OID classes, must be registered with the OpenDOF Project. The following rules apply to the standard string format for attributes:
- Attributes must be contained within parentheses after the OID data, but before the closing square brace.
- Within the square braces the format is <attribute identifier>:<attribute data>.
- Multiple attributes must be separated using a pipe symbol (|).
- If the attribute data is itself an OID, it must follow the rules for OIDs listed above.
- The attribute data may contain spaces if the definition permits them; however, the string must not contain any spaces outside the data field.
DOFObjectID myOID = DOFObjectID.create("[3:provider@opendof.org(0:[3:service@opendof.org]|2:[3:group@opendof.org])]");An alternative to using this method to create the entire OID with its attributes is to use this method to create the base OID, use one of the Attribute.create(byte, byte[]) methods to create the attributes, and then pass the base OID and attributes to the create(DOFObjectID, Attribute[]) method.
See Also