org.eclipse.internal.xtend.xtend.ast
Class AbstractExtension

java.lang.Object
  extended by org.eclipse.internal.xtend.expression.ast.SyntaxElement
      extended by org.eclipse.internal.xtend.xtend.ast.AbstractExtension
All Implemented Interfaces:
ISyntaxElement, Extension, Callable, ParameterizedCallable
Direct Known Subclasses:
AbstractExtensionDefinition, JavaExtensionStatement

public abstract class AbstractExtension
extends SyntaxElement
implements Extension

Author:
Bernd Kolb, Patrick Schoenbach, Achim Demelt, Darius Jockel, Sebastian Zarnekow, Karsten Thoms

Field Summary
protected  boolean cached
           
protected  ExtensionFile file
           
protected  Identifier returnType
           
 
Fields inherited from class org.eclipse.internal.xtend.expression.ast.SyntaxElement
end, line, start
 
Constructor Summary
AbstractExtension(Identifier name, Identifier returnType, java.util.List<DeclaredParameter> formalParameters, boolean cached, boolean isPrivate)
           
 
Method Summary
 void analyze(ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
protected  void analyzeInternal(ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
protected  void checkForAmbiguousDefinitions(ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object evaluate(java.lang.Object[] parameters, ExecutionContext ctx)
           
protected abstract  java.lang.Object evaluateInternal(java.lang.Object[] parameters, ExecutionContext ctx)
           
 ExtensionFile getExtensionFile()
           
 java.util.List<DeclaredParameter> getFormalParameters()
           
 java.lang.String getName()
           
 Identifier getNameIdentifier()
           
 java.util.List<java.lang.String> getParameterNames()
           
 java.util.List<Type> getParameterTypes()
           
 java.lang.String getQualifiedName()
           
 Type getReturnType()
           
 Type getReturnType(Type[] parameters, ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
 Identifier getReturnTypeIdentifier()
           
 int hashCode()
           
 void init(ExecutionContext ctx)
           
protected abstract  Type internalGetReturnType(Type[] parameters, ExecutionContext ctx, java.util.Set<AnalysationIssue> issues)
           
 boolean isCached()
           
 boolean isPrivate()
           
 void setExtensionFile(ExtensionFile f)
           
 java.lang.String toOutlineString()
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.internal.xtend.expression.ast.SyntaxElement
accept, getEnd, getFileName, getLine, getNameString, getStart, setEnd, setFileName, setLine, setStart
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.internal.xtend.expression.ast.ISyntaxElement
accept, getEnd, getFileName, getLine, getNameString, getStart
 

Field Detail

file

protected ExtensionFile file

cached

protected boolean cached

returnType

protected Identifier returnType
Constructor Detail

AbstractExtension

public AbstractExtension(Identifier name,
                         Identifier returnType,
                         java.util.List<DeclaredParameter> formalParameters,
                         boolean cached,
                         boolean isPrivate)
Method Detail

getFormalParameters

public java.util.List<DeclaredParameter> getFormalParameters()
Specified by:
getFormalParameters in interface Extension

getName

public java.lang.String getName()
Specified by:
getName in interface Extension
Specified by:
getName in interface Callable

getNameIdentifier

public Identifier getNameIdentifier()

getReturnType

public final Type getReturnType(Type[] parameters,
                                ExecutionContext ctx,
                                java.util.Set<AnalysationIssue> issues)
Specified by:
getReturnType in interface Extension

internalGetReturnType

protected abstract Type internalGetReturnType(Type[] parameters,
                                              ExecutionContext ctx,
                                              java.util.Set<AnalysationIssue> issues)

analyze

public final void analyze(ExecutionContext ctx,
                          java.util.Set<AnalysationIssue> issues)
Specified by:
analyze in interface Extension

analyzeInternal

protected void analyzeInternal(ExecutionContext ctx,
                               java.util.Set<AnalysationIssue> issues)

evaluate

public java.lang.Object evaluate(java.lang.Object[] parameters,
                                 ExecutionContext ctx)
Specified by:
evaluate in interface Extension

setExtensionFile

public final void setExtensionFile(ExtensionFile f)
Specified by:
setExtensionFile in interface Extension

getExtensionFile

public ExtensionFile getExtensionFile()
Specified by:
getExtensionFile in interface Extension

evaluateInternal

protected abstract java.lang.Object evaluateInternal(java.lang.Object[] parameters,
                                                     ExecutionContext ctx)

getParameterNames

public java.util.List<java.lang.String> getParameterNames()
Specified by:
getParameterNames in interface Extension

init

public void init(ExecutionContext ctx)
Specified by:
init in interface Extension

getReturnType

public Type getReturnType()
Specified by:
getReturnType in interface Extension
Specified by:
getReturnType in interface Callable

getParameterTypes

public java.util.List<Type> getParameterTypes()
Specified by:
getParameterTypes in interface Extension
Specified by:
getParameterTypes in interface ParameterizedCallable

getReturnTypeIdentifier

public Identifier getReturnTypeIdentifier()
Specified by:
getReturnTypeIdentifier in interface Extension

toString

public java.lang.String toString()
Specified by:
toString in interface Extension
Overrides:
toString in class java.lang.Object

toOutlineString

public java.lang.String toOutlineString()
Specified by:
toOutlineString in interface Extension

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface Extension

isCached

public boolean isCached()
Specified by:
isCached in interface Extension

getQualifiedName

public java.lang.String getQualifiedName()
Specified by:
getQualifiedName in interface Extension

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

checkForAmbiguousDefinitions

protected void checkForAmbiguousDefinitions(ExecutionContext ctx,
                                            java.util.Set<AnalysationIssue> issues)