com.aptana.ide.editor.js.runtime
Interface IObject

All Superinterfaces:
IDocumentationContainer, IRange
All Known Subinterfaces:
IScope
All Known Implementing Classes:
FunctionBase, JSArray, JSArrayConstructor, JSBoolean, JSBooleanConstructor, JSDate, JSDateConstructor, JSError, JSErrorConstructor, JSFunction, JSFunctionConstructor, JSGuessedObject, JSNull, JSNumber, JSNumberConstructor, JSObject, JSObjectConstructor, JSRegExp, JSRegExpConstructor, JSScope, JSString, JSStringConstructor, JSUndefined, NativeConstructorBase, NativeMath, ObjectBase

public interface IObject
extends IRange, IDocumentationContainer

Author:
Kevin Lindsey

Method Summary
 boolean canPut(java.lang.String propertyName)
          Determines if the specified property name can be set.
 boolean deletePropertyName(java.lang.String propertyName)
          Remove the specified property name from this object.
 java.lang.String getClassName()
          Returns the class name of this object.
 IObject getInstance(Environment environment, int fileIndex, int offset)
          Returns the underlying instance contained by this object.
 Property getLocalProperty(java.lang.String propertyName)
          Returns a local property defined on an object.
 int getLocalPropertyCount()
          Returns the number of porperties defined locally to this object.
 java.lang.String[] getLocalPropertyNames()
          Get all enumerable property names that exist on this object only (does not follow prototype chain)
 Property getProperty(java.lang.String propertyName)
          Get the Property object for the associated property name
 java.lang.String[] getPropertyNames()
          Get all enumerable property names on this object
 java.lang.String[] getPropertyNames(boolean getAll)
          Get all property names on this object
 IObject getPropertyValue(java.lang.String propertyName, int fileIndex, int offset)
          Returns the value of the name property.
 IObject getPrototype()
          Returns the prototype of this object.
 boolean hasLocalProperty(java.lang.String propertyName)
          Determine if this object has the specified property name.
 boolean hasProperty(java.lang.String propertyName)
          Determine if this object has the specified property name.
 void putLocalProperty(java.lang.String propertyName, Property property)
          Set the Property object with the associated name
 void putPropertyValue(java.lang.String propertyName, IObject value, int fileIndex)
          Sets the value of the specified property name.
 void putPropertyValue(java.lang.String propertyName, IObject value, int fileIndex, int attributes)
          Create a property and set its attributes
 void setPrototype(IObject prototype)
          Set this object's prototype ([[Prototype]])
 void unputPropertyName(java.lang.String propertyName, int fileIndex, int offset)
          Remove a reference to the specified property name.
 
Methods inherited from interface com.aptana.ide.lexer.IRange
containsOffset, getEndingOffset, getLength, getStartingOffset, isEmpty
 
Methods inherited from interface com.aptana.ide.metadata.IDocumentationContainer
getDocumentation, hasDocumentation, setDocumentation
 

Method Detail

canPut

boolean canPut(java.lang.String propertyName)
Determines if the specified property name can be set. This implements [[CanPut]] from the ECMA specification

Parameters:
propertyName - The name of the property to test
Returns:
Returns true if the specified property name can be set

getProperty

Property getProperty(java.lang.String propertyName)
Get the Property object for the associated property name

Parameters:
propertyName - The name of the Property to return
Returns:
The Property object associated with the specified name

getPropertyValue

IObject getPropertyValue(java.lang.String propertyName,
                         int fileIndex,
                         int offset)
Returns the value of the name property. This method will crawl up the prototype chain if the current object does not contain the specified property name. This implements [[Get]] from the ECMA specification.

Parameters:
propertyName - The name of the property to retrieve
fileIndex - The index of the file where this property is to be retrieved
offset - the offset within the file
Returns:
The object associated with the specified property name

putPropertyValue

void putPropertyValue(java.lang.String propertyName,
                      IObject value,
                      int fileIndex)
Sets the value of the specified property name. This implements [[Put]] from the ECMA specification

Parameters:
propertyName - The name of the property to set
value - The value to associate with the given property name
fileIndex - The index of the file where this property is to be set

putPropertyValue

void putPropertyValue(java.lang.String propertyName,
                      IObject value,
                      int fileIndex,
                      int attributes)
Create a property and set its attributes

Parameters:
propertyName - The property name to create
value - The value of the property
fileIndex - The index of the file where this property is to be set
attributes - The attributes for the property

getPropertyNames

java.lang.String[] getPropertyNames()
Get all enumerable property names on this object

Returns:
An array of all visible property names

getPropertyNames

java.lang.String[] getPropertyNames(boolean getAll)
Get all property names on this object

Parameters:
getAll - If true, then all properties, including properties with the DONT_ENUM attribute, will be returned
Returns:
An array of all property names on this object

hasProperty

boolean hasProperty(java.lang.String propertyName)
Determine if this object has the specified property name. This method will crawl up the prototype chain if the current object does not contain the specified property name. This implements [[CanPut]] from the ECMA specification.

Parameters:
propertyName - The name of the property to test
Returns:
Returns true if this object contains the specified property name

getLocalProperty

Property getLocalProperty(java.lang.String propertyName)
Returns a local property defined on an object. This does not follow the prototype chain if the property does not exist locally

Parameters:
propertyName - The name of the property to retrieve
Returns:
The property

putLocalProperty

void putLocalProperty(java.lang.String propertyName,
                      Property property)
Set the Property object with the associated name

Parameters:
propertyName - The name of the property to set
property - The property instance

getLocalPropertyNames

java.lang.String[] getLocalPropertyNames()
Get all enumerable property names that exist on this object only (does not follow prototype chain)

Returns:
An array of property names

hasLocalProperty

boolean hasLocalProperty(java.lang.String propertyName)
Determine if this object has the specified property name. This method will crawl up the prototype chain if the current object does not contain the specified property name. This implements [[CanPut]] from the ECMA specification.

Parameters:
propertyName - The name of the property to test
Returns:
Returns true if this object contains the specified property name

unputPropertyName

void unputPropertyName(java.lang.String propertyName,
                       int fileIndex,
                       int offset)
Remove a reference to the specified property name. If the property no longer has references, it will be removed from this object

Parameters:
propertyName - The name of the property to unput
fileIndex - The file index of the property to unput
offset - The file offset

deletePropertyName

boolean deletePropertyName(java.lang.String propertyName)
Remove the specified property name from this object. This implements [[Delete]] from the ECMA specification

Parameters:
propertyName - The property name to remove from this object
Returns:
Returns true if the property name was successfully removed from this object

getPrototype

IObject getPrototype()
Returns the prototype of this object. This implements [[Prototype]] from the ECMA specification.

Returns:
This object's prototype object

setPrototype

void setPrototype(IObject prototype)
Set this object's prototype ([[Prototype]])

Parameters:
prototype - This object's new prototype object

getClassName

java.lang.String getClassName()
Returns the class name of this object. This implements [[Class]] from the ECMA specification

Returns:
This object's class name

getInstance

IObject getInstance(Environment environment,
                    int fileIndex,
                    int offset)
Returns the underlying instance contained by this object. Built-in types and primitive types will simply return themselves. This mechanism is needed more for handling CommandNodes that are in the environment.

Parameters:
environment - The environment
fileIndex - The file index
offset - The file offset
Returns:
Returns a built-in or primitive type contained by this IObject

getLocalPropertyCount

int getLocalPropertyCount()
Returns the number of porperties defined locally to this object.

Returns:
Returns the number of porperties defined locally to this object.