/** * Infers the authority from the scope if any, or from the code space otherwise. * * @return the authority, or {@code null} if none. */ @Override public Citation getAuthority() { GenericName scope = scope(name); if (scope == null) { scope = scope(name.tip()); if (scope == null) { return null; } } return Citations.fromName(scope.head().toString()); }
/** * Infers the authority from the scope if any, or from the code space otherwise. * * @return the authority, or {@code null} if none. */ @Override public Citation getAuthority() { GenericName scope = scope(name); if (scope == null) { scope = scope(name.tip()); if (scope == null) { return null; } } return Citations.fromName(scope.head().toString()); }
/** * Takes the element before the tip as the code space. * * @param name the name from which to get the code space, or {@code null}. * @param locale the locale, or {@code null} for a call to {@code name.toString()}. * @return the code space, or {@code null} if none. */ public static String getCodeSpace(final GenericName name, final Locale locale) { final GenericName scope = scope(name.tip()); return (scope != null) ? toString(scope.tip(), locale) : null; }
/** * Takes the element before the tip as the code space. * * @param name the name from which to get the code space, or {@code null}. * @param locale the locale, or {@code null} for a call to {@code name.toString()}. * @return the code space, or {@code null} if none. */ public static String getCodeSpace(final GenericName name, final Locale locale) { final GenericName scope = scope(name.tip()); return (scope != null) ? toString(scope.tip(), locale) : null; }