wodge
Enthusiast
Enthusiast

Handling multiple types with a single DataProvider

Hi, 

I'm writing a DataProvider and would like it handle multiple types. The documentation says as follows:

For example, if you have a custom object of type WhatsIt, you annotate the class like the following example:

 

I would like to handle multiple types with the same data adapter, so as well as "samples:WhatsIt" objects, I'd also like to handle say "samples:Whatelse".
 
What is the syntax for the @type annotation so that multiple object types can be handled please?

 

Many thanks

 
Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee

See ChassisRackVSphereDataAdapter.java in the ChassisB sample for such case:

@type("HostSystem,samples:Rack,samples:ChassisB") // declares the supported object types.

It's always a good idea to search all the sample source files for particular APIs :slightly_smiling_face:

Reply
0 Kudos