javax.naming
public class NameClassPair extends Object implements Serializable
NameClassPair
represents the name-classname mapping pair
of a binding in a context.
Bindings are mappings of a name to an object and this class is used to specify the mapping of the name to the class type of the bound object. As classname the fully qualified classname is used.
Since: 1.3
Constructor Summary | |
---|---|
NameClassPair(String name, String className)
Constructs an instance with the given name and classname.
| |
NameClassPair(String name, String className, boolean isRelative)
Constructs an instance with the given name and classname and a
flag indicating if the name is relative to the target context.
|
Method Summary | |
---|---|
String | getClassName()
Returns the classname of the binding. |
String | getName()
Returns the name of the binding. |
String | getNameInNamespace()
Returns the full name for this binding. |
boolean | isRelative()
Checks whether the name is relative to the target context or not. |
void | setClassName(String name)
Sets the classname of the bound object. |
void | setName(String name)
Sets the name of the binding. |
void | setNameInNamespace(String fullName)
Sets the full name for this binding. |
void | setRelative(boolean r)
Sets if the name is relative to the target context. |
String | toString()
Returns the string representation. |
Parameters: name the name of the binding relative to the target context
(may not be null
) className the name of the class. If null
the bound
object is also null
Parameters: name the name of the binding (may not be null
) className the name of the class. If null
the bound
object is also null
isRelative flag indicating if the name is relative or not
Returns: The fully qualified classname or null
if the
bound object is null.
Returns: The name.
Returns: The full name in the bindings namespace.
Throws: UnsupportedOperationException if no full name is applicable in the specific naming system.
Since: 1.5
Returns: true
if the name is relative,
false
otherwise.
Parameters: name the classname to set (maybe null
)
Parameters: name the name to set
Parameters: fullName the full name of this binding. If not set or set to
null
the getNameInNamespace()
method will
throw an exception
Since: 1.5
Parameters: r true
to mark as relative
Returns: The string getName() + ":" + getClassName()
.