Have all DOM stages that create Elements do so via an interface

Description

Currently, any DOM stage that creates Elements just does it. This prevents folks (Ian) from customizing the created Element in certain ways (pseudo-pretty printing). So, have any stage that produces Elements do so by means of a pluggable Function. The provide a very basic impl of that function and use it as the default so people besides Ian don't have to mess with it.

Environment

None

Activity

Ian Young 
January 26, 2015 at 10:59 AM

I have an implementation of this in the ukf-mda project now. I ended up with a Container class which knows about its own indentation, and which can be used to find and create child Container}}s. When this happens, it involves both a {{Function<Container> to do the actual element creation but also a strategy object to handle indentation and placement of the child. We should be able to pull all of this in to 0.9 fairly easily and reimplement the few creation sites using it.

Ian Young 
January 23, 2015 at 2:55 PM

I have generalised the issue title because the Guava docs indicate that Function implementations should generally be free of side-effects, which are after all the whole point of this idea.

I am working on a reasonably general framework for nested container work as part of for the UKf. If it works out well, we can probably use it to address this case as well.

Details

Assignee

Reporter

Original estimate

Components

Affects versions

Created March 21, 2012 at 1:13 PM
Updated November 28, 2015 at 6:25 PM