當前位置: 首頁>>代碼示例>>Java>>正文


Java IJavaProject.findType方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.IJavaProject.findType方法的典型用法代碼示例。如果您正苦於以下問題:Java IJavaProject.findType方法的具體用法?Java IJavaProject.findType怎麽用?Java IJavaProject.findType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.IJavaProject的用法示例。


在下文中一共展示了IJavaProject.findType方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGetFullyQualifiedName

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testGetFullyQualifiedName() throws Exception {
	IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
	IType type = project.findType("SimpleImpl");
	String s = JDTManager.getFullyQualifiedName(type);
	assertEquals("SimpleImpl.java", s);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:8,代碼來源:JDTManagerTest.java

示例2: testGetGraphModelPath

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testGetGraphModelPath() throws Exception {
	IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
	IType type = project.findType("SimpleImpl");
	IPath path = JDTManager.getGraphModelPath(project.getProject(),type);
	assertEquals("/" + PROJECT_NAME +"/src/test/resources/Simple.json", path.toString());
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:8,代碼來源:JDTManagerTest.java

示例3: testFindGeneratorFactoryParseInvocation

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testFindGeneratorFactoryParseInvocation() throws Exception {
	IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
	IFile impl = (IFile) ResourceManager
			.getResource(project.getProject().getFullPath().append("src/test/java/SimpleImpl.java").toString());
	
	IOHelper.appendParseGeneratorCall (impl);
	IType type = project.findType("SimpleImpl");
	Set<String> invocations = JDTManager.findGeneratorFactoryParseInvocation(project.getProject(), type);
	assertEquals (1,invocations.size());
	String value = invocations.iterator().next();
	assertEquals("random(edge_coverage(100))", value);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:14,代碼來源:JDTManagerTest.java

示例4: testGetStartableGraphWalkerClasses

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testGetStartableGraphWalkerClasses() throws Exception {
	IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
	List<IType> types = JDTManager.getStartableGraphWalkerClasses(project.getProject().getName());
	assertTrue (types.size()==1);
	IType type = project.findType("SimpleImpl");
	assertEquals(type,types.get(0));
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:9,代碼來源:JDTManagerTest.java

示例5: testGetOrphanGraphWalkerClasses

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testGetOrphanGraphWalkerClasses() throws Exception {
	IJavaProject project = ProjectHelper.getOrCreateSharedGW4Project(PROJECT_NAME, true);
	IType type = project.findType("Model_AImpl");
	List<IType> types = JDTManager.getOrphanGraphWalkerClasses(type, true);
	assertTrue (types.size()==1);
	IType typeB = project.findType("Model_BImpl");
	assertEquals(typeB,types.get(0));
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:10,代碼來源:JDTManagerTest.java

示例6: testGetSharedContexts

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@Test
public void testGetSharedContexts() throws Exception {
	IJavaProject pj = ProjectHelper.getOrCreateSharedGW4Project(PROJECT_NAME,true);
	IType type = pj.findType("Model_AImpl");
	IType typeB = pj.findType("Model_BImpl");
	List<IType> others = new ArrayList<IType> ();
	others.add(typeB);
	List<IType> shared = GraphWalkerFacade.getSharedContexts(pj.getProject(), type, others);
	assertEquals(shared.size(),1);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:11,代碼來源:GraphWalkerFacadeTest.java

示例7: getJavaType

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
/**
 * Obtient le type JDT pour un nom complet qualifié dans un projet donné.
 * 
 * @param fullyQualifiedName Nom complet qualifié.
 * @param project Projet.
 * @return Le type JDT, <code>null</code> sinon.
 */
public static IType getJavaType(String fullyQualifiedName, IProject project) {
	IJavaProject javaProject = JavaCore.create(project);
	try {
		return javaProject.findType(fullyQualifiedName);
	} catch (Exception e) {
		ErrorUtils.handle(e);
	}
	return null;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:17,代碼來源:JdtUtils.java


注:本文中的org.eclipse.jdt.core.IJavaProject.findType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。