Class ClassificationTransform
java.lang.Object
org.revapi.basic.AbstractDifferenceReferringTransform
org.revapi.basic.DifferencesTransform
org.revapi.basic.ClassificationTransform
- All Implemented Interfaces:
AutoCloseable
,org.revapi.configuration.Configurable
,org.revapi.DifferenceTransform
Deprecated.
A generic difference transform that can change the classification of a difference. This can be used in situations
where one wants to consider certain differences differently than the defining extension declared them.
The transform can be configured like so:
{
"revapi" : {
"reclassify" : [
{
"regex" : false,
"code" : "PROBLEM_CODE",
"old" : "FULL_REPRESENTATION_OF_THE_OLD_ELEMENT",
"new" : "FULL_REPRESENTATION_OF_THE_NEW_ELEMENT",
classify : {
"NEW_COMPATIBILITY_TYPE": "NEW_SEVERITY",
"NEW_COMPATIBILITY_TYPE_2": "NEW_SEVERITY_2",
}
},
...
]
}
}
The code
is mandatory (obviously). The old
and new
properties are optional and the rule will
match when all the specified properties of it match. If regex attribute is "true" (defaults to "false"), all the
code, old and new are understood as regexes (java regexes, not javascript ones).
The NEW_COMPATIBILITY_TYPE
corresponds to one of the names of the CompatibilityType
enum
and the NEW_SEVERITY
corresponds to one of the names of the DifferenceSeverity
enum. The
reclassified difference inherits its classification (i.e. the compatibility type + severity pairs) and only redefines
the ones explicitly defined in the configuration.
- Since:
- 0.1
- Author:
- Lukas Krejci
-
Nested Class Summary
Nested classes/interfaces inherited from class org.revapi.basic.DifferencesTransform
DifferencesTransform.DifferenceRecipe
Nested classes/interfaces inherited from interface org.revapi.DifferenceTransform
org.revapi.DifferenceTransform.TraversalTracker<E extends org.revapi.Element<E>>
-
Field Summary
Fields inherited from class org.revapi.basic.AbstractDifferenceReferringTransform
analysisContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Deprecated.protected com.fasterxml.jackson.databind.JsonNode
Deprecated.protected DifferenceMatchRecipe
newRecipe
(com.fasterxml.jackson.databind.JsonNode config) Deprecated.Methods inherited from class org.revapi.basic.AbstractDifferenceReferringTransform
endTraversal, getDifferenceCodePatterns, getDifferenceCodePredicates, getExtensionId, initialize, startTraversal, tryTransform
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.revapi.DifferenceTransform
transform
-
Constructor Details
-
ClassificationTransform
public ClassificationTransform()Deprecated.
-
-
Method Details
-
getJSONSchema
Deprecated.- Specified by:
getJSONSchema
in interfaceorg.revapi.configuration.Configurable
- Overrides:
getJSONSchema
in classDifferencesTransform
-
getRecipesConfigurationAndInitialize
protected com.fasterxml.jackson.databind.JsonNode getRecipesConfigurationAndInitialize()Deprecated.- Overrides:
getRecipesConfigurationAndInitialize
in classDifferencesTransform
- Returns:
- a list node where the difference recipes are stored
-
newRecipe
Deprecated.- Overrides:
newRecipe
in classDifferencesTransform
-
close
public void close()Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classDifferencesTransform
-
DifferencesTransform