org.eclipse.wst.jsdt.core
Interface IFunctionContainer

All Known Subinterfaces:
IClassFile, IJavaScriptUnit, IType, ITypeRoot

public interface IFunctionContainer

Represents a container of methods and fields/vars (either an IJavaScriptUnit or an IType).

This interface is not intended to be implemented by clients.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
 IField getField(java.lang.String name)
          Returns the field with the specified name in this type (for example, "bar").
 IField[] getFields()
          Returns the fields declared by this type or javascript file.
 IFunction getFunction(java.lang.String name, java.lang.String[] parameterTypeSignatures)
          Returns the method with the specified name and parameter types in this type (for example, "foo", {"I", "QString;"}).
 IFunction[] getFunctions()
          Returns the methods and constructors declared by this type or file.
 IFunction[] getMethods()
          Deprecated. Use getFunctions() instead
 IType getType(java.lang.String name)
          Returns the type with the specified name
 

Method Detail

getField

IField getField(java.lang.String name)
Returns the field with the specified name in this type (for example, "bar"). This is a handle-only method. The field may or may not exist.

Parameters:
name - the given name
Returns:
the field with the specified name in this type

getFields

IField[] getFields()
                   throws JavaScriptModelException
Returns the fields declared by this type or javascript file.

Returns:
the fields declared by this type or file
Throws:
JavaScriptModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getFunction

IFunction getFunction(java.lang.String name,
                      java.lang.String[] parameterTypeSignatures)
Returns the method with the specified name and parameter types in this type (for example, "foo", {"I", "QString;"}). To get the handle for a constructor, the name specified must be the simple name of the enclosing type. This is a handle-only method. The method may or may not be present.

The type signatures may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See Signature for details.

Parameters:
name - the given name
parameterTypeSignatures - the given parameter types
Returns:
the method with the specified name and parameter types in this type

getMethods

IFunction[] getMethods()
                       throws JavaScriptModelException
Deprecated. Use getFunctions() instead

Returns the methods and constructors declared by this type. For binary types, this may include the special <clinit>; method and synthetic methods. If this is a source type, the results are listed in the order in which they appear in the source, otherwise, the results are in no particular order.

Returns:
the methods and constructors declared by this type
Throws:
JavaScriptModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getFunctions

IFunction[] getFunctions()
                         throws JavaScriptModelException
Returns the methods and constructors declared by this type or file.

Returns:
the methods and constructors declared by this type
Throws:
JavaScriptModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getType

IType getType(java.lang.String name)
Returns the type with the specified name

Returns:
the type with the specified name in this file
Throws:
JavaScriptModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.