/** * If the parameter is not supported throw an exception * * @param paramKey */ public static void checkUnsupported(String paramKey) { if (!isSupported(paramKey)) { throw new ParameterException(paramKey + " parameter is not supported"); } } }
/** * Create a new AbstractProjRegistry. */ public AbstractProjRegistry() { projParser = new ProjParser(this); } }
/** * Return true if the parameter is supported. * * @param paramKey * @return */ public static boolean isSupported(String paramKey) { return supportedParameters().contains(paramKey); }
if (keyValue.length == 2) { String key = formatKey(keyValue[0]); ProjKeyParameters.checkUnsupported(key); v.put(key, keyValue[1]); } else { String key = formatKey(token); ProjKeyParameters.checkUnsupported(key); v.put(key, null);
String[] keyValue = token.split("="); if (keyValue.length == 2) { String key = formatKey(keyValue[0]); ProjKeyParameters.checkUnsupported(key); v.put(key, keyValue[1]); } else { String key = formatKey(token); ProjKeyParameters.checkUnsupported(key); if (key.equals(ProjKeyParameters.wktext)) { String[] lines = regex.split(line, 2);
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(ESRI_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the ESRI registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, ESRI_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the ESRI registry", ex); } }
/** * Read all parameters from the registry * * @param crsCode the code corresponding to the information that must be * extracted from the registry * @param regexPattern the pattern used to split the line that describes the * coordinate system * @return * @throws IOException */ public Map<String, String> readParameters(String crsCode, Pattern regexPattern) throws IOException { InputStream inStr = Registry.class.getResourceAsStream(registry.getRegistryName()); if (inStr == null) { throw new IllegalStateException("Unable to access CRS file: " + registry.getRegistryName()); } BufferedReader reader = new BufferedReader(new InputStreamReader(inStr)); Map<String, String> args; try { args = readRegistry(reader, crsCode, regexPattern); } finally { reader.close(); } return args; }
if (keyValue.length == 2) { String key = formatKey(keyValue[0]); ProjKeyParameters.checkUnsupported(key); v.put(key, keyValue[1]); } else { String key = formatKey(token); ProjKeyParameters.checkUnsupported(key); v.put(key, null);
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(IGNF_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the IGNF registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, WORLD_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the world registry", ex); } }
if (keyValue.length == 2) { String key = formatKey(keyValue[0]); ProjKeyParameters.checkUnsupported(key); v.put(key, keyValue[1]); } else { String key = formatKey(token); ProjKeyParameters.checkUnsupported(key); v.put(key, null);
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(NAD27_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the NAD27 registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, EPSG_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the EPSG registry", ex); } }
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(NAD83_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the NAD83 registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, NAD83_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the NAD83 registry", ex); } }
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(WORLD_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the world registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, NAD27_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the NAD27 registry", ex); } }
@Override public Set<String> getSupportedCodes() throws RegistryException { try { return projParser.getSupportedCodes(EPSG_REGEX); } catch (IOException ex) { throw new RegistryException("Cannot load the EPSG registry", ex); } } }
@Override public Map<String, String> getParameters(String code) throws RegistryException { try { Map<String, String> crsParameters = projParser.readParameters(code, IGNF_REGEX); return crsParameters; } catch (IOException ex) { throw new RegistryException("Cannot load the IGNF registry", ex); } }