{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fint128.hatenablog.com%2Fentry%2F2014%2F04%2F10%2F005912\" title=\"meta class\u306bmix in\u3057\u305f\u5834\u5408\u306e\u5f71\u97ff\u7bc4\u56f2 - GeekFactory\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"meta class\u306bmix in\u3057\u305f\u5834\u5408\u306e\u5f71\u97ff\u7bc4\u56f2","categories":["groovy"],"provider_url":"https://hatena.blog","width":"100%","author_url":"https://blog.hatena.ne.jp/int128/","url":"https://int128.hatenablog.com/entry/2014/04/10/005912","blog_title":"GeekFactory","type":"rich","height":"190","provider_name":"Hatena Blog","image_url":null,"published":"2014-04-10 00:59:12","blog_url":"https://int128.hatenablog.com/","version":"1.0","author_name":"int128","description":"\u60f3\u5b9a\u901a\u308a\u3067\u3057\u305f\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306emeta class\u306b\u30af\u30e9\u30b9\u3092mix in\u3057\u305f\u5834\u5408\u306f\u3001\u305d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u307f\u306b\u5f71\u97ff\u3057\u307e\u3059\u3002 class X { def x() { 100 } } class Y { def y() { 200 } } def x1 = new X() x1.metaClass.mixin Y println x1.x() // -> 100 println x1.y() // -> 200 def x2 = new X() println x2.x() // -> 100 println x2.y() // -> groovy.lang.MissingMethodExceptio\u2026"}