Skip to end of metadata
Go to start of metadata

The Using the Delegating Meta Class page talks about techniques to change the behavior of existing classes by replacing the meta class in use. However, the Delegating Meta Class effects all loaded classes.

The Proxy Meta Class allows us to replace the meta class in use by a class but in a well defined scope. This technique would be more appropriate for temporary behavior replacements such as

This example shows how we can create a proxy meta class for the String class and intercept its method invocations.


For more detail on using the ProxyMetaClass, see http://groovy.codehaus.org/Using+the+Proxy+Meta+Class+in+depth.

  • No labels