Java Code Examples for org.eclipse.xtext.common.types.JvmTypeReference#getQualifiedName()

The following examples show how to use org.eclipse.xtext.common.types.JvmTypeReference#getQualifiedName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JvmDelegateTypeReferenceImplCustom.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String getQualifiedName(char innerClassDelimiter) {
	JvmTypeReference resolvedDelegate = getDelegate();
	if (resolvedDelegate == null || resolvedDelegate.eIsProxy())
		return null;
	return resolvedDelegate.getQualifiedName(innerClassDelimiter);
}
 
Example 2
Source File: JvmGenericArrayTypeReferenceImplCustom.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String getQualifiedName(char innerClassDelimiter) {
	JvmTypeReference componentType = getComponentType();
	if (componentType != null)
		return componentType.getQualifiedName(innerClassDelimiter) + "[]";
	return null;
}
 
Example 3
Source File: JvmSpecializedTypeReferenceImplCustom.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String getQualifiedName(char innerClassDelimiter) {
	JvmTypeReference equivalent = getEquivalent();
	if (equivalent != null)
		return equivalent.getQualifiedName(innerClassDelimiter);
	return super.getQualifiedName(innerClassDelimiter);
}
 
Example 4
Source File: CheckJavaValidator.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Checks that the declared type of a formal parameter is one of: String, Boolean, Integer, boolean, int, or
 * a List type with String, Boolean, or Integer element type.
 *
 * @param parameter
 *          to check
 */
@Check
public void checkFormalParameterDeclaredType(final FormalParameter parameter) {
  JvmTypeReference jvmType = parameter.getType();
  if (jvmType == null) {
    return;
  }
  String typeName = jvmType.getQualifiedName();
  if (!ALLOWED_TYPE_NAMES.contains(typeName)) {
    error(Messages.CheckJavaValidator_FormalParameterAllowedBaseTypes, jvmType, null, IssueCodes.FORMAL_PARAMETER_BASE_TYPE);
  }
}
 
Example 5
Source File: MissedMethodAddModification.java    From sarl with Apache License 2.0 5 votes vote down vote up
private static String typeParameterId(JvmTypeReference type) {
	final JvmType realType = type.getType();
	if (realType instanceof JvmTypeParameter) {
		final JvmDeclaredType container = EcoreUtil2.getContainerOfType(realType, JvmDeclaredType.class);
		if (container != null) {
			return container.getQualifiedName() + "$" + realType.getIdentifier(); //$NON-NLS-1$
		}
	}
	return type.getQualifiedName();
}