/*
* @(#)CompositeName.java 1.15 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.naming;
import java.util.Enumeration;
import java.util.Properties;
/**
* This class represents a composite name -- a sequence of
* component names spanning multiple namespaces.
* Each component is a string name from the namespace of a
* naming system. If the component comes from a hierarchical
* namespace, that component can be further parsed into
* its atomic parts by using the CompoundName class.
*<p>
* The components of a composite name are numbered. The indexes of a
* composite name with N components range from 0 up to, but not including, N.
* This range may be written as [0,N).
* The most significant component is at index 0.
* An empty composite name has no components.
*<p>
* <h4>JNDI Composite Name Syntax</h4>
* JNDI defines a standard string representation for composite names. This
* representation is the concatenation of the components of a composite name
* from left to right using the component separator (a forward
* slash character (/)) to separate each component.
* The JNDI syntax defines the following meta characters:
* <ul>
* <li>escape (backward slash \),
* <li>quote characters (single (') and double quotes (")), and
* <li>component separator (forward slash character (/)).
* </ul>
* Any occurrence of a leading quote, an escape preceding any meta character,
* an escape at the end of a component, or a component separator character
* in an unquoted component must be preceded by an escape character when
* that component is being composed into a composite name string.
* Alternatively, to avoid adding escape characters as described,
* the entire component can be quoted using matching single quotes
* or matching double quotes. A single quote occurring within a double-quoted
* component is not considered a meta character (and need not be escaped),
* and vice versa.
*<p>
* When two composite names are compared, the case of the characters
* is significant.
*<p>
* A leading component separator (the composite name string begins with
* a separator) denotes a leading empty component (a component consisting
* of an empty string).
* A trailing component separator (the composite name string ends with
* a separator) denotes a trailing empty component.
* Adjacent component separators denote an empty component.
*<p>
*<h4>Composite Name Examples</h4>
*This table shows examples of some composite names. Each row shows
*the string form of a composite name and its corresponding structural form
*(<tt>CompositeName</tt>).
*<p>
<table border="1" cellpadding=3 width="70%" summary="examples showing string form of composite name and its corresponding
structural form (CompositeName)">
<tr>
<th>String Name</th>
<th>CompositeName</th>
</tr>
<tr>
<td>
""
</td>
<td>{} (the empty name == new CompositeName("") == new CompositeName())
</td>
</tr>
<tr>
<td>
"x"
</td>
<td>{"x"}
</td>
</tr>
<tr>
<td>
"x/y"
</td>
<td>{"x", "y"}</td>
</tr>
<tr>
<td>"x/"</td>
<td>{"x", ""}</td>
</tr>
<tr>
<td>"/x"</td>
<td>{"", "x"}</td>
=1= |