/** * Creates a wrapper using the specified hints. For strict compliance with OGC definitions, the * supplied hints should contains at least the {@link Hints#FORCE_LONGITUDE_FIRST_AXIS_ORDER * FORCE_LONGITUDE_FIRST_AXIS_ORDER} hint with value {@link Boolean#FALSE FALSE}. * * @param userHints The hints to be given to backing factories. * @param hintsAuthority the name used to reference thi factory in {@link * Hints#FORCE_AXIS_ORDER_HONORING}. */ public Abstract_URI_AuthorityFactory(final Hints userHints, String hintsAuthority) { this(HTTP_AuthorityFactory.getFactory(userHints, hintsAuthority)); }
/** * Returns a factory from the specified hints. Used by {@link URN_AuthorityFactory} constructor * as well. */ static AllAuthoritiesFactory getFactory(Hints hints, final String authority) { if (!defaultAxisOrderHints(hints, authority)) { hints = new Hints(hints); hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE); } return new AllAuthoritiesFactory(hints); }
/** Tests the {@link HTTP_AuthorityFactory#defaultAxisOrderHints} method. */ @Test public void testAxisOrderHints() { // The following are required for proper execution of the remaining of this test. assertNull(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)); assertNull(Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING)); // Standard behavior should be to set FORCE_LONGITUDE_FIRST_AXIS_ORDER to false. assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); try { // The hints should be ignored. Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); // The hints should be honored. Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http"); assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); // The hints should be ignored. Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "urn"); assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); // The hints should be honored. Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http, urn"); assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); // The hints should be honored. Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "urn, http"); assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); } finally { Hints.removeSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER); Hints.removeSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } }
/** * Creates a wrapper using the specified hints. For strict compliance with OGC definition of CRS * defined by URL, the supplied hints should contains at least the {@link * Hints#FORCE_LONGITUDE_FIRST_AXIS_ORDER FORCE_LONGITUDE_FIRST_AXIS_ORDER} hint with value * {@link Boolean#FALSE FALSE}. * * @param userHints The hints to be given to backing factories. */ public HTTP_AuthorityFactory(final Hints userHints) { this(getFactory(userHints, "http")); }