@Test public void testRenameFieldInXml() throws Exception { CompoundTransformer transformer = CompoundTransformer.builder() .renameField("MyClass", "myFieldBefore", "myFieldAfter") .build(); String input = "<entity myattrib=\"myval\">"+NEWLINE+ " <type myattrib2=\"myval2\">mytype.Before</type>"+NEWLINE+ " <config>"+NEWLINE+ " <test.conf1>"+NEWLINE+ " <MyClass>"+NEWLINE+ " <myFieldBefore class=\"string\">myfieldval</myFieldBefore>"+NEWLINE+ " </MyClass>"+NEWLINE+ " </test.conf1>"+NEWLINE+ " <test.conf2>"+NEWLINE+ " <MyOtherClass>"+NEWLINE+ " <myFieldBefore class=\"string\">myfieldval</myFieldBefore>"+NEWLINE+ " </MyOtherClass>"+NEWLINE+ " </test.conf2>"+NEWLINE+ " </config>"+NEWLINE+ "</entity>"; String expected = "<entity myattrib=\"myval\">"+NEWLINE+ " <type myattrib2=\"myval2\">mytype.Before</type>"+NEWLINE+ " <config>"+NEWLINE+ " <test.conf1>"+NEWLINE+ " <MyClass>"+NEWLINE+ " <myFieldAfter class=\"string\">myfieldval</myFieldAfter>"+NEWLINE+ " </MyClass>"+NEWLINE+ " </test.conf1>"+NEWLINE+ " <test.conf2>"+NEWLINE+ " <MyOtherClass>"+NEWLINE+ " <myFieldBefore class=\"string\">myfieldval</myFieldBefore>"+NEWLINE+ " </MyOtherClass>"+NEWLINE+ " </test.conf2>"+NEWLINE+ " </config>"+NEWLINE+ "</entity>"; assertSingleXmlTransformation(transformer, input, expected); }
public static Builder builder() { return new Builder(); }
CompoundTransformer { public static Builder builder() { return new Builder(); } }
CompoundTransformer { public static Builder builder() { return new Builder(); } protected  CompoundTransformer(Builder builder); }
CompoundTransformer { public static Builder builder() { return new Builder(); } protected  CompoundTransformer(Builder builder); static Builder builder(); BrooklynMementoRawData transform(BrooklynMementoPersisterToObjectStore reader, RebindExceptionHandler exceptionHandler); BrooklynMementoRawData transform(BrooklynMementoRawData rawData); }
CompoundTransformer { public static Builder builder() { return new Builder(); } protected  CompoundTransformer(Builder builder); static Builder builder(); BrooklynMementoRawData transform(BrooklynMementoPersisterToObjectStore reader, RebindExceptionHandler exceptionHandler); BrooklynMementoRawData transform(BrooklynMementoRawData rawData); static final CompoundTransformer NOOP; }