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 Project { | |
public String id; | |
public String name; | |
public String test; | |
public Integer amount; | |
public static Project getInstance(Object o) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InstantiationException{ | |
return (Project) ObjectStructure.getStructure(o,new Project()); |
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 ObjectStructure { | |
public static Object getStructure(Object o, Object ro) | |
throws NoSuchFieldException, | |
IllegalArgumentException, | |
IllegalAccessException, | |
InstantiationException{ | |
Field[] f = o.getClass().getFields(); |
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
Project p1 = Project.getInstance(new Object(){ | |
public String id="007"; | |
public String name="James Bond"; | |
public String test="ceci est un essai 001"; | |
public Integer amount=2000; | |
}); |
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 controllers; | |
import play.mvc.*; | |
@With(Secure.class) | |
public class Authenticated extends Controller{ | |
public static void itIsOk(){ | |
renderHtml( | |
"<script>"+ |
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
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript"> | |
window.addEventListener("message", handleFrameMessage, false); | |
function handleFrameMessage(e){ | |
console.log(e); | |
} |
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 controllers; | |
import play.mvc.*; | |
@With(Secure.class) | |
public class Authenticated extends Controller{ | |
public static void itIsOk(){ | |
renderHtml( | |
"<script>"+ |
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
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript"> | |
window.addEventListener("message", handleFrameMessage, false); | |
function handleFrameMessage(e){ | |
console.log(e); | |
} |
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 models; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class JItem { | |
public String label; | |
public String url; | |
public String bundle; | |
public String author; |
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 controllers; | |
import java.util.List; | |
import models.Item; | |
import models.JItem; | |
import play.mvc.*; | |
public class JSonItems extends Controller{ | |
public static void getList(){ |
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
ecrire = {println it} | |
faire = { | |
for(i in 1..it.fois){ | |
it.quoi.call() | |
} | |
} | |
faire fois:5, quoi:{ecrire "bonjour"} |