KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > core > Naming


1 /*
2   Copyright (C) 2001-2003 Renaud Pawlak <renaud@aopsys.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.core;
20
21 /**
22  * This class implements useful static methods to manipulate JAC objects
23  * and names.
24  *
25  * @see NameRepository
26  * @see org.objectweb.jac.aspects.naming.NamingAC
27  */

28
29 public class Naming {
30
31     public static String JavaDoc FORCE_NAME="Naming.FORCE_NAME";
32
33     /**
34      * Sets the name of the next created object within the current
35      * thread. */

36     public static void setName(String JavaDoc name) {
37         Collaboration.get().addAttribute(FORCE_NAME, name);
38     }
39
40     /**
41      * Returns the JAC name of a JAC object.
42      *
43      * <p>Equivalent to <code>NameRepository.get().getName(object)</code>.
44      *
45      * @see NameRepository#getName(Object) */

46     public static String JavaDoc getName(Object JavaDoc object) {
47         return NameRepository.get().getName(object);
48     }
49
50     /**
51      * Returns the JAC object named name.
52      *
53      * <p>Equivalent to <code>NameRepository.get().getObject(name)</code>.
54      *
55      * @see NameRepository#getObject(String) */

56     public static Object JavaDoc getObject(String JavaDoc name) {
57         return NameRepository.get().getObject(name);
58     }
59
60     /** Name of configuration file parser */
61     public static final String JavaDoc PARSER_NAME = "parserimpl#0";
62 }
63
Popular Tags