Skip to content

Commit da95cd4

Browse files
committed
Transition before removal of a deprecated method.
1 parent 8170551 commit da95cd4

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

geoapi-conformance/src/main/java/org/opengis/test/referencing/PseudoEpsgFactory.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,25 @@ public IdentifiedObject createObject(final String code) throws FactoryException
267267
}
268268
}
269269

270+
/**
271+
* Returns a description of the object corresponding to a code.
272+
*
273+
* @param code value allocated by authority.
274+
* @return a description of the object, or {@code null} if the object
275+
* corresponding to the specified {@code code} has no description.
276+
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
277+
* @throws FactoryException if the query failed for some other reason.
278+
*
279+
* @deprecated This method is ambiguous because the EPSG geodetic registry may allocate
280+
* the same code to different kinds of object.
281+
*/
282+
@Override
283+
@SuppressWarnings("removal")
284+
@Deprecated(since="3.1", forRemoval=true)
285+
public org.opengis.util.InternationalString getDescriptionText(String code) throws FactoryException {
286+
return getDescriptionText(CoordinateReferenceSystem.class, code).orElse(null);
287+
}
288+
270289

271290

272291

geoapi/src/main/java/org/opengis/referencing/crs/CRSAuthorityFactory.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,23 @@ default ProjectedCRS createProjectedCRS(final String code) throws FactoryExcepti
314314
default org.opengis.referencing.IdentifiedObject createObject(String code) throws FactoryException {
315315
return createCoordinateReferenceSystem(code);
316316
}
317+
318+
/**
319+
* Returns a description of the object corresponding to a code.
320+
*
321+
* @param code value allocated by authority.
322+
* @return a description of the object, or {@code null} if the object
323+
* corresponding to the specified {@code code} has no description.
324+
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
325+
* @throws FactoryException if the query failed for some other reason.
326+
*
327+
* @deprecated This method is ambiguous because the EPSG geodetic registry may allocate
328+
* the same code to different kinds of object.
329+
*/
330+
@Override
331+
@SuppressWarnings("removal")
332+
@Deprecated(since="3.1", forRemoval=true)
333+
default org.opengis.util.InternationalString getDescriptionText(String code) throws FactoryException {
334+
return getDescriptionText(CoordinateReferenceSystem.class, code).orElse(null);
335+
}
317336
}

geoapi/src/main/java/org/opengis/referencing/cs/CSAuthorityFactory.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,23 @@ default ParametricCS createParametricCS(final String code) throws FactoryExcepti
251251
default org.opengis.referencing.IdentifiedObject createObject(String code) throws FactoryException {
252252
return createCoordinateSystem(code);
253253
}
254+
255+
/**
256+
* Returns a description of the object corresponding to a code.
257+
*
258+
* @param code value allocated by authority.
259+
* @return a description of the object, or {@code null} if the object
260+
* corresponding to the specified {@code code} has no description.
261+
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
262+
* @throws FactoryException if the query failed for some other reason.
263+
*
264+
* @deprecated This method is ambiguous because the EPSG geodetic registry may allocate
265+
* the same code to different kinds of object.
266+
*/
267+
@Override
268+
@SuppressWarnings("removal")
269+
@Deprecated(since="3.1", forRemoval=true)
270+
default org.opengis.util.InternationalString getDescriptionText(String code) throws FactoryException {
271+
return getDescriptionText(CoordinateSystem.class, code).orElse(null);
272+
}
254273
}

geoapi/src/main/java/org/opengis/referencing/datum/DatumAuthorityFactory.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,23 @@ default DatumEnsemble<?> createDatumEnsemble(String code) throws FactoryExceptio
261261
default org.opengis.referencing.IdentifiedObject createObject(String code) throws FactoryException {
262262
return createDatum(code);
263263
}
264+
265+
/**
266+
* Returns a description of the object corresponding to a code.
267+
*
268+
* @param code value allocated by authority.
269+
* @return a description of the object, or {@code null} if the object
270+
* corresponding to the specified {@code code} has no description.
271+
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
272+
* @throws FactoryException if the query failed for some other reason.
273+
*
274+
* @deprecated This method is ambiguous because the EPSG geodetic registry may allocate
275+
* the same code to different kinds of object.
276+
*/
277+
@Override
278+
@SuppressWarnings("removal")
279+
@Deprecated(since="3.1", forRemoval=true)
280+
default org.opengis.util.InternationalString getDescriptionText(String code) throws FactoryException {
281+
return getDescriptionText(Datum.class, code).orElse(null);
282+
}
264283
}

0 commit comments

Comments
 (0)