Package org.opengis.util

Examples of org.opengis.util.NameSpace


     */
    public static DefaultLocalName castOrCopy(final LocalName object) {
        if (object == null || object instanceof DefaultLocalName) {
            return (DefaultLocalName) object;
        }
        final NameSpace scope = object.scope();
        final InternationalString name = object.toInternationalString();
        final LocalName result;
        if (object instanceof MemberName) {
            result = DefaultFactories.SIS_NAMES.createMemberName(scope, name, ((MemberName) object).getAttributeType());
        } else if (object instanceof TypeName) {
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

     * @category Generic name
     */
    private GenericName createName(final Citation authority, final CharSequence code) {
        final NameFactory factory = DefaultFactories.NAMES;
        final String title = Citations.getIdentifier(authority); // Whitespaces trimed by Citations.
        NameSpace scope = null;
        if (title != null) {
            synchronized (SCOPES) {
                scope = SCOPES.get(title);
                if (scope == null) {
                    scope = factory.createNameSpace(factory.createLocalName(null, title), null);
View Full Code Here

                                    }
                                    addTo.add(name);
                                }
                            }
                        } else {
                            final NameSpace ns = alias.scope();
                            if (ns != null) {
                                final GenericName scope = ns.name();
                                if (scope != null) {
                                    if (identifierMatches(authority, scope.toString())) {
                                        final String name = alias.toString();
                                        if (name != null) {
                                            if (addTo == null) {
View Full Code Here

     */
    public static DefaultLocalName castOrCopy(final LocalName object) {
        if (object == null || object instanceof DefaultLocalName) {
            return (DefaultLocalName) object;
        }
        final NameSpace scope = object.scope();
        final InternationalString name = object.toInternationalString();
        final LocalName result;
        if (object instanceof MemberName) {
            result = DefaultFactories.SIS_NAMES.createMemberName(scope, name, ((MemberName) object).getAttributeType());
        } else if (object instanceof TypeName) {
View Full Code Here

        assertEquals("tip",   "4326",      identifier.tip().toString());
        assertEquals("head""EPSG",      identifier.head().toString());
        assertEquals("name""EPSG:4326", identifier.toString());

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

    /**
     * Tests the {@link NamedIdentifier#NamedIdentifier(GenericName)} constructor.
     */
    @Test
    public void testCreateFromName() {
        final NameSpace scope = SIS_NAMES.createNameSpace(SIS_NAMES.createLocalName(null, "OGP"), null);
        final NamedIdentifier identifier = new NamedIdentifier(SIS_NAMES.createGenericName(scope, "EPSG", "4326"));
        Validators.validate((ReferenceIdentifier) identifier);
        Validators.validate((GenericName) identifier);

        // ImmutableIdentifier properties
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.