Class JDKDeprecationExtension
- java.lang.Object
-
- org.apache.sling.feature.extension.apiregions.api.JDKDeprecationExtension
-
public class JDKDeprecationExtension extends Object
Extension to hold information about deprecated JDK API This class is not thread safe.- Since:
- 1.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXTENSION_NAME
Extension name containing the deprecation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMemberInfo(String member, DeprecationInfo i)
Add deprecation info for a memberboolean
equals(Object obj)
static JDKDeprecationExtension
getExtension(org.apache.sling.feature.Extension ext)
Get the execution environment from the extension.static JDKDeprecationExtension
getExtension(org.apache.sling.feature.Feature feature)
Get the extension from the feature - if it exists.Map<String,DeprecationInfo>
getMemberInfos()
Get all deprecation member infosint
hashCode()
void
removeMemberInfo(String member)
Remove deprecation info for a memberjavax.json.JsonObject
toJSON()
Generate a JSON representation
-
-
-
Field Detail
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension name containing the deprecation. The extension can be used to specify JDK API which is deprecated / should not be used. This extension is of typeExtensionType.JSON
and is optional.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExtension
public static JDKDeprecationExtension getExtension(org.apache.sling.feature.Feature feature)
Get the extension from the feature - if it exists.- Parameters:
feature
- The feature- Returns:
- The extension or
null
. - Throws:
IllegalArgumentException
- If the extension is wrongly formatted
-
getExtension
public static JDKDeprecationExtension getExtension(org.apache.sling.feature.Extension ext)
Get the execution environment from the extension.- Parameters:
ext
- The extension- Returns:
- The execution environment or
null
. - Throws:
IllegalArgumentException
- If the extension is wrongly formatted
-
addMemberInfo
public void addMemberInfo(String member, DeprecationInfo i)
Add deprecation info for a member- Parameters:
member
- The memberi
- The info- Throws:
IllegalStateException
- if the package is already deprecated
-
removeMemberInfo
public void removeMemberInfo(String member)
Remove deprecation info for a member- Parameters:
member
- The member
-
getMemberInfos
public Map<String,DeprecationInfo> getMemberInfos()
Get all deprecation member infos- Returns:
- The infos
-
toJSON
public javax.json.JsonObject toJSON()
Generate a JSON representation- Returns:
- The JSON Object
-
-