package org.eclipse.birt.report.data.adapter.api;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.eclipse.birt.report.model.api.ReportItemHandle;


public class LinkedDataSetUtil
{
	private static String GET_LINKED_DATA_MODEL_METHOD = "getLinkedDataModel";
	
	public static boolean bindToLinkedDataSet( ReportItemHandle reportItemHandle )
			throws IllegalArgumentException, IllegalAccessException,
			InvocationTargetException
	{
		Method[] methods = reportItemHandle.getClass( ).getMethods( );
		for ( int i = 0; i < methods.length; i++ )
		{
			String name = methods[i].getName( );
			if ( name.equals( GET_LINKED_DATA_MODEL_METHOD ) )
			{
				Object result = methods[i].invoke( reportItemHandle );
				if ( result != null )
					return true;
			}
		}
		return false;
	}
}

@@ -50,61 +50,8 @@
 %0D%0A%0D%0A
-import java.lang.reflect.InvocationTargetException;%0D%0A
 impo
@@ -80,16 +80,16 @@
 ethod;%0D%0A
+
 %0D%0Aimport
@@ -346,99 +346,8 @@
  )%0D%0A
-%09%09%09throws IllegalArgumentException, IllegalAccessException,%0D%0A%09%09%09InvocationTargetException%0D%0A
 %09%7B%0D%0A
@@ -589,46 +589,152 @@
 t = 
-methods%5Bi%5D.invoke( reportItemHandle );
+null ;%0D%0A%09%09%09%09try%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09result = methods%5Bi%5D.invoke( reportItemHandle );%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%09catch ( Exception e )%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09return false;%0D%0A%09%09%09%09%7D
 %0D%0A%09%09

Remove the exception lists from the API which judges whether a ReportItemHandle binds to a Linked Data Set