Package org.opengis.util

Examples of org.opengis.util.NameSpace


        assertEquals("name""EPSG:name", identifier.toInternationalString().toString(Locale.ENGLISH));
        assertEquals("name""EPSG:nom",  identifier.toInternationalString().toString(Locale.FRENCH));
        assertEquals("name""EPSG:名前",  identifier.toInternationalString().toString(Locale.JAPANESE));

        // Scope (derived from the autority)
        final NameSpace scope = identifier.scope();
        assertFalse ("scope",         scope.isGlobal());
        assertEquals("scope", "EPSG", scope.name().toString());
    }
View Full Code Here


                for (GenericName alias : aliases) {
                    String codespace = NameToIdentifier.getCodeSpace(alias, locale);
                    if (codespace != null) {
                        alias = alias.tip();
                    } else {
                        final NameSpace scope = alias.scope();
                        if (scope != null && !scope.isGlobal()) {
                            codespace = NameToIdentifier.toString(scope.name().tip(), locale);
                        }
                    }
                    if (preferredCodespaces == null || preferredCodespaces.contains(codespace)) {
                        addIdentifier(codespace, NameToIdentifier.toString(alias, locale));
                        name = null;
View Full Code Here

     *
     * @return The authority, or {@code null} if none.
     */
    @Override
    public Citation getAuthority() {
        final NameSpace scope = name.scope();
        if (scope != null && !scope.isGlobal()) {
            return Citations.fromName(scope.name().tip().toString());
        }
        return null;
    }
View Full Code Here

     * @return The code space or authority, or {@code null} if none.
     */
    public static String getCodespaceOrAuthority(final GenericName name, final Locale locale) {
        String codespace = getCodeSpace(name, locale);
        if (codespace == null) {
            final NameSpace scope = name.scope();
            if (scope != null && !scope.isGlobal()) {
                codespace = toString(scope.name().tip(), locale);
            }
        }
        return codespace;
    }
View Full Code Here

     * @return The fully-qualified name (never {@code null}).
     */
    @Override
    public synchronized GenericName toFullyQualifiedName() {
        if (fullyQualified == null) {
            final NameSpace scope = scope();
            if (scope.isGlobal()) {
                fullyQualified = this;
            } else {
                final GenericName prefix = scope.name();
                assert prefix.scope().isGlobal() : prefix;
                fullyQualified = new DefaultScopedName(prefix, this);
            }
        }
        return fullyQualified;
View Full Code Here

     * @param  name The name after which to write a separator.
     * @return The separator to write after the given name.
     */
    static String separator(final GenericName name) {
        if (name != null) {
            final NameSpace scope = name.scope();
            if (scope instanceof DefaultNameSpace) {
                return ((DefaultNameSpace) scope).headSeparator;
            }
        }
        return DefaultNameSpace.DEFAULT_SEPARATOR_STRING;
View Full Code Here

         * locals[index-1] element (so we assume index > 0).
         */
        final Iterator<? extends LocalName> it = parsedTail.iterator();
        LocalName name = it.next();
        final LocalName lastName  = locals[index-1];
        final NameSpace lastScope = lastName.scope();
        final NameSpace tailScope = name.scope();
        if (tailScope instanceof DefaultNameSpace && ((DefaultNameSpace) tailScope).parent == lastScope) {
            /*
             * If the tail is actually the tip (a LocalName), remember the tail so we
             * don't need to create it again later. Then copy the tail after the path.
             */
 
View Full Code Here

        if (name == null) {
            return null;
        }
        final List<? extends LocalName> parsedNames = name.getParsedNames();
        final ListIterator<? extends LocalName> it = parsedNames.listIterator(parsedNames.size());
        NameSpace scope;
        /*
         * Searches for the last parsed name having a DefaultNameSpace implementation as its
         * scope. It should be the tip in most cases. If we don't find any, we will recreate
         * the whole chain starting with the global scope.
         */
 
View Full Code Here

     * Returns the scope (name space) of this generic name.
     * This method is protected from overriding by the user.
     */
    private GenericName getInternalScope() {
        if (asScopedName != null) {
            final NameSpace scope = asScopedName.scope();
            if (scope != null) {
                return scope.name();
            }
        }
        return null;
    }
View Full Code Here

     *       behavior is for transition from legacy API to later ISO 19103 revision and
     *       may change in future GeoTools version.
     */
    public NameSpace scope() {
        if (namespace == null) {
            namespace = new NameSpace() {
                public boolean isGlobal() {
                    return false;
                }

                public org.opengis.util.GenericName name() {
View Full Code Here

TOP

Related Classes of org.opengis.util.NameSpace

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.