|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.naming.NameClassPair
This class represents the object name and class name pair of a binding found in a context.
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.
Context.list(javax.naming.Name)
, Serialized FormConstructor Summary | |
NameClassPair(String name,
String className)
Constructs an instance of a NameClassPair given its name and class name. |
|
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. |
Method Summary | |
String |
getClassName()
Retrieves the class name of the object bound to the name of this binding. |
String |
getName()
Retrieves the name of this binding. |
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). |
void |
setClassName(String name)
Sets the class name of this binding. |
void |
setName(String name)
Sets the name of this binding. |
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). |
String |
toString()
Generates the string representation of this name/class pair. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NameClassPair(String name, String className)
name
- The non-null 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. It is null if the object bound is null.getClassName()
,
setClassName(java.lang.String)
,
getName()
,
setName(java.lang.String)
public NameClassPair(String name, String className, boolean isRelative)
name
- The non-null name of the object.className
- The possibly null class name of the object
bound to name. It is null if the object bound is null.isRelative
- true if name
is a 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()
,
setClassName(java.lang.String)
,
getName()
,
setName(java.lang.String)
,
isRelative()
,
setRelative(boolean)
Method Detail |
public String getClassName()
Binding.getObject()
,
Binding.getClassName()
,
setClassName(java.lang.String)
public String getName()
isRelative()
,
setName(java.lang.String)
public void setName(String name)
name
- the non-null string to use as the name.getName()
,
setRelative(boolean)
public void setClassName(String name)
name
- the possibly null string to use as the class name.
If null, Binding.getClassName() will return
the actual class name of the object in the binding.
The class name will be null if the object bound is null.getClassName()
,
Binding.getClassName()
public boolean isRelative()
list()
method).setRelative(boolean)
,
getName()
public void setRelative(boolean r)
list()
method).r
- If true, the name of binding is relative to the target context;
if false, the name of binding is a URL string.isRelative()
,
setName(java.lang.String)
public String toString()
toString
in class Object
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.