org.eclipse.xtend.middleend.plugins
Interface LanguageSpecificMiddleEnd

All Known Implementing Classes:
JavaFunctionClassContributor, OldCheckRegistry, OldXpandRegistry, OldXtendRegistry

public interface LanguageSpecificMiddleEnd

This interface is the common abstraction through which all handlers for different languages can contribute their middle ends.

Author:
Arno Haase (http://www.haase-consulting.com)

Method Summary
 boolean canHandle(java.lang.String resourceName)
          gives the middle end a way to declare if it can and wants to handle a given source file / resource.
 java.lang.String getName()
           
 boolean mayHandle(java.lang.String resourceName)
          gives the middle end a way to declare if it could possibly handle the given source file / resource based some weaker checks like filename extensions.
 ParsedResource parseResource(java.lang.String resourceName)
          This method asks the middle end to parse a resource for which it declared that it is the appropriate handler, and return the functions contained therein.
Implementations are not required to perform any caching because the MiddleEnd implementation takes care of that.
 void setMiddleEnd(MiddleEnd middleEnd)
          This method is used to break the circular dependency between MiddleEnd and the language specific handlers.
 

Method Detail

setMiddleEnd

void setMiddleEnd(MiddleEnd middleEnd)
This method is used to break the circular dependency between MiddleEnd and the language specific handlers. It is called by the MiddleEnd on creation.


getName

java.lang.String getName()

canHandle

boolean canHandle(java.lang.String resourceName)
gives the middle end a way to declare if it can and wants to handle a given source file / resource. If and only if it returns true, it will be asked for the functions and advice provided in this resource.


mayHandle

boolean mayHandle(java.lang.String resourceName)
gives the middle end a way to declare if it could possibly handle the given source file / resource based some weaker checks like filename extensions. There no guarantee the this middleend can actually parse the source file / resource.


parseResource

ParsedResource parseResource(java.lang.String resourceName)
This method asks the middle end to parse a resource for which it declared that it is the appropriate handler, and return the functions contained therein.
Implementations are not required to perform any caching because the MiddleEnd implementation takes care of that.