public static class CompoundTransformer.Builder
extends java.lang.Object
Constructor and Description |
---|
CompoundTransformer.Builder() |
Modifier and Type | Method and Description |
---|---|
CompoundTransformer |
build() |
CompoundTransformer.Builder |
changeCatalogItemId(java.lang.String oldSymbolicName,
java.lang.String newSymbolicName,
java.lang.String newVersion)
As
changeCatalogItemId(String, String, String, String) matching any old version. |
CompoundTransformer.Builder |
changeCatalogItemId(java.lang.String oldSymbolicName,
java.lang.String oldVersion,
java.lang.String newSymbolicName,
java.lang.String newVersion)
Changes the contents of an XML tag 'catalogItemId' where the
old text matches oldSymbolicName and optionally oldVersion
to have newSymbolicName and newVersion.
|
CompoundTransformer.Builder |
rawDataTransformer(BrooklynObjectType type,
RawDataTransformer val) |
CompoundTransformer.Builder |
rawDataTransformer(RawDataTransformer val) |
CompoundTransformer.Builder |
renameClass(java.lang.String oldName,
java.lang.String newName)
Updates all references to a class to a new value
|
CompoundTransformer.Builder |
renameClassTag(java.lang.String oldVal,
java.lang.String newVal)
Renames an implicit class name reference (a tag).
|
CompoundTransformer.Builder |
renameField(java.lang.String clazz,
java.lang.String oldVal,
java.lang.String newVal)
Renames a field in xstream serialization.
|
CompoundTransformer.Builder |
renameType(java.lang.String oldVal,
java.lang.String newVal)
Renames an explicit type name reference in brooklyn-xstream serialization.
|
CompoundTransformer.Builder |
xmlChangeAttribute(java.lang.String xpathToMatch,
java.lang.String newValue) |
CompoundTransformer.Builder |
xmlRenameTag(java.lang.String xpathToMatch,
java.lang.String newValue)
Replaces a tag, but while continuing to recurse.
|
CompoundTransformer.Builder |
xmlReplaceItem(java.lang.String xpathToMatch,
java.lang.String newValue)
Discards and replaces the item at the given XPath.
|
CompoundTransformer.Builder |
xsltTransformer(BrooklynObjectType type,
java.lang.String xslt)
registers the given XSLT code to be applied to the given persisted
BrooklynObjectType s |
CompoundTransformer.Builder |
xsltTransformer(java.lang.String xslt)
registers the given XSLT code to be applied to all persisted
BrooklynObjectType s |
public CompoundTransformer.Builder rawDataTransformer(RawDataTransformer val)
public CompoundTransformer.Builder rawDataTransformer(BrooklynObjectType type, RawDataTransformer val)
public CompoundTransformer.Builder xsltTransformer(java.lang.String xslt)
BrooklynObjectType
spublic CompoundTransformer.Builder xsltTransformer(BrooklynObjectType type, java.lang.String xslt)
BrooklynObjectType
spublic CompoundTransformer.Builder xmlReplaceItem(java.lang.String xpathToMatch, java.lang.String newValue)
For example to replace all occurrences
of text "foo" inside a tag "Tag1", you can use TagName/text()[.='foo']
;
passing bar
as the second argument would cause
<Tag1>foo</Tag1>
to become <Tag1>bar</Tag1>
.
Note that java class names may require conversion prior to invoking this;
see toXstreamClassnameFormat(String)
.
public CompoundTransformer.Builder xmlRenameTag(java.lang.String xpathToMatch, java.lang.String newValue)
public CompoundTransformer.Builder xmlChangeAttribute(java.lang.String xpathToMatch, java.lang.String newValue)
public CompoundTransformer.Builder renameType(java.lang.String oldVal, java.lang.String newVal)
Really this changes the contents inside any tag named "type", where the contents match the oldVal, they are changed to the newVal.
In brooklyn-xstream, the "type" node typically gives the name of a java or catalog type to be used when creating an instance; that's how this works.
public CompoundTransformer.Builder renameClassTag(java.lang.String oldVal, java.lang.String newVal)
Really this changes any XML tag matching a given old value; the tag is changed to the new value.
In brooklyn-xstream many tags correspond to the java class of an object; that's how this works to to change the java class (or xstream alias) of a persisted instance, included nested instances.
public CompoundTransformer.Builder renameField(java.lang.String clazz, java.lang.String oldVal, java.lang.String newVal)
Really this changes an XML tag inside another tag, where the outer tag and inner tag match the clazz and oldVal values given here, the inner tag is changed to the newVal.
In brooklyn-xstream, tags corresponding to fields are contained in the tag corresponding to the class name; that's how this works.
public CompoundTransformer.Builder changeCatalogItemId(java.lang.String oldSymbolicName, java.lang.String oldVersion, java.lang.String newSymbolicName, java.lang.String newVersion)
This provides a programmatic way to change the catalogItemID.
public CompoundTransformer.Builder changeCatalogItemId(java.lang.String oldSymbolicName, java.lang.String newSymbolicName, java.lang.String newVersion)
changeCatalogItemId(String, String, String, String)
matching any old version.public CompoundTransformer.Builder renameClass(java.lang.String oldName, java.lang.String newName)
oldName
- the old name of the classnewName
- the new name of the class to be used insteadpublic CompoundTransformer build()