本文整理汇总了Java中org.eclipse.xtext.common.types.JvmFormalParameter.setName方法的典型用法代码示例。如果您正苦于以下问题:Java JvmFormalParameter.setName方法的具体用法?Java JvmFormalParameter.setName怎么用?Java JvmFormalParameter.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.common.types.JvmFormalParameter
的用法示例。
在下文中一共展示了JvmFormalParameter.setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFormalParameter
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
protected JvmFormalParameter createFormalParameter(Type parameterType, String paramName,
JvmMember container, GenericDeclaration member, Annotation[] annotations) {
JvmFormalParameter result = TypesFactory.eINSTANCE.createJvmFormalParameter();
result.setName(paramName);
if (isLocal(parameterType, member)) {
result.setParameterType(createLocalTypeReference(parameterType, (JvmTypeParameterDeclarator) container,
member));
} else {
result.setParameterType(createTypeReference(parameterType));
}
if (annotations.length != 0) {
InternalEList<JvmAnnotationReference> annotationsReferences = (InternalEList<JvmAnnotationReference>)result.getAnnotations();
for (Annotation annotation : annotations) {
annotationsReferences.addUnique(createAnnotationReference(annotation));
}
}
return result;
}
示例2: toParameter
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
/**
* Creates and returns a formal parameter for the given name and type, which is associated to the given source
* element.
*
* @return a Java parameter given name, <code>null</code> if sourceElement or name are <code>null</code>.
*/
/* @Nullable */
public JvmFormalParameter toParameter(/* @Nullable */ EObject sourceElement, /* @Nullable */ String name, /* @Nullable */ JvmTypeReference typeRef) {
if(sourceElement == null || name == null)
return null;
JvmFormalParameter result = typesFactory.createJvmFormalParameter();
result.setName(name);
result.setParameterType(cloneWithProxies(typeRef));
return associate(sourceElement, result);
}
示例3: completeJvmEnumerationType
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
protected void completeJvmEnumerationType(JvmEnumerationType element) {
if (element.getSuperTypes().isEmpty()) {
JvmTypeReference objectType = references.getTypeForName(Enum.class, element,
references.createTypeRef(element));
if (objectType != null)
element.getSuperTypes().add(objectType);
}
addAnnotations(element);
EObject primarySourceElement = associations.getPrimarySourceElement(element);
JvmOperation values = typesFactory.createJvmOperation();
values.setVisibility(JvmVisibility.PUBLIC);
values.setStatic(true);
values.setSimpleName("values");
values.setReturnType(references.createArrayType(references.createTypeRef(element)));
typeExtensions.setSynthetic(values, true);
if (primarySourceElement != null) {
associator.associate(primarySourceElement, values);
}
element.getMembers().add(values);
JvmOperation valueOf = typesFactory.createJvmOperation();
valueOf.setVisibility(JvmVisibility.PUBLIC);
valueOf.setStatic(true);
valueOf.setSimpleName("valueOf");
valueOf.setReturnType(references.createTypeRef(element));
JvmFormalParameter param = typesFactory.createJvmFormalParameter();
param.setName("name");
param.setParameterType(references.getTypeForName(String.class, element));
valueOf.getParameters().add(param);
typeExtensions.setSynthetic(valueOf, true);
if (primarySourceElement != null) {
associator.associate(primarySourceElement, valueOf);
}
element.getMembers().add(valueOf);
}
示例4: createFormalParameter
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
protected JvmFormalParameter createFormalParameter(BinaryTypeSignature parameterType, String paramName,
JvmMember container, Map<String, JvmTypeParameter> typeParameters) {
JvmFormalParameter result = TypesFactory.eINSTANCE.createJvmFormalParameter();
result.setName(paramName);
result.setParameterType(proxies.createTypeReference(parameterType, typeParameters));
return result;
}