org.codehaus.groovy.runtime
Class NullObject

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by org.codehaus.groovy.runtime.NullObject
All Implemented Interfaces:
GroovyObject

public class NullObject
extends GroovyObjectSupport


Method Summary
 java.lang.Object clone()
          Since this is implemented as a singleton, we should avoid the use of the clone method
 boolean equals(java.lang.Object to)
           
static NullObject getNullObject()
          get the NullObject reference
 java.lang.Object getProperty(java.lang.String property)
           
 java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
          Invokes the given method
 java.util.Iterator iterator()
          iterator() method to be able to iterate on null.
 java.lang.Object plus(java.lang.String s)
           
 java.lang.Object setProperty(java.lang.String property)
           
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNullObject

public static NullObject getNullObject()
get the NullObject reference


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Since this is implemented as a singleton, we should avoid the use of the clone method

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getProperty

public java.lang.Object getProperty(java.lang.String property)
Specified by:
getProperty in interface GroovyObject
Overrides:
getProperty in class GroovyObjectSupport
Parameters:
property - - the property to get
Returns:
the given property

setProperty

public java.lang.Object setProperty(java.lang.String property)
Parameters:
property - - the property to set

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object args)
Description copied from interface: GroovyObject
Invokes the given method

Specified by:
invokeMethod in interface GroovyObject
Overrides:
invokeMethod in class GroovyObjectSupport
Parameters:
name - the name of the method to invoke
args - - arguments to the method

equals

public boolean equals(java.lang.Object to)
Overrides:
equals in class java.lang.Object
Parameters:
to - - the reference object with which to compare

iterator

public java.util.Iterator iterator()
iterator() method to be able to iterate on null. Note: this part is from Invoker

Returns:
an iterator for an empty list

plus

public java.lang.Object plus(java.lang.String s)


Copyright © 2003-2011 The Codehaus. All Rights Reserved.