org.eclipse.xtext.common.types.util
Class LazyTypeArgumentContext

java.lang.Object
  extended by org.eclipse.xtext.common.types.util.LazyTypeArgumentContext
All Implemented Interfaces:
ITypeArgumentContext, TypeArgumentContextProvider.IInitializableTypeArgumentContext

public class LazyTypeArgumentContext
extends java.lang.Object
implements TypeArgumentContextProvider.IInitializableTypeArgumentContext

Implementation of the ITypeArgumentContext that encapsulates how the available information of an TypeArgumentContextProvider.Request will be used to resolve type parameters. It maintains a chain of delegate contexts and knows which delegate has to was already produced and which will be created next on demand. Prior to using the class, clients have to initialize it.

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
protected  class LazyTypeArgumentContext.IsResolvedVisitor
           
 
Constructor Summary
LazyTypeArgumentContext()
           
 
Method Summary
protected  ITypeArgumentContext computeNext()
           
protected  ITypeArgumentContext doComputeNext()
           
 JvmTypeReference getBoundArgument(JvmTypeParameter parameter)
           
 JvmTypeReference getLowerBound(JvmTypeReference reference)
           
 JvmTypeReference getUpperBound(JvmTypeReference reference, org.eclipse.emf.common.notify.Notifier context)
           
protected  boolean hasNextLevel()
           
 void initialize(TypeArgumentContextProvider.Request request, TypeArgumentContextProvider contextProvider)
           
 boolean isRawTypeContext()
           
protected  boolean isResolved(JvmTypeReference reference, boolean rawType)
           
protected  boolean isResolved(JvmTypeReference reference, boolean rawType, boolean firstWildcardUnresolved)
           
 JvmTypeReference resolve(JvmTypeReference reference)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyTypeArgumentContext

public LazyTypeArgumentContext()
Method Detail

initialize

public void initialize(TypeArgumentContextProvider.Request request,
                       TypeArgumentContextProvider contextProvider)
Specified by:
initialize in interface TypeArgumentContextProvider.IInitializableTypeArgumentContext

isRawTypeContext

public boolean isRawTypeContext()
Specified by:
isRawTypeContext in interface ITypeArgumentContext

getBoundArgument

public JvmTypeReference getBoundArgument(JvmTypeParameter parameter)
Specified by:
getBoundArgument in interface ITypeArgumentContext

getLowerBound

public JvmTypeReference getLowerBound(JvmTypeReference reference)
Specified by:
getLowerBound in interface ITypeArgumentContext

getUpperBound

public JvmTypeReference getUpperBound(JvmTypeReference reference,
                                      org.eclipse.emf.common.notify.Notifier context)
Specified by:
getUpperBound in interface ITypeArgumentContext

resolve

public JvmTypeReference resolve(JvmTypeReference reference)
Specified by:
resolve in interface ITypeArgumentContext

hasNextLevel

protected boolean hasNextLevel()

computeNext

protected ITypeArgumentContext computeNext()

doComputeNext

protected ITypeArgumentContext doComputeNext()

isResolved

protected boolean isResolved(JvmTypeReference reference,
                             boolean rawType)

isResolved

protected boolean isResolved(JvmTypeReference reference,
                             boolean rawType,
                             boolean firstWildcardUnresolved)