This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package domain; | |
public class Person implements IPerson { | |
private String firstName; | |
private String lastName; | |
public String getFirstName() { | |
return firstName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package domain; | |
package domain; | |
import java.beans.PropertyChangeSupport; | |
import org.goranjovic.scon.binding.proxy.BoundBeanWrapperProxy; | |
import org.goranjovic.scon.util.proxy.WrapperProxy; | |
public class PersonBoundBeanProxy implements IPerson, | |
WrapperProxy, BoundBeanWrapperProxy { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> boundProps = new ArrayList<String>(); | |
boundProps.add("firstName"); | |
boundProps.add("lastName"); | |
PropertyChangeListener listener = new DummyPropertyChangeListener(); | |
BoundBeanWrapperProxyFactory factory = | |
new BoundBeanWrapperProxyFactory(); | |
factory.setBoundProperties(boundProps); | |
factory.setPropertyChangeListener(listener); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DummyPropertyChangeListener implements PropertyChangeListener { | |
@Override | |
public void propertyChange(PropertyChangeEvent event) { | |
System.out.println(event.getPropertyName() + ": " + | |
event.getOldValue() + " -> " + event.getNewValue()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WrapperProxy wp = (WrapperProxy) proxy; | |
IPerson originalAgain = (IPerson) wp.retrieveOriginal(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 2 (apply + [1 2 3 4 5 6])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((fn digits | |
([n base r] | |
(let [new-n (quot n base) | |
new-r (cons (rem n base) r)] | |
(if (zero? new-n) new-r | |
(recur new-n base new-r)))) | |
([n base] (digits n base []))) | |
12345 12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn digits | |
([n base r] | |
(let [new-n (quot n base) | |
new-r (cons (rem n base) r)] | |
(if (zero? new-n) new-r | |
(recur new-n base new-r)))) | |
([n base] (digits n base []))) | |
(digits 12345 12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require [some.framework :as fw]) | |
(apply fw/foo [1 2 3 4]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(map #(+ % 10) [1 2 3 4 5]) | |
;=> (11 12 13 14 15) |
OlderNewer