Package org.revapi.basic
Class ClassificationTransform
- java.lang.Object
-
- org.revapi.basic.AbstractDifferenceReferringTransform<E>
-
- org.revapi.basic.DifferencesTransform
-
- org.revapi.basic.ClassificationTransform
-
- All Implemented Interfaces:
AutoCloseable,org.revapi.configuration.Configurable,org.revapi.DifferenceTransform
@Deprecated public class ClassificationTransform extends DifferencesTransform
Deprecated.This is superseded byDifferencesTransformA 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
codeis mandatory (obviously). Theoldandnewproperties 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_TYPEcorresponds to one of the names of theCompatibilityTypeenum and theNEW_SEVERITYcorresponds to one of the names of theDifferenceSeverityenum. 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
-
-
Field Summary
-
Fields inherited from class org.revapi.basic.AbstractDifferenceReferringTransform
analysisContext
-
-
Constructor Summary
Constructors Constructor Description ClassificationTransform()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.ReadergetJSONSchema()Deprecated.protected com.fasterxml.jackson.databind.JsonNodegetRecipesConfigurationAndInitialize()Deprecated.protected DifferenceMatchRecipenewRecipe(com.fasterxml.jackson.databind.JsonNode config)Deprecated.-
Methods inherited from class org.revapi.basic.AbstractDifferenceReferringTransform
endTraversal, getDifferenceCodePatterns, getExtensionId, initialize, startTraversal, tryTransform
-
-
-
-
Method Detail
-
getJSONSchema
@Nullable public Reader getJSONSchema()
Deprecated.- Specified by:
getJSONSchemain interfaceorg.revapi.configuration.Configurable- Overrides:
getJSONSchemain classDifferencesTransform
-
getRecipesConfigurationAndInitialize
protected com.fasterxml.jackson.databind.JsonNode getRecipesConfigurationAndInitialize()
Deprecated.- Overrides:
getRecipesConfigurationAndInitializein classDifferencesTransform- Returns:
- a list node where the difference recipes are stored
-
newRecipe
@Nonnull protected DifferenceMatchRecipe newRecipe(com.fasterxml.jackson.databind.JsonNode config)
Deprecated.- Overrides:
newRecipein classDifferencesTransform
-
close
public void close()
Deprecated.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classDifferencesTransform
-
-