Lines Matching refs:name

69      * @serial  The non-localized name of the level.
71 private final String name;
79 * @serial The resource bundle name to be used in localizing the level name.
83 // localized level name
185 * @param name the name of the Level, for example "SEVERE".
187 * @throws NullPointerException if the name is null
189 protected Level(String name, int value) {
190 this(name, value, null);
195 * given localization resource name.
197 * @param name the name of the Level, for example "SEVERE".
199 * @param resourceBundleName name of a resource bundle to use in
200 * localizing the given name. If the resourceBundleName is null
202 * @throws NullPointerException if the name is null
204 protected Level(String name, int value, String resourceBundleName) {
205 if (name == null) {
208 this.name = name;
211 this.localizedLevelName = resourceBundleName == null ? name : null;
216 * Return the level's localization resource bundle name, or
219 * @return localization resource bundle name
226 * Return the non-localized string name of the Level.
228 * @return non-localized name
231 return name;
235 * Return the localized string name of the Level, for
239 * non-localized name is returned.
241 * @return localized name
250 return this.name;
260 localizedLevelName = rb.getString(name);
262 localizedLevelName = name;
267 // Returns a mirrored Level object that matches the given name as
271 // method if the given name is a non-localized name or integer.
273 // If the name is a localized name, findLevel and parse method may
278 static Level findLevel(String name) {
279 if (name == null) {
285 // Look for a known Level with the given non-localized name.
286 level = KnownLevel.findByName(name);
291 // Now, check if the given name is an integer. If so,
295 int x = Integer.parseInt(name);
299 Level levelObject = new Level(name, x);
308 level = KnownLevel.findByLocalizedLevelName(name);
319 * @return the non-localized name of the Level, for example "INFO".
322 return name;
347 Level level = new Level(this.name, this.value, this.resourceBundleName);
352 * Parse a level name string into a Level.
354 * The argument string may consist of either a level name
363 * @param name string to be parsed
364 * @throws NullPointerException if the name is null
373 * @return The parsed value. Passing an integer that corresponds to a known name
374 * (e.g., 700) will return the associated name (e.g., <CODE>CONFIG</CODE>).
375 * Passing an integer that does not (e.g., 1) will return a new level name
378 public static synchronized Level parse(String name) throws IllegalArgumentException {
379 // Check that name is not null.
380 name.length();
384 // Look for a known Level with the given non-localized name.
385 level = KnownLevel.findByName(name);
390 // Now, check if the given name is an integer. If so,
394 int x = Integer.parseInt(name);
398 Level levelObject = new Level(name, x);
407 // Finally, look for a known level with the given localized name,
410 level = KnownLevel.findByLocalizedName(name);
416 throw new IllegalArgumentException("Bad level \"" + name + "\"");
441 // The API allows multiple custom Level instances of the same name/value
443 // by a given name, by a given value, or by a given localized name.
451 // are non-final but the name and resource bundle name are parameters to
470 this.mirroredLevel = new Level(l.name, l.value, l.resourceBundleName);
478 List<KnownLevel> list = nameToLevels.get(l.name);
481 nameToLevels.put(l.name, list);
493 // Returns a KnownLevel with the given non-localized name.
494 static synchronized KnownLevel findByName(String name) {
495 List<KnownLevel> list = nameToLevels.get(name);
511 // Returns a KnownLevel with the given localized name matching
516 static synchronized KnownLevel findByLocalizedLevelName(String name) {
520 if (name.equals(lname)) {
528 // Returns a KnownLevel with the given localized name matching
530 static synchronized KnownLevel findByLocalizedName(String name) {
534 if (name.equals(lname)) {
543 List<KnownLevel> list = nameToLevels.get(l.name);