You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Removal.java 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.util;
  16. import java.lang.annotation.RetentionPolicy;
  17. import java.lang.annotation.Retention;
  18. import java.lang.annotation.Documented;
  19. /**
  20. * <p>Program elements annotated &#64;Removal track the earliest final release
  21. * when a deprecated feature will be removed. This is an internal decoration:
  22. * a feature may be removed in a release earlier or later than the release
  23. * number specified by this annotation.</p>
  24. *
  25. * <p>The POI project policy is to deprecate an element for 2 final releases
  26. * before removing. This annotation exists to make it easier to follow up on the
  27. * second step of the two-step deprecate and remove process.</p>
  28. *
  29. * <p>A deprecated feature may be removed in nightly and beta releases prior
  30. * to the final release for which it is eligible, but may be removed later for
  31. * various reasons. If it is known in advance that the feature will not be
  32. * removed in the n+2 release, a later version should be specified by this
  33. * annotation. The annotation version number should not include beta</p>
  34. *
  35. * <p>For example, a feature with a {@code @deprecated POI 3.15 beta 3}
  36. * is deprecated in POI 3.15 and 3.16 and becomes eligible for deletion during
  37. * the POI 3.17 release series, and may be deleted immediately after POI 3.16 is
  38. * released. This would be annotated {@code @Removal(version="3.17")}</p>.
  39. *
  40. * @since POI-3.15 beta 3
  41. */
  42. @Documented
  43. @Retention(RetentionPolicy.RUNTIME)
  44. public @interface Removal {
  45. /**
  46. * The POI version when this feature may be removed.
  47. *
  48. * To ensure that the version number can be compared to the current version
  49. * and a unit test can generate a warning if a removal-eligible feature has
  50. * not been removed yet, the version number should adhere to the following format:
  51. * <pre>{@code
  52. * Format: "(?<major>\d+)\.(?<minor>\d+)"
  53. * Example: "3.15"
  54. * }</pre>
  55. */
  56. String version() default "";
  57. // TODO: Verify that the version syntax is valid by parsing with a version-aware parser like
  58. // org.apache.maven.artifact.versioning.DefaultArtifactVersion
  59. }