当前位置: 首页>>代码示例>>Java>>正文


Java JvmGenericType.setSimpleName方法代码示例

本文整理汇总了Java中org.eclipse.xtext.common.types.JvmGenericType.setSimpleName方法的典型用法代码示例。如果您正苦于以下问题:Java JvmGenericType.setSimpleName方法的具体用法?Java JvmGenericType.setSimpleName怎么用?Java JvmGenericType.setSimpleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.common.types.JvmGenericType的用法示例。


在下文中一共展示了JvmGenericType.setSimpleName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testJvmTypeSimple_Issue145

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeSimple_Issue145() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("SimpleName");
	expected.setPackageName("package.name");
	resource.getContents().add(expected);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName");
	assertEquals(expected, actual);
	resource.getContents().remove(expected);
	((InternalEObject)expected).eSetProxyURI(EcoreUtil.getURI(expected));
	JvmGenericType expected2 = TypesFactory.eINSTANCE.createJvmGenericType();
	expected2.setSimpleName("SimpleName");
	expected2.setPackageName("package.name");
	resource.getContents().add(expected2);
	JvmType actual2 = getTypeProvider().findTypeByName("package.name.SimpleName");
	assertEquals(expected2, actual2);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:ClasspathTypeProviderTest.java

示例2: createJvmGenericType

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected JvmGenericType createJvmGenericType(/* @Nullable */ EObject sourceElement, /* @Nullable */ String name) {
	if (sourceElement == null || name == null)
		return null;
	Pair<String, String> fullName = splitQualifiedName(name);
	final JvmGenericType result = typesFactory.createJvmGenericType();
	result.setSimpleName(fullName.getSecond());
	if (fullName.getFirst() != null)
		result.setPackageName(fullName.getFirst());
	result.setVisibility(JvmVisibility.PUBLIC);
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:JvmTypesBuilder.java

示例3: testGetElementByInstance_01

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test public void testGetElementByInstance_01() {
	JvmConstructor constructor = TypesFactory.eINSTANCE.createJvmConstructor();
	JvmGenericType type = TypesFactory.eINSTANCE.createJvmGenericType();
	type.setPackageName("java.lang");
	type.setSimpleName("Object");
	constructor.setSimpleName("Object");
	type.getMembers().add(constructor);
	IEObjectDescription element = getConstructorScope().getSingleElement(constructor);
	assertNotNull(element);
	assertEquals(new IQualifiedNameConverter.DefaultImpl().toQualifiedName("java.lang.Object"), element.getName());
	assertEquals(new IQualifiedNameConverter.DefaultImpl().toQualifiedName("java.lang.Object"), element.getQualifiedName());
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:13,代码来源:AbstractConstructorScopeTest.java

示例4: testJvmTypeSimple

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeSimple() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("SimpleName");
	expected.setPackageName("package.name");
	resource.getContents().add(expected);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName");
	assertEquals(expected, actual);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:ReflectionTypeProviderTest.java

示例5: testJvmTypeNoPackage

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeNoPackage() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("SimpleName");
	resource.getContents().add(expected);
	JvmType actual = getTypeProvider().findTypeByName("SimpleName");
	assertEquals(expected, actual);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:ReflectionTypeProviderTest.java

示例6: testJvmTypeNestedClass

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeNestedClass() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType container = TypesFactory.eINSTANCE.createJvmGenericType();
	container.setSimpleName("SimpleName");
	container.setPackageName("package.name");
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("Child");
	container.getMembers().add(expected);
	resource.getContents().add(container);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName$Child");
	assertEquals(expected, actual);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:ReflectionTypeProviderTest.java

示例7: testJvmTypeNestedClassWithDot_01

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeNestedClassWithDot_01() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType container = TypesFactory.eINSTANCE.createJvmGenericType();
	container.setSimpleName("SimpleName");
	container.setPackageName("package.name");
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("Child");
	container.getMembers().add(expected);
	resource.getContents().add(container);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName.Child", false);
	assertEquals(expected, actual);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:ReflectionTypeProviderTest.java

示例8: testJvmTypeNestedClassWithDot_02

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeNestedClassWithDot_02() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType container = TypesFactory.eINSTANCE.createJvmGenericType();
	container.setSimpleName("SimpleName");
	container.setPackageName("package.name");
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("Child");
	container.getMembers().add(expected);
	resource.getContents().add(container);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName.Child", true);
	assertNull(actual);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:ReflectionTypeProviderTest.java

示例9: testJvmTypeArray

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Test
public void testJvmTypeArray() {
	Resource resource = resourceSet.createResource(URI.createURI("foo.typesRefactoring"));
	JvmGenericType expected = TypesFactory.eINSTANCE.createJvmGenericType();
	expected.setSimpleName("SimpleName");
	expected.setPackageName("package.name");
	resource.getContents().add(expected);
	JvmType actual = getTypeProvider().findTypeByName("package.name.SimpleName[]");
	assertTrue(actual instanceof JvmArrayType);
	assertEquals(expected, ((JvmArrayType) actual).getComponentType());
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:ReflectionTypeProviderTest.java


注:本文中的org.eclipse.xtext.common.types.JvmGenericType.setSimpleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。