Examples of Citation


Examples of org.opengis.metadata.citation.Citation

    public static Citation fromName(String title) {
        if (title == null || ((title = CharSequences.trimWhitespaces(title)).isEmpty())) {
            return null;
        }
        for (int i=0; i<AUTHORITIES.length; i++) {
            final Citation citation = AUTHORITIES[i];
            if (titleMatches(citation, title)) {
                return citation;
            }
        }
        return new SimpleCitation(title);
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

     *
     * @throws JAXBException Should never happen.
     */
    @Test
    public void testIdentification() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(IDENTIFIED_XML);
        assertEquals("title", "My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertFalse("Unexpected proxy", Proxy.isProxyClass(series.getClass()));
        assertInstanceOf("Expected IdentifiedObject", IdentifiedObject.class, series);
        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
        assertEquals("series", "My aggregate dataset",  series.getName().toString());
        assertNull  ("href", map.get(IdentifierSpace.HREF));
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

     *
     * @throws JAXBException Should never happen.
     */
    @Test
    public void testReference() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML_WITH_BODY);
        assertEquals("Citation.title""My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
        assertFalse     ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
        assertEquals    ("Citation.series.name", "My aggregate dataset", series.getName().toString());
        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
        assertNull  ("href",             map.get(IdentifierSpace.HREF));
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

     * @throws JAXBException Should never happen.
     */
    @Test
    @DependsOnMethod("testReference")
    public void testReferenceInEmptyObject() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML);
        assertEquals("Citation.title""My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
        assertNull      ("Citation.series.name", series.getName());
        assertTrue      ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
        assertInstanceOf("Citation.series", NilObject.class, series);
        assertEquals    ("Series[{gco:uuid=“" + UUID_VALUE + "”}]", series.toString());
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

                "    <gco:CharacterString>A title</gco:CharacterString>\n" +
                "  </gmd:title>\n" +
                "  <gmd:series gco:nilReason=\"missing\"/>\n" +
                "</gmd:CI_Citation>";

        final Citation citation = (Citation) XML.unmarshal(expected);
        assertEquals("title", "A title", citation.getTitle().toString());

        final Series series = citation.getSeries();
        assertInstanceOf("Should have instantiated a proxy.", NilObject.class, series);

        final NilReason reason = ((NilObject) series).getNilReason();
        assertSame("nilReason", NilReason.MISSING, reason);
        assertNull("NilReason.explanation", reason.getOtherExplanation());
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

                "    <gco:CharacterString>A title</gco:CharacterString>\n" +
                "  </gmd:title>\n" +
                "  <gmd:series gco:nilReason=\"other:myReason\"/>\n" +
                "</gmd:CI_Citation>";

        final Citation citation = (Citation) XML.unmarshal(expected);
        assertEquals("title", "A title", citation.getTitle().toString());

        final Series series = citation.getSeries();
        assertInstanceOf("Should have instantiated a proxy.", NilObject.class, series);

        final NilReason reason = ((NilObject) series).getNilReason();
        assertEquals("NilReason.explanation", "myReason", reason.getOtherExplanation());
        assertNull("NilReason.URI", reason.getURI());
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

                "    <gco:CharacterString>A title</gco:CharacterString>\n" +
                "  </gmd:title>\n" +
                "  <gmd:series gco:nilReason=\"http://www.myreason.org\"/>\n" +
                "</gmd:CI_Citation>";

        final Citation citation = (Citation) XML.unmarshal(expected);
        assertEquals("title", "A title", citation.getTitle().toString());

        final Series series = citation.getSeries();
        assertInstanceOf("Should have instantiated a proxy.", NilObject.class, series);

        final NilReason reason = ((NilObject) series).getNilReason();
        assertNull("NilReason.explanation", reason.getOtherExplanation());
        assertEquals("NilReason.URI", "http://www.myreason.org", String.valueOf(reason.getURI()));
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

     * Returns a pseudo-WKT representation.
     */
    @Override
    public String toString() {
        final String code, codespace;
        final Citation authority;
        final ReferenceIdentifier id = referenceSystemIdentifier;
        if (id != null) {
            code      = id.getCode();
            codespace = id.getCodeSpace();
            authority = id.getAuthority();
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

     *               or {@code null} if none.
     */
    public static <T extends Identifier> void replace(final Collection<T> identifiers, final Collection<T> oldIds) {
        if (oldIds != null && identifiers != null) {
            for (final T old : oldIds) {
                final Citation authority = old.getAuthority();
                for (final Iterator<T> it=identifiers.iterator(); it.hasNext();) {
                    final T id = it.next();
                    if (id == null || id.getAuthority() == authority) {
                        it.remove();
                    }
View Full Code Here

Examples of org.opengis.metadata.citation.Citation

            final Iterator<? extends Identifier> it = identifiers;
            if (it != null) {
                while (it.hasNext()) {
                    final Identifier identifier = it.next();
                    if (identifier != null) {
                        final Citation authority = identifier.getAuthority();
                        final Boolean state = put(authority, Boolean.FALSE);
                        if (state == null) {
                            if (identifier instanceof IdentifierMapEntry) {
                                next = (IdentifierMapEntry) identifier;
                            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.