@Test public void testAxisOrderHints() { assertNull(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)); assertNull(Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING)); assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); try { Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http"); assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "urn"); assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http, urn"); assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http")); 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); } }
static boolean defaultAxisOrderHints(final Hints hints, final String authority) { Object value = null; if (hints != null) { value = hints.get(Hints.FORCE_AXIS_ORDER_HONORING); } if (value == null) { value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } if (value instanceof CharSequence) { final String list = value.toString(); int i = 0; while ((i = list.indexOf(authority, i)) >= 0) { if (i==0 || !Character.isJavaIdentifierPart(list.charAt(i - 1))) { final int j = i + authority.length(); if (j==list.length() || !Character.isJavaIdentifierPart(list.charAt(j))) { return true; } } i++; } } return false; }
HTTP_AuthorityFactory extends AuthorityFactoryAdapter implements CRSAuthorityFactory,
        CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory { static boolean defaultAxisOrderHints(final Hints hints, final String authority) { Object value = null; if (hints != null) { value = hints.get(Hints.FORCE_AXIS_ORDER_HONORING); } if (value == null) { value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } if (value instanceof CharSequence) { final String list = value.toString(); int i = 0; while ((i = list.indexOf(authority, i)) >= 0) { if (i==0 || !Character.isJavaIdentifierPart(list.charAt(i - 1))) { final int j = i + authority.length(); if (j==list.length() || !Character.isJavaIdentifierPart(list.charAt(j))) { return true; } } i++; } } return false; } }
HTTP_AuthorityFactory extends AuthorityFactoryAdapter implements CRSAuthorityFactory,
        CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory { static boolean defaultAxisOrderHints(final Hints hints, final String authority) { Object value = null; if (hints != null) { value = hints.get(Hints.FORCE_AXIS_ORDER_HONORING); } if (value == null) { value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } if (value instanceof CharSequence) { final String list = value.toString(); int i = 0; while ((i = list.indexOf(authority, i)) >= 0) { if (i==0 || !Character.isJavaIdentifierPart(list.charAt(i - 1))) { final int j = i + authority.length(); if (j==list.length() || !Character.isJavaIdentifierPart(list.charAt(j))) { return true; } } i++; } } return false; } HTTP_AuthorityFactory();  HTTP_AuthorityFactory(final Hints userHints);  HTTP_AuthorityFactory(final AllAuthoritiesFactory factory); }
HTTP_AuthorityFactory extends AuthorityFactoryAdapter implements CRSAuthorityFactory,
        CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory { static boolean defaultAxisOrderHints(final Hints hints, final String authority) { Object value = null; if (hints != null) { value = hints.get(Hints.FORCE_AXIS_ORDER_HONORING); } if (value == null) { value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } if (value instanceof CharSequence) { final String list = value.toString(); int i = 0; while ((i = list.indexOf(authority, i)) >= 0) { if (i==0 || !Character.isJavaIdentifierPart(list.charAt(i - 1))) { final int j = i + authority.length(); if (j==list.length() || !Character.isJavaIdentifierPart(list.charAt(j))) { return true; } } i++; } } return false; } HTTP_AuthorityFactory();  HTTP_AuthorityFactory(final Hints userHints);  HTTP_AuthorityFactory(final AllAuthoritiesFactory factory); @Override Citation getAuthority(); }
HTTP_AuthorityFactory extends AuthorityFactoryAdapter implements CRSAuthorityFactory,
        CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory { static boolean defaultAxisOrderHints(final Hints hints, final String authority) { Object value = null; if (hints != null) { value = hints.get(Hints.FORCE_AXIS_ORDER_HONORING); } if (value == null) { value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING); } if (value instanceof CharSequence) { final String list = value.toString(); int i = 0; while ((i = list.indexOf(authority, i)) >= 0) { if (i==0 || !Character.isJavaIdentifierPart(list.charAt(i - 1))) { final int j = i + authority.length(); if (j==list.length() || !Character.isJavaIdentifierPart(list.charAt(j))) { return true; } } i++; } } return false; } HTTP_AuthorityFactory();  HTTP_AuthorityFactory(final Hints userHints);  HTTP_AuthorityFactory(final AllAuthoritiesFactory factory); @Override Citation getAuthority(); static final String BASE_URL; }