T
- the type of the element expected in the transform
method. Note that you need to be careful about
this type because the types of the elements passed to transform
depend on the differences that the
transform is interested in. Thus you may end up with ClassCastException
s if you're not careful.
This type needs to be cast-able to the type of all possible elements that the handled differences can
apply to. If in doubt, just use Element
which is guaranteed to work.public interface DifferenceTransform<T extends Element> extends AutoCloseable, Configurable
The AutoCloseable.close()
is not called if there is no prior call to Configurable.initialize(AnalysisContext)
. Do all your
resource acquisition in initialize, not during the construction of the object.
Modifier and Type | Method and Description |
---|---|
Pattern[] |
getDifferenceCodePatterns() |
Difference |
transform(T oldElement,
T newElement,
Difference difference)
Returns a transformed version of the difference.
|
close
getExtensionId, getJSONSchema, initialize
@Nonnull Pattern[] getDifferenceCodePatterns()
@Nullable Difference transform(@Nullable T oldElement, @Nullable T newElement, @Nonnull Difference difference)
The code of the supplied difference will match at least one of the regexes returned from the getDifferenceCodePatterns()
method.
oldElement
- the old differing elementnewElement
- the new differing elementdifference
- the difference descriptionCopyright © 2014-2020 Lukas Krejci. All Rights Reserved.