* @param code The code.
* @return A new generic name for the given authority and code.
* @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);
SCOPES.put(title, scope);
}
}
}
final String codeSpace = super.getCodeSpace();
if (codeSpace != null) {
return factory.createGenericName(scope, codeSpace, code);
} else {
return factory.createLocalName(scope, code);
}
}