Created
October 12, 2010 14:54
-
-
Save kimukou/622308 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Grab(group='commons-lang', module='commons-lang', version='2.5') | |
import org.apache.commons.lang.builder.* | |
class doObjA { | |
doObjA(){} | |
doObjA(key,value){setProperty(key,value) } | |
doObjA(properties_){properties=properties_} | |
Set<String> keySet(){return properties.keySet()} | |
def properties = [:] | |
Object getProperty( String property ) { | |
//println "read from property $property" | |
return properties[ property ] | |
} | |
void setProperty( String property, Object newValue ) { | |
//println "wrote to property $property" | |
properties[ property ] = newValue | |
} | |
String toString(){ | |
ToStringBuilder | |
.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE) | |
.toString() | |
} | |
} | |
class doObjB { | |
doObjB(){} | |
doObjB(key,value){setProperty(key,value) } | |
doObjB(properties_){properties=properties_} | |
Set<String> keySet(){return properties.keySet()} | |
def properties = [:] | |
Object getProperty( String property ) { | |
//println "read from property $property" | |
return properties[ property ] | |
} | |
void setProperty( String property, Object newValue ) { | |
//println "wrote to property $property" | |
properties[ property ] = newValue | |
} | |
String toString(){ | |
ToStringBuilder | |
.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE) | |
.toString() | |
} | |
} | |
def createDoObject = {//obj -> | |
def objA = new doObjA() | |
def objB = new doObjB() | |
objB.id = 10//obj.id | |
objB.name = "hoge"//obj.name | |
objA.objB = objB | |
objA.filePath="test.png"//obj.file_path | |
objA.fileName="test.file"//obj.file_name | |
return objA | |
} | |
def data = createDoObject()//it) //gsqlの結果のポインタ | |
println "${data.dump()}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test