com.aptana.ide.editor.js.runtime
Class FunctionBase

java.lang.Object
  extended by com.aptana.ide.editor.js.runtime.ObjectBase
      extended by com.aptana.ide.editor.js.runtime.FunctionBase
All Implemented Interfaces:
IFunction, IObject, IRange, IDocumentationContainer
Direct Known Subclasses:
JSFunction, NativeConstructorBase

public abstract class FunctionBase
extends ObjectBase
implements IFunction

Author:
Kevin Lindsey, Robin Debreuil

Field Summary
static IObject[] EmptyArgs
          Empty arguments
 
Fields inherited from class com.aptana.ide.editor.js.runtime.ObjectBase
NULL, UNDEFINED
 
Constructor Summary
FunctionBase()
          Create a new instance of FunctionBase
FunctionBase(IRange sourceRegion)
          Create a new instance of FunctionBase
 
Method Summary
abstract  IObject construct(Environment environment, IObject[] arguments, int fileIndex, IRange sourceRegion)
          Constructs a new Object with using the passed arguments.
 java.lang.String getClassName()
          Returns the class name of this object.
 IInvokeTypeProvider getInvokeTypeProvider()
          Get this functions invoke type provider
 java.lang.String[] getParameterNames()
          Return a string array of the parameters for this IFunction
abstract  IObject invoke(Environment environment, IObject[] arguments, int fileIndex, IRange sourceRegion)
          Invoke this method with the specified parameters
 void setInvokeTypeProvider(IInvokeTypeProvider typeProvider)
          Set a type provider to be used to determine this function's return type when this function is not documented
 
Methods inherited from class com.aptana.ide.editor.js.runtime.ObjectBase
canPut, containsOffset, deletePropertyName, getDocumentation, getEndingOffset, getInstance, getLength, getLocalProperty, getLocalPropertyCount, getLocalPropertyNames, getProperty, getPropertyNames, getPropertyNames, getPropertyValue, getPrototype, getRange, getStartingOffset, hasDocumentation, hasLocalProperty, hasProperty, isEmpty, putLocalProperty, putPropertyValue, putPropertyValue, setDocumentation, setPrototype, unputPropertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aptana.ide.editor.js.runtime.IFunction
getBodyScope, setBodyScope, setParameterNames
 

Field Detail

EmptyArgs

public static final IObject[] EmptyArgs
Empty arguments

Constructor Detail

FunctionBase

public FunctionBase()
Create a new instance of FunctionBase


FunctionBase

public FunctionBase(IRange sourceRegion)
Create a new instance of FunctionBase

Parameters:
sourceRegion - The region within the source that defines this object instance
Method Detail

getClassName

public java.lang.String getClassName()
Description copied from interface: IObject
Returns the class name of this object. This implements [[Class]] from the ECMA specification

Specified by:
getClassName in interface IObject
Specified by:
getClassName in class ObjectBase
Returns:
This object's class name
See Also:
ObjectBase.getClassName()

getInvokeTypeProvider

public IInvokeTypeProvider getInvokeTypeProvider()
Description copied from interface: IFunction
Get this functions invoke type provider

Specified by:
getInvokeTypeProvider in interface IFunction
Returns:
Returns the associated type provider or null
See Also:
IFunction.getInvokeTypeProvider()

setInvokeTypeProvider

public void setInvokeTypeProvider(IInvokeTypeProvider typeProvider)
Description copied from interface: IFunction
Set a type provider to be used to determine this function's return type when this function is not documented

Specified by:
setInvokeTypeProvider in interface IFunction
Parameters:
typeProvider - The type provider
See Also:
IFunction.setInvokeTypeProvider(com.aptana.ide.editor.js.runtime.IInvokeTypeProvider)

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: IFunction
Return a string array of the parameters for this IFunction

Specified by:
getParameterNames in interface IFunction
Returns:
Returns a string array of parameter names
See Also:
IFunction.getParameterNames()

construct

public abstract IObject construct(Environment environment,
                                  IObject[] arguments,
                                  int fileIndex,
                                  IRange sourceRegion)
Description copied from interface: IFunction
Constructs a new Object with using the passed arguments.

Specified by:
construct in interface IFunction
arguments - The arguments to use in constructing the new object.
fileIndex - The file index
sourceRegion - The region of text within the source file that represents the construction of this instance
Returns:
Returns a newly constructed object.
See Also:
IFunction.construct(com.aptana.ide.editor.js.runtime.Environment, com.aptana.ide.editor.js.runtime.IObject[], int, IRange)

invoke

public abstract IObject invoke(Environment environment,
                               IObject[] arguments,
                               int fileIndex,
                               IRange sourceRegion)
Description copied from interface: IFunction
Invoke this method with the specified parameters

Specified by:
invoke in interface IFunction
arguments - The arguments to use in constructing the new object.
fileIndex - The file index
sourceRegion - The region of text within the source file that represents the construction of this instance
Returns:
Returns a newly constructed object.
See Also:
IFunction.invoke(com.aptana.ide.editor.js.runtime.Environment, com.aptana.ide.editor.js.runtime.IObject[], int, IRange)