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
 Object clone()
          Since this is implemented as a singleton, we should avoid the use of the clone method
 boolean equals(Object to)
           
static NullObject getNullObject()
          get the NullObject reference
 Object getProperty(String property)
           
 Object invokeMethod(String name, Object args)
          Invokes the given method
 Iterator iterator()
          iterator() method to be able to iterate on null.
 Object plus(String s)
           
 Object setProperty(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 Object clone()
             throws CloneNotSupportedException
Since this is implemented as a singleton, we should avoid the use of the clone method

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getProperty

public Object getProperty(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 Object setProperty(String property)
Parameters:
property - - the property to set

invokeMethod

public Object invokeMethod(String name,
                           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(Object to)
Overrides:
equals in class Object
Parameters:
to - - the reference object with which to compare

iterator

public 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 Object plus(String s)


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