[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-scm
Subject:    [groovy-scm] [groovy] [4283] trunk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResul
From:       tug () codehaus ! org
Date:       2006-11-30 12:47:40
Message-ID: 20061130124740.15705.qmail () mail ! codehaus ! org
[Download RAW message or body]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><style type="text/css"><!--
#msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : \
#fff; } #msg DT { float : left; width : 6em; font-weight : bold; }
#msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; \
font-size : 10pt;  } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; \
font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; \
background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, \
.diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin \
: 0; } #patch .propset h4, #patch .binary h4 {margin: 0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {background:#eeeeee;padding: 0 0 10px 0;}
#patch .propset .diff, #patch .binary .diff  {padding: 10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add \
{background:#ddffdd;} #patch .rem {background:#ffdddd;}
#patch .lines, .info {color:#888888;background:#ffffff;}
.diff { width : 100%; }
#msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : \
#fff; } #msg DT { float : left; width : 6em; font-weight : bold; }
#msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; \
font-size : 10pt;  } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; \
font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; \
background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, \
.diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin \
: 0; } #patch .propset h4, #patch .binary h4 {margin: 0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {background:#eeeeee;padding: 0 0 10px 0;}
#patch .propset .diff, #patch .binary .diff  {padding: 10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add \
{background:#ddffdd;} #patch .rem {background:#ffdddd;}
#patch .lines, .info {color:#888888;background:#ffffff;}
.diff { width : 100%; }
--></style>
<title>[groovy] [4283] \
trunk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResult.java: \
implement the &quot;+&quot; operator</title> </head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a \
href="http://fisheye.codehaus.org/changelog/groovy/?cs=4283">4283</a></dd> \
<dt>Author</dt> <dd>tug</dd> <dt>Date</dt> <dd>2006-11-30 06:47:32 -0600 (Thu, 30 Nov \
2006)</dd> </dl>

<h3>Log Message</h3>
<pre>implement the &quot;+&quot; operator

a.b + &quot;hello&quot;

results in &lt;a&gt;&lt;b&gt;....&lt;/b&gt;hello&lt;/a&gt;</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgroovygroovycoresrcmaingroovyutilslurpersupportGPathResultjava">tru \
nk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResult.java</a></li> \
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgroovygroovycoresrcmaingroovyutilslurpersupportGPathResultjava"></a>
<div class="modfile"><h4>Modified: \
trunk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResult.java (4282 \
=> 4283)</h4> <pre class="diff">
<span class="info">--- \
trunk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResult.java	2006-11-30 \
                12:10:38 UTC (rev 4282)
+++ trunk/groovy/groovy-core/src/main/groovy/util/slurpersupport/GPathResult.java	2006-11-30 \
12:47:32 UTC (rev 4283) </span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> import groovy.lang.Closure;
 import groovy.lang.DelegatingMetaClass;
 import groovy.lang.GString;
</span><span class="add">+import groovy.lang.GroovyObject;
</span><span class="cx"> import groovy.lang.GroovyObjectSupport;
 import groovy.lang.MetaClass;
 import groovy.lang.Writable;
</span><span class="lines">@@ -155,6 +156,22 @@
</span><span class="cx">         return this;
     }
     
</span><span class="add">+    public Object plus(final Object newValue) {
+        this.replaceNode(new Closure(this) {
+            public void doCall(Object[] args) {
+            final GroovyObject delegate = (GroovyObject)getDelegate();
+             
+                delegate.getProperty(&quot;mkp&quot;);
+                delegate.invokeMethod(&quot;yield&quot;, args);
+                
+                delegate.getProperty(&quot;mkp&quot;);
+                delegate.invokeMethod(&quot;yield&quot;, new Object[]{newValue});
+            }
+        });
+        
+        return this;
+    }
+    
</span><span class="cx">     protected abstract void replaceNode(Closure newValue);
     
     protected abstract void replaceBody(Object newValue);
</span>
</pre>
</div>
</div>

</body>
</html>

<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
    <a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic