Drag'n'drop in Tree - how to set data flavors?

I want to build a client side accept criterion for drag’n’drop in a Tree.
The tree looks like this

Building 1
|- Room 1
|- Chair
|- Table
|- Room 2
|- …
Building 2
|- …

All “furniture” nodes (Chair, Table) should only be droppable in “Room” nodes. Room nodes should only be droppable in “Building” Nodes.

I guess I have to check for the dragged type using an ContainsDataFlavor() accept criterion and combine this using And() with a TargetDetailIs() criterion. Maybe something like this?

new Or( new And(new ContainsDataFlavor("furniture"), new TargetDetailIs("room", true)), new And(new ContainsDataFlavor("room"), new TargetDetailIs("building", true)) ) How do you set these “data flavors” to the Items in the Tree?