Package org.opengis.metadata

Examples of org.opengis.metadata.Identifier


            node.putInt(LAST_ID, lastID);
            newWKT = processingWKT(text, lastID);
        }else{
            Set<ReferenceIdentifier> ids = createdCRS.getIdentifiers();
            if( !ids.isEmpty() ){
                Identifier id = ids.iterator().next();
                code=id.toString();
                name=createdCRS.getName().getCode()+" ("+code+")"; //$NON-NLS-1$ //$NON-NLS-2$
            }else{
                name=code=createdCRS.getName().getCode();
            }
           
View Full Code Here


                    return titleMatches(c1, c2);
                }
                c1 = c2;
            }
            do {
                final Identifier id = iterator.next();
                if (id != null && identifierMatches(c1, id.getCode())) {
                    return true;
                }
            } while (iterator.hasNext());
        }
        return false;
View Full Code Here

            final Iterator<? extends Identifier> identifiers = iterator(citation.getIdentifiers());
            if (identifiers == null) {
                return titleMatches(citation, identifier);
            }
            while (identifiers.hasNext()) {
                final Identifier id = identifiers.next();
                if (id != null && equalsFiltered(identifier, id.getCode(), LETTERS_AND_DIGITS, true)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        boolean isUnicode = false; // Whether 'identifier' is a Unicode identifier.
        String identifier = null;
        if (citation != null) {
            final Iterator<? extends Identifier> it = iterator(citation.getIdentifiers());
            if (it != null) while (it.hasNext()) {
                final Identifier id = it.next();
                if (id != null) {
                    final String candidate = trimWhitespaces(id.getCode());
                    if (candidate != null) {
                        final int length = candidate.length();
                        if (length != 0 && (identifier == null || length < identifier.length())) {
                            final boolean s = isUnicodeIdentifier(candidate);
                            if (s || !isUnicode) {
View Full Code Here

        if (identifiers != null && Context.isMarshalling()) {
            int count = identifiers.size();
            if (count != 0) {
                final Identifier[] copy = identifiers.toArray(new Identifier[count]);
                for (int i=count; --i>=0;) {
                    final Identifier id = copy[i];
                    if (id == null || (id.getAuthority() instanceof NonMarshalledAuthority)) {
                        System.arraycopy(copy, i+1, copy, i, --count - i);
                    }
                }
                identifiers = (count != 0) ? UnmodifiableArrayList.wrap(copy, 0, count) : null;
            }
View Full Code Here

     */
    public Metadata read() throws IOException {
        final DefaultMetadata metadata = new DefaultMetadata();
        metadata.setMetadataStandardName(MetadataUtilities.STANDARD_NAME_2);
        metadata.setMetadataStandardVersion(MetadataUtilities.STANDARD_VERSION_2);
        final Identifier identifier = getFileIdentifier();
        if (identifier != null) {
            String code = identifier.getCode();
            final Citation authority = identifier.getAuthority();
            if (authority != null) {
                final InternationalString title = authority.getTitle();
                if (title != null) {
                    code = title.toString() + DefaultNameSpace.DEFAULT_SEPARATOR + code;
                }
View Full Code Here

     * or {@code null} if no specialized identifier was found.
     */
    @Override
    @SuppressWarnings("unchecked")
    public <T> T getSpecialized(final IdentifierSpace<T> authority) {
        final Identifier identifier = getIdentifier(authority);
        return (identifier instanceof SpecializedIdentifier<?>) ? ((SpecializedIdentifier<T>) identifier).value : null;
    }
View Full Code Here

     * the cost of invoking {@code toString()} on the specialized object (some may be costly). Such
     * call would be useless because {@code IdentifierMapWithSpecialCase} discard the value of this
     * method when it found a specialized type.</p>
     */
    final String getUnspecialized(final Citation authority) {
        final Identifier identifier = getIdentifier(authority);
        if (identifier != null && !(identifier instanceof SpecializedIdentifier<?>)) {
            return identifier.getCode();
        }
        return null;
    }
View Full Code Here

     * @return The code of the identifier for the given authority, or {@code null} if none.
     */
    @Override
    public String get(final Object authority) {
        if (authority instanceof Citation) {
            final Identifier identifier = getIdentifier((Citation) authority);
            if (identifier != null) {
                return identifier.getCode();
            }
        }
        return null;
    }
View Full Code Here

    {
        ArgumentChecks.ensureNonNull("authority", authority);
        String old = null;
        final Iterator<? extends Identifier> it = identifiers.iterator();
        while (it.hasNext()) {
            final Identifier identifier = it.next();
            if (identifier == null) {
                it.remove(); // Opportunist cleaning, but should not happen.
            } else if (Objects.equals(authority, identifier.getAuthority())) {
                if (code != null && identifier instanceof IdentifierMapEntry) {
                    return ((IdentifierMapEntry) identifier).setValue(code);
                    // No need to suppress other occurrences of the key (if any)
                    // because we made a replacement in the first entry, so the
                    // new value will be visible by the getter methods.
                }
                if (old == null) {
                    old = identifier.getCode();
                }
                it.remove();
                // Continue the iteration in order to remove all other occurrences,
                // in order to ensure that the getter methods will see the new value.
            }
View Full Code Here

TOP

Related Classes of org.opengis.metadata.Identifier

Copyright © 2018 www.massapicom. 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.