org.eclipse.xtext.common.types.JvmSpecializedTypeReference Java Examples

The following examples show how to use org.eclipse.xtext.common.types.JvmSpecializedTypeReference. 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: JvmTypeConstraintImplCustom.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Constraint bounds are definitely invalid if they are <code>not null</code> and point to a primitive type.
 * {@link JvmSpecializedTypeReference} will not be resolved by this check thus they may lead to finally 
 * invalid constraint bounds.
 * 
 * @param constraintBound the reference that shall be come the new constraint.
 * @return <code>false</code> if the given constraint is definitely invalid. 
 */
protected boolean isLikelyAValidConstraintBound(JvmTypeReference constraintBound) {
	if (constraintBound == null)
		return true;
	if (constraintBound instanceof JvmSpecializedTypeReference) {
		JvmTypeReference equivalent = (JvmTypeReference) constraintBound.eGet(TypesPackage.Literals.JVM_SPECIALIZED_TYPE_REFERENCE__EQUIVALENT, false);
		if (equivalent != null) {
			return isLikelyAValidConstraintBound(equivalent);
		}
		return true;
	}
	boolean invalid = (constraintBound.getType() instanceof JvmPrimitiveType 
				|| (constraintBound.getType() instanceof JvmVoid && !constraintBound.getType().eIsProxy()));
	return !invalid;
}
 
Example #2
Source File: JvmSpecializedTypeReferenceItemProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * This handles model notifications by calling {@link #updateChildren} to update any cached
 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void notifyChanged(Notification notification)
{
	updateChildren(notification);

	switch (notification.getFeatureID(JvmSpecializedTypeReference.class))
	{
		case TypesPackage.JVM_SPECIALIZED_TYPE_REFERENCE__EQUIVALENT:
			fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
			return;
	}
	super.notifyChanged(notification);
}
 
Example #3
Source File: XtendValidator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
protected boolean isInvalidWildcard(JvmTypeReference typeRef) {
	if (typeRef instanceof JvmWildcardTypeReference)
		return true;
	else if (typeRef instanceof JvmParameterizedTypeReference) {
		for(JvmTypeReference typeArgument: ((JvmParameterizedTypeReference) typeRef).getArguments()) {
			if(typeArgument instanceof JvmWildcardTypeReference) 
				return true;
		}
	} else if (typeRef instanceof JvmSpecializedTypeReference) {
		return isInvalidWildcard(((JvmSpecializedTypeReference) typeRef).getEquivalent());
	}
	return false;
}
 
Example #4
Source File: ProxyAwareUIStrings.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public StringBuilder doVisitSpecializedTypeReference(JvmSpecializedTypeReference reference, StringBuilder param) {
	return visit(reference.getEquivalent(), param);
}
 
Example #5
Source File: XtypeAdapterFactory.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Adapter caseJvmSpecializedTypeReference(JvmSpecializedTypeReference object)
{
	return createJvmSpecializedTypeReferenceAdapter();
}
 
Example #6
Source File: AbstractTypeReferenceVisitor.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Result doVisitSpecializedTypeReference(JvmSpecializedTypeReference reference) {
	Result result = visit(reference.getEquivalent());
	return result;
}
 
Example #7
Source File: AbstractTypeReferenceVisitorWithParameter.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Result doVisitSpecializedTypeReference(JvmSpecializedTypeReference reference, Parameter parameter) {
	Result result = visit(reference.getEquivalent(), parameter);
	return result;
}
 
Example #8
Source File: XtypeSwitch.java    From xtext-extras with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Returns the result of interpreting the object as an instance of '<em>Jvm Specialized Type Reference</em>'.
 * <!-- begin-user-doc -->
 * This implementation returns null;
 * returning a non-null result will terminate the switch.
 * <!-- end-user-doc -->
 * @param object the target of the switch.
 * @return the result of interpreting the object as an instance of '<em>Jvm Specialized Type Reference</em>'.
 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
 * @generated
 */
public T caseJvmSpecializedTypeReference(JvmSpecializedTypeReference object)
{
	return null;
}
 
Example #9
Source File: ITypeReferenceVisitorWithParameter.java    From xtext-extras with Eclipse Public License 2.0 votes vote down vote up
Result doVisitSpecializedTypeReference(JvmSpecializedTypeReference reference, Parameter param); 
Example #10
Source File: ITypeReferenceVisitor.java    From xtext-extras with Eclipse Public License 2.0 votes vote down vote up
Result doVisitSpecializedTypeReference(JvmSpecializedTypeReference reference);