All Packages Class Hierarchy This Package Previous Next Index
Class javax.naming.NameClassPair
java.lang.Object
|
+----javax.naming.NameClassPair
- public class NameClassPair
- extends Object
- implements Serializable
A context consists of name-to-object bindings.
The NameClassPair class represents the name and the
class of the bound object. It consists
of a name and a string representing the
package-qualified class name.
Use subclassing for naming systems that generate contents of
a name/class pair dynamically.
A NameClassPair instance is not synchronized against concurrent
access by multiple threads. Threads that need to access a NameClassPair
concurrently should synchronize amongst themselves and provide
the necessary locking.
The serialized form of a NameClassPair object consists of the name (a
String), class name (a String), and isRelative flag (a boolean).
- See Also:
- list
-
NameClassPair(String, String)
- Constructs an instance of a NameClassPair given its
name and class name.
-
NameClassPair(String, String, boolean)
- Constructs an instance of a NameClassPair given its
name, class name, and whether it is relative to the listing context.
-
getClassName()
- Retrieves the class name of the object bound to the name of this binding.
-
getName()
- Retrieves the name of this binding.
-
isRelative()
- Determines whether the name of this binding is
relative to the target context (which is named by
the first parameter of the
list()
method).
-
setName(String)
- Sets the name of this binding.
-
setRelative(boolean)
- Sets whether the name of this binding is relative to the target
context (which is named by the first parameter of the
list()
method).
-
toString()
- Generates the string representation of this name/class pair.
NameClassPair
public NameClassPair(String name,
String className)
- Constructs an instance of a NameClassPair given its
name and class name.
- Parameters:
- name - The non-null atomic name of the object. It is relative
to the target context (which is
named by the first parameter of the
list()
method)
- className - The possibly null class name of the object bound to name.
NameClassPair
public NameClassPair(String name,
String className,
boolean isRelative)
- Constructs an instance of a NameClassPair given its
name, class name, and whether it is relative to the listing context.
- Parameters:
- name - The non-null name of the object.
- className - The possibly null class name of the object bound to name.
- isRelative - true if
name
is an atomic name relative
to the target context (which is named by
the first parameter of the list()
method);
false if name
is a URL string.
getClassName
public String getClassName()
- Retrieves the class name of the object bound to the name of this binding.
If a reference or some other indirect information is bound,
return the class name of the object of the eventual object that
will be returned by Binding.getObject().
- Returns:
- The possibly null class name of object bound.
- See Also:
- getClassName, getObject
getName
public String getName()
- Retrieves the name of this binding.
If isRelative() is true, this name is relative to the target context
(which is named by the first parameter of the list()). If isRelative()
is false, this name is a URL string.
- Returns:
- The non-null name of this binding.
- See Also:
- isRelative
setName
public void setName(String name)
- Sets the name of this binding.
- Parameters:
- The - non-null string to use as the name.
- See Also:
- setRelative
isRelative
public boolean isRelative()
- Determines whether the name of this binding is
relative to the target context (which is named by
the first parameter of the
list()
method).
- Returns:
- true if the name of this binding is relative to the target context;
false if the name of this binding is a URL string.
setRelative
public void setRelative(boolean r)
- Sets whether the name of this binding is relative to the target
context (which is named by the first parameter of the
list()
method).
- Parameters:
- r - If true, the name of binding is relative to the target context;
if false, the name of binding is a URL string.
toString
public String toString()
- Generates the string representation of this name/class pair.
The string representation consists of the name and class name separated
by a colon (':').
The contents of this string is useful
for debugging and is not meant to be interpreted programmatically.
- Returns:
- The string representation of this name/class pair.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index