aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc_tools
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-06-29 15:49:52 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-06-30 11:40:54 +0000
commitaf2ea37ceab2300a6d40afe65c1e333dfbaa0a11 (patch)
treeebecae8914404203e3944f03f9b6a5b31bb11c3f /src/objc_tools
parent368cc56fb2baa3e21be4acdd2410a4ce8245de93 (diff)
Creates a fluent api that moves the xml generation into the data writer.
The new "define" method replaces the now deprecated writeToValuesXml method. This provides three benefits: * An agnostic writing interface to the XmlResourceValue classes, easing the replacement of them with a proper xml writer. * A delayed write which allows the StyleableXmlResourceValue to claim AttrXmlResourceValue definitions before writing. * Centralized method of source attribution, enabling a less verbose way to indicate multiple values came from a single xml source file. An example of the new interface writing the StyleXmlResourceValue: ValuesResourceDefinition definition = mergedDataWriter .define(key) .derivedFrom(source) .startTag("style") .named(key) .optional() .attribute("parent") .setTo(parent) .closeTag(); for (Entry<String, String> entry : values.entrySet()) { definition = definition .startItemTag() .named(entry.getKey()) .close() .addCharactersOf(entry.getValue()) .endTag(); } definition.endTag().save(); -- MOS_MIGRATED_REVID=126196028
Diffstat (limited to 'src/objc_tools')
0 files changed, 0 insertions, 0 deletions