How it works

	This class is similar to a xml parser, it searches for template tags
	on the text and make them easily to access through the class, adding special properties and methods to each node.



	By default is recognized as a template tag the tags that follow this pattern:
	&lt;js:TagName&gt;any content&lt;/js:TagName&gt;.
	But this is configurable, example: [TagName]content[/TagName].



Template example:
&lt;js:a&gt;
	&lt;js:b&gt;content&lt;/js:b&gt;
&lt;/js:a&gt;




	After loading the template above, you could access the text "content" by using templateInstance.root.a.b._get()



There are two restrictions on the tag naming:

	
		The tag name can't start with "_".
		Wrong: [_myTag][/_myTag]
	
	
		There must not be tags with the same name in the same indentation level.
		Wrong: [a][/a][a][/a].
		Correct: [a][/a][b][/b].

		Wrong: [a][b][/b][b][/b][/a].
		Correct: [a][b][/b][c][/c][/a].

		Correct: [a][b][/b][a][b][/b] (the second [b] is in another indentation level).
	




	To get more details of how it works, look at the example.



Constructor

	Template(content: String, [beginOpen: String = "&lt;js:"], [beginClose: String = "&gt;"], [endOpen: String = "&lt;/js:"], [endClose: String = "&gt;"])
	
		Generates an instance of Template.
		Restrictions:
		
			beginOpen can't be equal to endOpen
			beginOpen can't be equal to beginClose
			beginOpen can't be equal to endClose
			endOpen can't be equal to beginClose
			endOpen can't be equal to endClose
		
		
			content text to be parsed by the class
			beginOpen defines the opening tag prefix
			beginClose defines the opening tag suffix
			endOpen defines the closing tag prefix
			endClose defines the closing tag suffix
		
	



Properties

	Template.root: Node It's the root node, must be used to obtain access to the other nodes through "JSON".
	Template.tags: Array Array containing references to all the nodes.



Node Methods

	Node._get(void): String
	
		Returns the node value. If there are template tags inside this text,
		they will be removed, keeping just the default text inside them.
	
	Node._set(value: String): String
	
		Sets a new value to the node and, returns the own setted text. If the node have children, they will be ignored (but not really removed) on the output.
		
			value text to be setted
		
	
	Node._reset([deep: Boolean = false]): void
	
		Undo all the modifications done on the node by the methods "_render" or "_set".
		
			deep if true, it will also reset the child nodes
		
	
	Node._render(void): String
	
		The function returns the current node value and implements a kind of "content stack".
		The current node value is pushed (you have access to it through the "_value" property), and the node starts to work on a copy of the value.
		Obs: The unqueueing will occur automatically on the output.
	
	Node._output(void): String
	
		Returns the text of the node and its child nodes. It's similar to "_get", but differently from "_get",
		that just returns the node value, it also gets the text of the child nodes.
	



Node Properties

	Node._default: String Keeps the initial node value.
	Node._parent: Node Reference to the parent node.
	Node._name: String Tag name.
	Node._children: Array Array containing the child nodes.
	Node._value: Array Keep the node text in a kind of queue structure.
