Skip to content

tmeneau/static-node-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

static-node-builder

A simple project based on Cedric Champeau's staticbuilder project intended to fill the gap in XML parsing / generation where requirements are imposed that mean a schema is too strict (as is required in jaxb and other XML libraries).

An example usage is:

MyBuilder extends ConstrainedNodeBuilder {
	schema = {
		html {
			body {
				a()
				p()
			}
     	}
   	}
}

Which would allow consumers to build node trees using the following format:

MyBuilder builder = new MyBuilder()
	builder.html {
		body {
    		p("This is some text in the paragraph")
    		a([href: "http://www.link.com", data: "these are attributes"], "LINK")
		}
	}
}

About

A static node builder backed by an AST Transformation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published