Class SynonymTypesProvider
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.computation.SynonymTypesProvider
-
public class SynonymTypesProvider extends java.lang.ObjectTheSynonymTypesProviderallows to define automatic conversion rules for specific types. By default,iterablesare compatible to arrays, arrays are compatible toList, and boxing / unboxing semantics are applied. Clients who specialize this service, should announce synonym types by means ofannounceSynonym(LightweightTypeReference, ConformanceHint, Acceptor),announceSynonym(LightweightTypeReference, EnumSet, Acceptor)orannounceSynonym(LightweightTypeReference, int, Acceptor).collectCustomSynonymTypes(LightweightTypeReference, Acceptor)should be implemented to announce custom synonyms. Implementations should respect the acceptor return values.- See Also:
ArrayTypes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSynonymTypesProvider.AcceptorClients of theSynonymTypesProvidermay use a custom acceptor to handle the available synonym types.
-
Constructor Summary
Constructors Constructor Description SynonymTypesProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddArrayAndListSynonyms(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)protected booleanannounceSynonym(LightweightTypeReference synonym, int flags, SynonymTypesProvider.Acceptor acceptor)Announce a synonym type with the given conformance flags.protected booleanannounceSynonym(LightweightTypeReference synonym, java.util.EnumSet<ConformanceHint> hints, SynonymTypesProvider.Acceptor acceptor)Announce a synonym type with the given conformance hints.protected booleanannounceSynonym(LightweightTypeReference synonym, ConformanceHint hint, SynonymTypesProvider.Acceptor acceptor)Announce a synonym type with the given conformance hint.protected booleancollectCustomSynonymTypes(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)This is the hook to announce more synonym types.voidcollectSynonymTypes(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)
-
-
-
Method Detail
-
collectSynonymTypes
public void collectSynonymTypes(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)
-
collectCustomSynonymTypes
protected boolean collectCustomSynonymTypes(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)
This is the hook to announce more synonym types.- Parameters:
type- the original typeacceptor- the acceptor to announce the synonyms
-
addArrayAndListSynonyms
protected boolean addArrayAndListSynonyms(LightweightTypeReference type, SynonymTypesProvider.Acceptor acceptor)
- Parameters:
type- never a primitive or a wrapper type
-
announceSynonym
protected final boolean announceSynonym(LightweightTypeReference synonym, ConformanceHint hint, SynonymTypesProvider.Acceptor acceptor)
Announce a synonym type with the given conformance hint.
-
announceSynonym
protected final boolean announceSynonym(LightweightTypeReference synonym, java.util.EnumSet<ConformanceHint> hints, SynonymTypesProvider.Acceptor acceptor)
Announce a synonym type with the given conformance hints.
-
announceSynonym
protected final boolean announceSynonym(LightweightTypeReference synonym, int flags, SynonymTypesProvider.Acceptor acceptor)
Announce a synonym type with the given conformance flags.- See Also:
ConformanceFlags
-
-