org.eclipse.xtext.common.types.impl.JvmDeclaredTypeImplCustom Java Examples

The following examples show how to use org.eclipse.xtext.common.types.impl.JvmDeclaredTypeImplCustom. 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: BatchLinkableResource.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Register runnables to be executed when the {@link JvmMember members} of {@link JvmType types}
 * in this resource are initialized.
 * 
 * @since 2.8
 * @noreference This method is not intended to be referenced by clients.
 */
@Override
public void addJvmMemberInitializer(Runnable runnable) {
	if (isInitializingJvmMembers) {
		throw new IllegalStateException("Cannot enqueue runnables during JvmMemberInitialization");
	}
	if (this.jvmMemberInitializers == null) {
		this.jvmMemberInitializers = new LinkedHashSet<Runnable>();
		this.hasJvmMemberInitializers = true;
		for (EObject obj : getContents()) {
			if (obj instanceof JvmDeclaredTypeImplCustom) {
				JvmDeclaredTypeImplCustom type = (JvmDeclaredTypeImplCustom) obj;
				markPendingInitialization(type);
			}
		}
	}
	this.jvmMemberInitializers.add(runnable);
}
 
Example #2
Source File: XtendImportedNamespaceScopeProvider.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
private void doGetAllDescriptions(JvmDeclaredType type, List<IEObjectDescription> descriptions) {
	descriptions.add(EObjectDescription.create(getQualifiedNameConverter().toQualifiedName(type.getIdentifier()), type));
	EList<JvmMember> members = null;
	if (type instanceof JvmDeclaredTypeImplCustom) {
		members = ((JvmDeclaredTypeImplCustom)type).basicGetMembers();
	} else {
		members = type.getMembers();
	}
	for(JvmMember member: members) {
		if (member instanceof JvmDeclaredType) {
			// add nested types also with the dot delimiter
			descriptions.add(EObjectDescription.create(getQualifiedNameConverter().toQualifiedName(member.getQualifiedName('.')), member));
			doGetAllDescriptions((JvmDeclaredType) member, descriptions);
		}
	}
}
 
Example #3
Source File: SARLImportedNamespaceScopeProvider.java    From sarl with Apache License 2.0 6 votes vote down vote up
private void doGetAllDescriptions(JvmDeclaredType type, List<IEObjectDescription> descriptions) {
	descriptions.add(EObjectDescription.create(getQualifiedNameConverter().toQualifiedName(type.getIdentifier()), type));
	final EList<JvmMember> members;
	if (type instanceof JvmDeclaredTypeImplCustom) {
		members = ((JvmDeclaredTypeImplCustom) type).basicGetMembers();
	} else {
		members = type.getMembers();
	}
	for (final JvmMember member: members) {
		if (member instanceof JvmDeclaredType) {
			// add nested types also with the dot delimiter
			descriptions.add(EObjectDescription.create(getQualifiedNameConverter().toQualifiedName(
					member.getQualifiedName('.')), member));
			doGetAllDescriptions((JvmDeclaredType) member, descriptions);
		}
	}
}
 
Example #4
Source File: BatchLinkableResource.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Recursively traverse the types in this resource to mark them as lazy initialized types. 
 */
private void markPendingInitialization(JvmDeclaredTypeImplCustom type) {
	type.setPendingInitialization(true);
	for (JvmMember member : type.basicGetMembers()) {
		if (member instanceof JvmDeclaredTypeImplCustom) {
			markPendingInitialization((JvmDeclaredTypeImplCustom) member);
		}
	}
}