All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opengis.referencing.NoSuchAuthorityCodeException Maven / Gradle / Ivy

There is a newer version: 24.2-oss84-1
Show newest version
/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2011, Open Source Geospatial Foundation (OSGeo)
 *    (C) 2003-2005, Open Geospatial Consortium Inc.
 *
 *    All Rights Reserved. http://www.opengis.org/legal/
 */
package org.opengis.referencing;

/**
 * Thrown when an {@linkplain AuthorityFactory authority factory} can't find the requested authority
 * code.
 *
 * @author Martin Desruisseaux (IRD)
 * @since GeoAPI 1.0
 * @see org.opengis.referencing.datum.DatumAuthorityFactory
 * @see org.opengis.referencing.crs.CRSAuthorityFactory
 */
public class NoSuchAuthorityCodeException extends FactoryException {
    /** Serial number for interoperability with different versions. */
    private static final long serialVersionUID = -1573748311981746573L;

    /** The authority. */
    private final String authority;

    /** The invalid authority code. */
    private final String code;

    /**
     * Constructs an exception with the specified detail message and authority code.
     *
     * @param message The detail message. The detail message is saved for later retrieval by the
     *     {@link #getMessage()} method.
     * @param authority The authority.
     * @param code The invalid authority code.
     */
    public NoSuchAuthorityCodeException(String message, String authority, String code) {
        super(message);
        this.authority = authority;
        this.code = code;
    }

    /**
     * Returns the authority.
     *
     * @return The authority, or {@code null} if unknown.
     */
    public String getAuthority() {
        return authority;
    }

    /**
     * Returns the invalid authority code.
     *
     * @return The authority code, or {@code null} if unknown.
     */
    public String getAuthorityCode() {
        return code;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy