BOTypeMetadata

This interface provides the capability of taking an annotation blob that conforms to the BOTypeMetadata pattern and transforms it into a set of service data object (SDO) (and performs the reserve transform).

Purpose

Annotations can be read at runtime by using the SDO implementation specific set of APIs. However, the problem with these APIs is that they return a blob. Therefore, the business object framework provides the BOTypeMetadata to read the blob, validate it, and transform it into a usable data object structure.

Example

This example shows how to use the BOTypeMetadata interface.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOTypeMetadata typeMetadataService = (BOTypeMetadata) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOTypeMetadata");

DataObject product =
    factoryService.create("http://www.scm.com/ProductTypes",
                          "Product");

// Use EMF to get the annotation blob, then use the BOTypeMetadata service
// to convert it into a data object.
String productIDPropertyInfoString = (String) ((EObject)product).
		eClass().getEStructuralFeature("iD").
		getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0").
		getDetails().get("appinfo");
DataObject productIDPropertyInfo = 
		typeMetadataService.transformAnnotationToDataObject
		(productIDPropertyInfoString);

// Read and update the annotation.
// ...

// Use the BOTypeMetadata service to transform the data object graph back into
// a string, and then use EMF to set the string in the XML schema.
String productIDPropertyInfoString2 =
		typeMetadataService.transformDataObjectToAnnotation
		(productIDPropertyInfo);
((EObject)product).eClass().getEStructuralFeature("iD").
		getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0").
		getDetails().put("appinfo",productIDPropertyInfoString2);

Parent topic: Programming interfaces

Related reference
BOChangeSummary
BOCopy
BODataObject
BOEquality
BOEventSummary
BOFactory
BOType
BOXMLDocument
BOXMLSerializer

Related information
Interface BOTypeMetadata APIs


Terms of use |

Last updated: Tue Sep 20 03:22:36 2005

Copyright IBM Corporation 2005.
This information center is powered by Eclipse technology (http://www.eclipse.org)