|
Java example source code file (NameClassPair.java)
The NameClassPair.java Java example source code
/*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.naming;
/**
* This class represents the object name and class name pair of a binding
* found in a context.
*<p>
* 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.
*<p>
* Use subclassing for naming systems that generate contents of
* a name/class pair dynamically.
*<p>
* 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.
*
* @author Rosanna Lee
* @author Scott Seligman
*
* @see Context#list
* @since 1.3
*/
/*
* <p>
* The serialized form of a NameClassPair object consists of the name (a
* String), class name (a String), and isRelative flag (a boolean).
*/
public class NameClassPair implements java.io.Serializable {
/**
* Contains the name of this NameClassPair.
* It is initialized by the constructor and can be updated using
* <tt>setName().
* @serial
* @see #getName
* @see #setName
*/
private String name;
/**
*Contains the class name contained in this NameClassPair.
* It is initialized by the constructor and can be updated using
* <tt>setClassName().
* @serial
* @see #getClassName
* @see #setClassName
*/
private String className;
/**
* Contains the full name of this NameClassPair within its
* own namespace.
* It is initialized using <tt>setNameInNamespace()
* @serial
* @see #getNameInNamespace
* @see #setNameInNamespace
*/
private String fullName = null;
/**
* Records whether the name of this <tt>NameClassPair
* is relative to the target context.
* It is initialized by the constructor and can be updated using
* <tt>setRelative().
* @serial
* @see #isRelative
* @see #setRelative
* @see #getName
* @see #setName
*/
private boolean isRel = true;
/**
* Constructs an instance of a NameClassPair given its
* name and class name.
*
* @param name The non-null name of the object. It is relative
* to the <em>target context (which is
* named by the first parameter of the <code>list() method)
* @param className The possibly null class name of the object
* bound to name. It is null if the object bound is null.
* @see #getClassName
* @see #setClassName
* @see #getName
* @see #setName
*/
public NameClassPair(String name, String className) {
this.name = name;
this.className = className;
}
/**
* Constructs an instance of a NameClassPair given its
* name, class name, and whether it is relative to the listing context.
*
* @param name The non-null name of the object.
* @param className The possibly null class name of the object
* bound to name. It is null if the object bound is null.
* @param isRelative true if <code>name is a name relative
* to the target context (which is named by the first parameter
* of the <code>list() method); false if
Other Java examples (source code examples)Here is a short list of links related to this Java NameClassPair.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.