Package org.opengis.metadata

Examples of org.opengis.metadata.Identifier


        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

     * 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

    {
        ArgumentChecks.ensureNonNull("authority", authority);
        T 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 (identifier instanceof SpecializedIdentifier<?>) {
                    @SuppressWarnings("unchecked")
                    final SpecializedIdentifier<T> id = (SpecializedIdentifier<T>) identifier;
                    if (old == null) {
                        old = id.value;
View Full Code Here

         */
        private void toNext() {
            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 {
                                next = new IdentifierMapEntry.Immutable(authority, identifier.getCode());
                            }
                            this.authority = authority;
                            return;
                        }
                        if (state) {
View Full Code Here

    // looking for an EPSG code
    final Set<? extends Identifier> identifiers = obj.getIdentifiers();
    final Iterator<? extends Identifier> it = identifiers.iterator();
    String code = "";
    while (it.hasNext()) {
      final Identifier identifier = it.next();
      final Citation cite = identifier.getAuthority();
      if (Citations.identifierMatches(cite, "EPSG")) {
        code = identifier.getCode();
        break;
      }
    }

    try {
View Full Code Here

        if (crs == null) {
            return null;
        }

        for (Iterator i = crs.getIdentifiers().iterator(); i.hasNext();) {
            Identifier id = (Identifier) i.next();

            //return "EPSG:" + id.getCode();
            if ((id.getAuthority() != null)
                    && id.getAuthority().getTitle().equals(Citations.EPSG.getTitle())) {
                return id.getCode();
            }
        }

        return null;
    }
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.