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

java.lang.Object
  extended by com.aptana.ide.editor.js.runtime.JSNull
All Implemented Interfaces:
IObject, IRange, IDocumentationContainer

public class JSNull
extends java.lang.Object
implements IObject

Author:
Kevin Lindsey

Constructor Summary
JSNull()
           
 
Method Summary
 boolean canPut(java.lang.String propertyName)
          Determines if the specified property name can be set.
 boolean containsOffset(int offset)
          Determine if the specified offset is within this range
 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.
 IDocumentation getDocumentation()
          Retrieve any documentation associated with this object
 int getEndingOffset()
          Get the ending offset for this range
 IObject getInstance(Environment environment, int fileIndex, int offset)
          Return the unerlying primitive type
 int getLength()
          Get the total length between the starting offset and the ending offset in this range
 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.
static JSNull getSingletonInstance()
          Return the JSNull singleton for this environment
 int getStartingOffset()
          Get the starting offset for this range
 boolean hasDocumentation()
          Determine if this object contains any documentation
 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.
 boolean isEmpty()
          Determine if this is a valid range
 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 setDocumentation(IDocumentation documentation)
          Associate documentation with this object
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSNull

public JSNull()
Method Detail

getSingletonInstance

public static JSNull getSingletonInstance()
Return the JSNull singleton for this environment

Returns:
Returns the JSNull singleton

canPut

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

Specified by:
canPut in interface IObject
Parameters:
propertyName - The name of the property to test
Returns:
Returns true if the specified property name can be set
See Also:
IObject.canPut(java.lang.String)

getProperty

public Property getProperty(java.lang.String propertyName)
Description copied from interface: IObject
Get the Property object for the associated property name

Specified by:
getProperty in interface IObject
Parameters:
propertyName - The name of the Property to return
Returns:
The Property object associated with the specified name
See Also:
IObject.getProperty(java.lang.String)

getPropertyValue

public IObject getPropertyValue(java.lang.String propertyName,
                                int fileIndex,
                                int offset)
Description copied from interface: IObject
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.

Specified by:
getPropertyValue in interface IObject
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
See Also:
IObject.getPropertyValue(java.lang.String, int, int)

putPropertyValue

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

Specified by:
putPropertyValue in interface IObject
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
See Also:
IObject.putPropertyValue(java.lang.String, com.aptana.ide.editor.js.runtime.IObject, int)

putPropertyValue

public void putPropertyValue(java.lang.String propertyName,
                             IObject value,
                             int fileIndex,
                             int attributes)
Description copied from interface: IObject
Create a property and set its attributes

Specified by:
putPropertyValue in interface IObject
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
See Also:
IObject.putPropertyValue(java.lang.String, com.aptana.ide.editor.js.runtime.IObject, int, int)

getPropertyNames

public java.lang.String[] getPropertyNames()
Description copied from interface: IObject
Get all enumerable property names on this object

Specified by:
getPropertyNames in interface IObject
Returns:
An array of all visible property names
See Also:
IObject.getPropertyNames()

getPropertyNames

public java.lang.String[] getPropertyNames(boolean getAll)
Description copied from interface: IObject
Get all property names on this object

Specified by:
getPropertyNames in interface IObject
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
See Also:
IObject.getPropertyNames(boolean)

hasProperty

public boolean hasProperty(java.lang.String propertyName)
Description copied from interface: IObject
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.

Specified by:
hasProperty in interface IObject
Parameters:
propertyName - The name of the property to test
Returns:
Returns true if this object contains the specified property name
See Also:
IObject.hasProperty(java.lang.String)

getLocalProperty

public Property getLocalProperty(java.lang.String propertyName)
Description copied from interface: IObject
Returns a local property defined on an object. This does not follow the prototype chain if the property does not exist locally

Specified by:
getLocalProperty in interface IObject
Parameters:
propertyName - The name of the property to retrieve
Returns:
The property
See Also:
IObject.getLocalProperty(java.lang.String)

putLocalProperty

public void putLocalProperty(java.lang.String propertyName,
                             Property property)
Description copied from interface: IObject
Set the Property object with the associated name

Specified by:
putLocalProperty in interface IObject
Parameters:
propertyName - The name of the property to set
property - The property instance
See Also:
IObject.putLocalProperty(java.lang.String, com.aptana.ide.editor.js.runtime.Property)

getLocalPropertyNames

public java.lang.String[] getLocalPropertyNames()
Description copied from interface: IObject
Get all enumerable property names that exist on this object only (does not follow prototype chain)

Specified by:
getLocalPropertyNames in interface IObject
Returns:
An array of property names
See Also:
IObject.getLocalPropertyNames()

hasLocalProperty

public boolean hasLocalProperty(java.lang.String propertyName)
Description copied from interface: IObject
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.

Specified by:
hasLocalProperty in interface IObject
Parameters:
propertyName - The name of the property to test
Returns:
Returns true if this object contains the specified property name
See Also:
IObject.hasLocalProperty(java.lang.String)

unputPropertyName

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

Specified by:
unputPropertyName in interface IObject
Parameters:
propertyName - The name of the property to unput
fileIndex - The file index of the property to unput
offset - The file offset
See Also:
IObject.unputPropertyName(java.lang.String, int, int)

deletePropertyName

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

Specified by:
deletePropertyName in interface IObject
Parameters:
propertyName - The property name to remove from this object
Returns:
Returns true if the property name was successfully removed from this object
See Also:
IObject.deletePropertyName(java.lang.String)

getPrototype

public IObject getPrototype()
Description copied from interface: IObject
Returns the prototype of this object. This implements [[Prototype]] from the ECMA specification.

Specified by:
getPrototype in interface IObject
Returns:
This object's prototype object
See Also:
IObject.getPrototype()

setPrototype

public void setPrototype(IObject prototype)
Description copied from interface: IObject
Set this object's prototype ([[Prototype]])

Specified by:
setPrototype in interface IObject
Parameters:
prototype - This object's new prototype object
See Also:
IObject.setPrototype(com.aptana.ide.editor.js.runtime.IObject)

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
Returns:
This object's class name
See Also:
IObject.getClassName()

getInstance

public IObject getInstance(Environment environment,
                           int fileIndex,
                           int offset)
Return the unerlying primitive type

Specified by:
getInstance in interface IObject
Parameters:
environment - The environment
fileIndex - The file index
offset - The file offset
Returns:
Returns the unerlying primitive type for this object

getEndingOffset

public int getEndingOffset()
Description copied from interface: IRange
Get the ending offset for this range

Specified by:
getEndingOffset in interface IRange
Returns:
Returns the ending offset for this range
See Also:
IRange.getEndingOffset()

getLength

public int getLength()
Description copied from interface: IRange
Get the total length between the starting offset and the ending offset in this range

Specified by:
getLength in interface IRange
Returns:
Returns the length of this range
See Also:
IRange.getLength()

getStartingOffset

public int getStartingOffset()
Description copied from interface: IRange
Get the starting offset for this range

Specified by:
getStartingOffset in interface IRange
Returns:
Returns the starting offset for this range
See Also:
IRange.getStartingOffset()

isEmpty

public boolean isEmpty()
Description copied from interface: IRange
Determine if this is a valid range

Specified by:
isEmpty in interface IRange
Returns:
Returns true if this range is empty
See Also:
IRange.isEmpty()

containsOffset

public boolean containsOffset(int offset)
Description copied from interface: IRange
Determine if the specified offset is within this range

Specified by:
containsOffset in interface IRange
Parameters:
offset - The offset to test
Returns:
Returns true if the offset is within this range
See Also:
IRange.containsOffset(int)

getDocumentation

public IDocumentation getDocumentation()
Description copied from interface: IDocumentationContainer
Retrieve any documentation associated with this object

Specified by:
getDocumentation in interface IDocumentationContainer
Returns:
Returns this object's documentation object
See Also:
IDocumentationContainer.getDocumentation()

hasDocumentation

public boolean hasDocumentation()
Description copied from interface: IDocumentationContainer
Determine if this object contains any documentation

Specified by:
hasDocumentation in interface IDocumentationContainer
Returns:
Returns true if this object contains documentation
See Also:
IDocumentationContainer.hasDocumentation()

setDocumentation

public void setDocumentation(IDocumentation documentation)
Description copied from interface: IDocumentationContainer
Associate documentation with this object

Specified by:
setDocumentation in interface IDocumentationContainer
Parameters:
documentation - The new documentation for this object
See Also:
IDocumentationContainer.setDocumentation(com.aptana.ide.metadata.IDocumentation)

getLocalPropertyCount

public int getLocalPropertyCount()
Description copied from interface: IObject
Returns the number of porperties defined locally to this object.

Specified by:
getLocalPropertyCount in interface IObject
Returns:
Returns the number of porperties defined locally to this object.
See Also:
IObject.getLocalPropertyCount()