/** * 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; }
/** * Returns the scope (name space) in which this name is local. The scope is set on creation and * is not modifiable. The scope of a name determines where a name "starts". For instance, if a * name has a {@linkplain #depth depth} of two ({@code "util.GenericName"}) and is associated * with a {@linkplain NameSpace name space} having the name {@code "org.opengis"}, then the * fully qualified name would be {@code "org.opengis.util.GenericName"}. * * @since 2.3 * @todo To be strict, maybe we should returns {@code null} if there is no namespace. Current * implementation returns a namespace instance whith a null name. This behavior is for * transition from legacy API to later ISO 19103 revision and may change in future GeoTools * version. */ public NameSpace scope() { return (asScopedName != null) ? asScopedName.scope() : super.scope(); }
/** * Returns the scope (name space) in which this name is local. The scope is set on creation * and is not modifiable. The scope of a name determines where a name "starts". For instance, * if a name has a {@linkplain #depth depth} of two ({@code "util.GenericName"}) and is * associated with a {@linkplain NameSpace name space} having the name {@code "org.opengis"}, * then the fully qualified name would be {@code "org.opengis.util.GenericName"}. * * @since 2.3 * * @todo Need to be revisited once GeoAPI 2.1 is seetle down. */ public NameSpace scope() { return (asScopedName!=null) ? asScopedName.scope() : null; }
/** * 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; }
/** * 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; }
/** * Returns the scope (name space) in which this name is local. The scope is set on creation * and is not modifiable. The scope of a name determines where a name "starts". For instance, * if a name has a {@linkplain #depth depth} of two ({@code "util.GenericName"}) and is * associated with a {@linkplain NameSpace name space} having the name {@code "org.opengis"}, * then the fully qualified name would be {@code "org.opengis.util.GenericName"}. * * @since 2.3 * * @todo To be strict, maybe we should returns {@code null} if there is no namespace. * Current implementation returns a namespace instance whith a null name. This * behavior is for transition from legacy API to later ISO 19103 revision and * may change in future GeoTools version. */ public NameSpace scope() { return (asScopedName!=null) ? asScopedName.scope() : super.scope(); }
/** * Ensures that ISO 19103 or GeoAPI restrictions apply, then checks for yet more restrictive * Geotk conditions. This method requires the exact same instance where GeoAPI requires only * instances that are {@linkplain Object#equals(Object) equal}. * * @param object The object to validate, or {@code null}. */ @Override public void validate(final ScopedName object) { super.validate(object); if (object != null) { final List<? extends LocalName> parsedNames = object.getParsedNames(); assertSame("ScopedName: head.scope shall be same than scope.", object.scope(), object.head().scope()); assertSame("GenericName: head() shall be the first element in getParsedNames() list.", parsedNames.get(0), object.head()); assertSame("GenericName: tip() shall be the last element in getParsedNames() list.", parsedNames.get(parsedNames.size()-1), object.tip()); assertSame("ScopedName: tip() and tail.tip() shall be the same.", object.tip(), object.tail().tip()); assertSame("ScopedName: head() and path.head() shall be the same.", object.head(), object.path().head()); } } }
final NameSpace scope = object.scope(); validate(scope); if (scope != null) {
final NameSpace scope = object.scope(); validate(scope); if (scope != null) {