You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/01/11 00:06:23 UTC

[groovy] branch master updated: minor rewording (thanks to @chagmed on twitter)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new d8a529b  minor rewording (thanks to @chagmed on twitter)
d8a529b is described below

commit d8a529bc21d42f5c355ac18656535576283260c9
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Jan 11 10:06:15 2022 +1000

    minor rewording (thanks to @chagmed on twitter)
---
 src/spec/doc/core-metaprogramming.adoc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index 8641276..cb15171 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -436,11 +436,20 @@ assert f.metaClass =~ /MetaClassImpl/
 
 ==== Custom metaclasses
 
-You can change the metaclass of any object or class and replace with a custom implementation of the `MetaClass` gapi:groovy.lang.MetaClass[interface]. Usually you will want to subclass one of the existing metaclasses `MetaClassImpl`, `DelegatingMetaClass`, `ExpandoMetaClass`, `ProxyMetaClass`, etc. otherwise you will need to implement the complete method lookup logic. Before using a new metaclass instance you should call  gapid:groovy.lang.MetaClass#initialize()[] otherwise the metaclass [...]
+You can change the metaclass of any object or class and replace it with a
+custom implementation of the `MetaClass` gapi:groovy.lang.MetaClass[interface].
+Usually you will want to extend one of the existing metaclasses such as
+`MetaClassImpl`, `DelegatingMetaClass`, `ExpandoMetaClass`, or `ProxyMetaClass`;
+otherwise you will need to implement the complete method lookup logic.
+Before using a new metaclass instance you should call
+gapid:groovy.lang.MetaClass#initialize()[],
+otherwise the metaclass may or may not behave as expected.
 
 ===== Delegating metaclass
 
-If you only need to decorate an existing metaclass the `DelegatingMetaClass` simplifies that use case. The old metaclass implementation is still accessible via `super` making easy to apply pretransformations to the inputs, routing to other methods and postprocess the outputs.
+If you only need to decorate an existing metaclass the `DelegatingMetaClass` simplifies that use case.
+The old metaclass implementation is still accessible via `super` making it easy to apply
+pretransformations to the inputs, routing to other methods and postprocessing the outputs.
 
 [source,groovy]
 ----