Java Code Examples for org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference#isOwnedBy()

The following examples show how to use org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference#isOwnedBy() . 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: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void reassignType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (reference != null && !reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.reassignType(identifiable, reference);
}
 
Example 2
Source File: ValidatingStackedResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getExpectedType(XExpression expression) {
	LightweightTypeReference result = super.getExpectedType(expression);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 3
Source File: ValidatingExpressionAwareResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference acceptType(XExpression expression, AbstractTypeExpectation expectation, LightweightTypeReference type,
		boolean returnType, int hints) {
	if (!expectation.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("expectation is not owned by this resolved types");
	}
	if (!type.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("type is not owned by this resolved types");
	}
	return super.acceptType(expression, expectation, type, returnType, hints);
}
 
Example 4
Source File: ValidatingExpressionAwareResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void reassignType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (reference != null && !reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.reassignType(identifiable, reference);
}
 
Example 5
Source File: ValidatingExpressionAwareResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (!reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.setType(identifiable, reference);
}
 
Example 6
Source File: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getMergedType(List<LightweightTypeReference> types) {
	for (LightweightTypeReference it : types) {
		if (!it.isOwnedBy(it.getOwner())) {
			throw new IllegalArgumentException("result is not owned by this resolved types");
		}
	}
	LightweightTypeReference result = super.getMergedType(types);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 7
Source File: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getExpectedType(XExpression expression) {
	LightweightTypeReference result = super.getExpectedType(expression);
	if (result != null && !result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 8
Source File: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getActualType(XExpression expression) {
	LightweightTypeReference result = super.getActualType(expression);
	if (result != null && !result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 9
Source File: ValidatingStackedResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getActualType(JvmIdentifiableElement identifiable) {
	LightweightTypeReference result = super.getActualType(identifiable);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 10
Source File: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference acceptType(XExpression expression, AbstractTypeExpectation expectation, LightweightTypeReference type,
		boolean returnType, int hints) {
	if (!expectation.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("expectation is not owned by this resolved types");
	}
	if (!type.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("type is not owned by this resolved types");
	}
	return super.acceptType(expression, expectation, type, returnType, hints);
}
 
Example 11
Source File: ValidatingStackedResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (!reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.setType(identifiable, reference);
}
 
Example 12
Source File: ValidatingRootResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (!reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.setType(identifiable, reference);
}
 
Example 13
Source File: ValidatingStackedResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getMergedType(List<LightweightTypeReference> types) {
	for (LightweightTypeReference it : types) {
		if (!it.isOwnedBy(it.getOwner())) {
			throw new IllegalArgumentException("result is not owned by this resolved types");
		}
	}
	LightweightTypeReference result = super.getMergedType(types);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 14
Source File: ValidatingExpressionAwareResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getMergedType(List<LightweightTypeReference> types) {
	for (LightweightTypeReference it : types) {
		if (!it.isOwnedBy(it.getOwner())) {
			throw new IllegalArgumentException("result is not owned by this resolved types");
		}
	}
	LightweightTypeReference result = super.getMergedType(types);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 15
Source File: ValidatingReassigningResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getActualType(XExpression expression) {
	LightweightTypeReference result = super.getActualType(expression);
	if (result != null && !result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 16
Source File: ValidatingStackedResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void reassignType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (reference != null && !reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.reassignType(identifiable, reference);
}
 
Example 17
Source File: ValidatingReassigningResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference acceptType(XExpression expression, AbstractTypeExpectation expectation, LightweightTypeReference type,
		boolean returnType, int hints) {
	if (!expectation.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("expectation is not owned by this resolved types");
	}
	if (!type.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("type is not owned by this resolved types");
	}
	return super.acceptType(expression, expectation, type, returnType, hints);
}
 
Example 18
Source File: ValidatingExpressionAwareResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public LightweightTypeReference getActualType(XExpression expression) {
	LightweightTypeReference result = super.getActualType(expression);
	if (!result.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("result is not owned by this resolved types");
	}
	return result;
}
 
Example 19
Source File: ValidatingReassigningResolvedTypes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) {
	if (!reference.isOwnedBy(getReferenceOwner())) {
		throw new IllegalArgumentException("reference is not owned by this resolved types");
	}
	super.setType(identifiable, reference);
}
 
Example 20
Source File: AbstractTypeExpectation.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public boolean isOwnedBy(ITypeReferenceOwner referenceOwner) {
	LightweightTypeReference expectedType = getExpectedType();
	return expectedType == null || expectedType.isOwnedBy(referenceOwner);
}