本文整理了Java中org.opengis.util.NameSpace.name()
方法的一些代码示例,展示了NameSpace.name()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NameSpace.name()
方法的具体详情如下:
包路径:org.opengis.util.NameSpace
类名称:NameSpace
方法名:name
[英]Represents the identifier of this namespace. If the #isGlobal attribute is true, indicating that this is a top level NameSpace, then the name should be a LocalName. If false, name should be a fully-qualified name where name. GenericName#scope(). #isGlobal == true
.
[中]表示此命名空间的标识符。如果#isGlobal属性为true,表示这是顶级名称空间,那么名称应该是LocalName。如果为false,则name应该是一个完全限定的名称,其中name. GenericName#scope(). #isGlobal == true
。
代码示例来源:origin: geotools/geotools
/**
* 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;
}
代码示例来源:origin: geotools/geotools
/**
* Returns the scope (name space) of this generic name. If this name has no scope (e.g. is the
* root), then this method returns {@code null}.
*
* @deprecated Replaced by {@link #scope()}.
*/
public GenericName getScope() {
return getName().scope().name();
}
代码示例来源:origin: geotools/geotools
/**
* Produce a good key based on the privided citaiton and code. You can think of the citation as
* being "here" and the code being the "what".
*
* @param code Code
* @return A good key for use with ObjectCache
*/
public static String toKey(Citation citation, String code) {
code = code.trim();
final GenericName name = NameFactory.create(code);
final GenericName scope = name.scope().name();
if (scope == null) {
return code;
}
if (citation != null && Citations.identifierMatches(citation, scope.toString())) {
return name.tip().toString().trim();
}
return code;
}
代码示例来源:origin: geotools/geotools
/**
* Trims the authority scope, if present. If more than one authority were given at {@linkplain
* #PropertyAuthorityFactory(ReferencingFactoryContainer, Citation[], URL) construction time},
* then any of them may appears as the scope in the supplied code.
*
* @param code The code to trim.
* @return The code without the authority scope.
*/
@Override
protected String trimAuthority(String code) {
code = code.trim();
final GenericName name = NameFactory.create(code);
final GenericName scope = name.scope().name();
if (scope == null) {
return code;
}
final String candidate = scope.toString();
for (int i = 0; i < authorities.length; i++) {
if (Citations.identifierMatches(authorities[i], candidate)) {
return name.tip().toString().trim();
}
}
return code;
}
代码示例来源:origin: geotools/geotools
/**
* Trims the authority scope, if present. For example if this factory is an EPSG authority
* factory and the specified code start with the "EPSG:" prefix, then the prefix is removed.
* Otherwise, the string is returned unchanged (except for leading and trailing spaces).
*
* @param code The code to trim.
* @return The code without the authority scope.
*/
protected String trimAuthority(String code) {
/*
* IMPLEMENTATION NOTE: This method is overridden in
* PropertyAuthorityFactory. If the implementation below is modified, it
* is probably worth revisiting the overridden method as well.
*/
code = code.trim();
final GenericName name = NameFactory.create(code);
final GenericName scope = name.scope().name();
if (scope == null) {
return code;
}
if (Citations.identifierMatches(getAuthority(), scope.toString())) {
return name.tip().toString().trim();
}
return code;
}
代码示例来源:origin: geotools/geotools
/**
* Trims the authority scope, if present. For example if this factory is an EPSG authority
* factory and the specified code start with the "EPSG:" prefix, then the prefix is removed.
* Otherwise, the string is returned unchanged (except for leading and trailing spaces).
*
* @param code The code to trim.
* @return The code without the authority scope.
*/
protected String trimAuthority(String code) {
/*
* IMPLEMENTATION NOTE: This method is overrided in PropertyAuthorityFactory. If
* implementation below is modified, it is probably worth to revisit the overrided
* method as well.
*/
code = code.trim();
final GenericName name = NameFactory.create(code);
final GenericName scope = name.scope().name();
if (scope == null) {
return code;
}
if (Citations.identifierMatches(getAuthority(), scope.toString())) {
return name.tip().toString().trim();
}
return code;
}
代码示例来源:origin: geotools/geotools
final GenericName scope = alias.scope().name();
final GenericName name = alias.tip();
final Object title;
代码示例来源:origin: geotools/geotools
final GenericName scope = alias.scope().name();
if (scope != null) {
if (title.equalsIgnoreCase(scope.toString())) {
代码示例来源:origin: org.apache.sis.core/sis-feature
/**
* Returns the namespace of the names created by {@code setName(CharSequence...)} method calls.
* A {@code null} value means that the names are in the
* {@linkplain org.apache.sis.util.iso.DefaultNameSpace#isGlobal() global namespace}.
*
* @return the namespace to use when {@link #setName(CharSequence)} is invoked, or {@code null} if none.
*/
public CharSequence getNameSpace() {
return (namespace != null) ? namespace.name().toString() : null;
}
代码示例来源:origin: org.apache.sis.core/sis-utility
/**
* Returns the schema name.
*
* @return the schema name.
*/
@Override
public LocalName getSchemaName() {
return namespace.name().tip();
}
代码示例来源:origin: apache/sis
/**
* Returns the namespace of the names created by {@code setName(CharSequence...)} method calls.
* A {@code null} value means that the names are in the
* {@linkplain org.apache.sis.util.iso.DefaultNameSpace#isGlobal() global namespace}.
*
* @return the namespace to use when {@link #setName(CharSequence)} is invoked, or {@code null} if none.
*/
public CharSequence getNameSpace() {
return (namespace != null) ? namespace.name().toString() : null;
}
代码示例来源:origin: apache/sis
/**
* Returns the schema name.
*
* @return the schema name.
*/
@Override
public LocalName getSchemaName() {
return namespace.name().tip();
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* 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;
}
代码示例来源:origin: geotools/geotools
final GenericName scope = alias.scope().name();
if (scope != null) {
if (Citations.identifierMatches(authority, scope.toString())) {
代码示例来源:origin: org.apache.sis.core/sis-utility
/**
* Null-safe getter for the namespace argument to be given to {@link #toClass(String, String)}.
*/
static String namespace(final NameSpace ns) {
if (ns != null && !ns.isGlobal()) {
final GenericName name = ns.name();
if (name != null) {
return name.toString();
}
}
return null;
}
代码示例来源:origin: apache/sis
/**
* Null-safe getter for the namespace argument to be given to {@link #toClass(String, String)}.
*/
static String namespace(final NameSpace ns) {
if (ns != null && !ns.isGlobal()) {
final GenericName name = ns.name();
if (name != null) {
return name.toString();
}
}
return null;
}
代码示例来源:origin: geotools/geotools
assertEquals(
"Authority", author, parameters.getName().getAuthority().getTitle().toString());
assertEquals("Vendor", vendor, alias.scope().name().toString());
assertNotNull("Version", parameters.getName().getVersion());
assertLocalized("Vendor", alias.scope().name().toInternationalString());
assertLocalized("Remarks", parameters.getRemarks());
assertTrue("Remarks", parameters.getRemarks().toString().trim().length() > 0);
代码示例来源:origin: apache/sis
/**
* Sets the value from the given name.
*
* @param name the name to marshal.
*/
public final void setName(final GenericName name) {
this.value = name.toString();
final NameSpace scope = name.scope();
if (scope != null && !scope.isGlobal()) {
codeSpace = scope.name().toString();
}
}
代码示例来源:origin: org.apache.sis.core/sis-utility
/**
* Sets the value from the given name.
*
* @param name the name to marshal.
*/
public final void setName(final GenericName name) {
this.value = name.toString();
final NameSpace scope = name.scope();
if (scope != null && !scope.isGlobal()) {
codeSpace = scope.name().toString();
}
}
代码示例来源:origin: apache/sis
/**
* Tests navigation in a name parsed from a string.
*/
@Test
public void testNavigation() {
final GenericName name = factory.parseGenericName(null, "codespace:subspace:name");
assertEquals("codespace:subspace:name", name.toString());
assertEquals("codespace:subspace", name.tip().scope().name().toString());
assertEquals("codespace", name.tip().scope().name().tip().scope().name().toString());
assertSame(name, name.toFullyQualifiedName());
assertSame(name, name.tip().toFullyQualifiedName());
}
内容来源于网络,如有侵权,请联系作者删除!