Skip to content

Instantly share code, notes, and snippets.

@bsideup
Last active December 18, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsideup/5834875 to your computer and use it in GitHub Desktop.
Save bsideup/5834875 to your computer and use it in GitHub Desktop.
class A
{
public var aString:String;
public var innerString : String;
public var anotherInnerString : String;
@hxmrDefaultProperty public var children : Array<B>;
public function new()
{
}
}
class ml.Test extends A{
public new(method) : Void -> Void
= function() = {
super();
this.myString = "Hello again!";
this.myB = this.init_myB();
this.aString = "1";
this.innerString = "Hello!";
this.anotherInnerString = Std.string(this.myString);
this.children = this.init_children();
};
init_children(method) : Void -> Array<deep.B>
= function() = {
if ((this.children != null))return this.children);
this.children = new Array();
return this.children;
};
init_myB(method) : Void -> deep.B
= function() = {
if ((this.myB != null))return this.myB);
this.myB = new deep.B();
return this.myB;
};
public myB(var) : deep.B;
public myString(var) : String;
}
<?xml version="1.0" encoding="utf-8" ?>
<ans:A ans:aString="1" xmlns:ans="*">
<B id="myB" xmlns="deep.*" test="123" prop="asValue"/>
<ans:innerString>Hello!</ans:innerString>
<ans:anotherInnerString>
<String id="myString">Hello again!</String>
</ans:anotherInnerString>
</ans:A>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment