/*
* @(#)CompoundName.java 1.12 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 compound name -- a name from
* a hierarchical name space.
* Each component in a compound name is an atomic name.
* <p>
* The components of a compound name are numbered. The indexes of a
* compound 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 compound name has no components.
*<p>
* <h4>Compound Name Syntax</h4>
* The syntax of a compound name is specified using a set of properties:
*<dl>
* <dt>jndi.syntax.direction
* <dd>Direction for parsing ("right_to_left", "left_to_right", "flat").
* If unspecified, defaults to "flat", which means the namespace is flat
* with no hierarchical structure.
*
* <dt>jndi.syntax.separator
* <dd>Separator between atomic name components.
* Required unless direction is "flat".
*
* <dt>jndi.syntax.ignorecase
* <dd>If present, "true" means ignore the case when comparing name
* components. If its value is not "true", or if the property is not
* present, case is considered when comparing name components.
*
* <dt>jndi.syntax.escape
* <dd>If present, specifies the escape string for overriding separator,
* escapes and quotes.
*
* <dt>jndi.syntax.beginquote
* <dd>If present, specifies the string delimiting start of a quoted string.
*
* <dt>jndi.syntax.endquote
* <dd>String delimiting end of quoted string.
* If present, specifies the string delimiting the end of a quoted string.
* If not present, use syntax.beginquote as end quote.
* <dt>jndi.syntax.beginquote2
* <dd>Alternative set of begin/end quotes.
*
* <dt>jndi.syntax.endquote2
* <dd>Alternative set of begin/end quotes.
*
* <dt>jndi.syntax.trimblanks
* <dd>If present, "true" means trim any leading and trailing whitespaces
* in a name component for comparison purposes. If its value is not
* "true", or if the property is not present, blanks are significant.
* <dt>jndi.syntax.separator.ava
* <dd>If present, specifies the string that separates
* attribute-value-assertions when specifying multiple attribute/value
* pairs. (e.g. "," in age=65,gender=male).
* <dt>jndi.syntax.separator.typeval
* <dd>If present, specifies the string that separators attribute
* from value (e.g. "=" in "age=65")
*</dl>
* These properties are interpreted according to the following rules:
*<ol>
*<li>
* In a string without quotes or escapes, any instance of the
* separator delimits two atomic names. Each atomic name is referred
* to as a <em>component</em>.
*<li>
* A separator, quote or escape is escaped if preceded immediately
* (on the left) by the escape.
*<li>
* If there are two sets of quotes, a specific begin-quote must be matched
* by its corresponding end-quote.
*<li>
* A non-escaped begin-quote which precedes a component must be
* matched by a non-escaped end-quote at the end of the component.
* A component thus quoted is referred to as a
* <em>quoted component</em>. It is parsed by
* removing the being- and end- quotes, and by treating the intervening
* characters as ordinary characters unless one of the rules involving
* quoted components listed below applies.
*<li>
* Quotes embedded in non-quoted components are treated as ordinary strings
* and need not be matched.
*<li>
* A separator that is escaped or appears between non-escaped
* quotes is treated as an ordinary string and not a separator.
*<li>
* An escape string within a quoted component acts as an escape only when
* followed by the corresponding end-quote string.
* This can be used to embed an escaped quote within a quoted component.
*<li>
=1= |