< prev index next >

src/java.naming/share/classes/javax/naming/CompoundName.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.naming;
  27 
  28 import java.util.Enumeration;
  29 import java.util.Properties;
  30 
  31 /**
  32  * This class represents a compound name -- a name from
  33  * a hierarchical name space.
  34  * Each component in a compound name is an atomic name.
  35  * <p>
  36  * The components of a compound name are numbered.  The indexes of a
  37  * compound name with N components range from 0 up to, but not including, N.
  38  * This range may be written as [0,N).
  39  * The most significant component is at index 0.
  40  * An empty compound name has no components.
  41  *
  42  * <h1>Compound Name Syntax</h1>
  43  * The syntax of a compound name is specified using a set of properties:
  44  *<dl>
  45  *  <dt>jndi.syntax.direction
  46  *  <dd>Direction for parsing ("right_to_left", "left_to_right", "flat").
  47  *      If unspecified, defaults to "flat", which means the namespace is flat
  48  *      with no hierarchical structure.
  49  *
  50  *  <dt>jndi.syntax.separator
  51  *  <dd>Separator between atomic name components.
  52  *      Required unless direction is "flat".
  53  *
  54  *  <dt>jndi.syntax.ignorecase
  55  *  <dd>If present, "true" means ignore the case when comparing name
  56  *      components. If its value is not "true", or if the property is not
  57  *      present, case is considered when comparing name components.
  58  *
  59  *  <dt>jndi.syntax.escape
  60  *  <dd>If present, specifies the escape string for overriding separator,
  61  *      escapes and quotes.
  62  *


 119  * An escaped escape string is not treated as an escape string.
 120  *<li>
 121  * An escape string that does not precede a meta string (quotes or separator)
 122  * and is not at the end of a component is treated as an ordinary string.
 123  *<li>
 124  * A leading separator (the compound name string begins with
 125  * a separator) denotes a leading empty atomic component (consisting
 126  * of an empty string).
 127  * A trailing separator (the compound name string ends with
 128  * a separator) denotes a trailing empty atomic component.
 129  * Adjacent separators denote an empty atomic component.
 130  *</ol>
 131  * <p>
 132  * The string form of the compound name follows the syntax described above.
 133  * When the components of the compound name are turned into their
 134  * string representation, the reserved syntax rules described above are
 135  * applied (e.g. embedded separators are escaped or quoted)
 136  * so that when the same string is parsed, it will yield the same components
 137  * of the original compound name.
 138  *
 139  *<h1>Multithreaded Access</h1>
 140  * A {@code CompoundName} instance is not synchronized against concurrent
 141  * multithreaded access. Multiple threads trying to access and modify a
 142  * {@code CompoundName} should lock the object.
 143  *
 144  * @author Rosanna Lee
 145  * @author Scott Seligman
 146  * @since 1.3
 147  */
 148 
 149 public class CompoundName implements Name {
 150 
 151     /**
 152      * Implementation of this compound name. This field is initialized by the
 153      * constructors and cannot be null.
 154      */
 155     private transient NameImpl impl;
 156     /**
 157       * Syntax properties for this compound name.
 158       * This field is initialized by the constructors and cannot be null.
 159       * It should be treated as a read-only variable by subclasses.


   1 /*
   2  * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.naming;
  27 
  28 import java.util.Enumeration;
  29 import java.util.Properties;
  30 
  31 /**
  32  * This class represents a compound name -- a name from
  33  * a hierarchical name space.
  34  * Each component in a compound name is an atomic name.
  35  * <p>
  36  * The components of a compound name are numbered.  The indexes of a
  37  * compound name with N components range from 0 up to, but not including, N.
  38  * This range may be written as [0,N).
  39  * The most significant component is at index 0.
  40  * An empty compound name has no components.
  41  *
  42  * <h2>Compound Name Syntax</h2>
  43  * The syntax of a compound name is specified using a set of properties:
  44  *<dl>
  45  *  <dt>jndi.syntax.direction
  46  *  <dd>Direction for parsing ("right_to_left", "left_to_right", "flat").
  47  *      If unspecified, defaults to "flat", which means the namespace is flat
  48  *      with no hierarchical structure.
  49  *
  50  *  <dt>jndi.syntax.separator
  51  *  <dd>Separator between atomic name components.
  52  *      Required unless direction is "flat".
  53  *
  54  *  <dt>jndi.syntax.ignorecase
  55  *  <dd>If present, "true" means ignore the case when comparing name
  56  *      components. If its value is not "true", or if the property is not
  57  *      present, case is considered when comparing name components.
  58  *
  59  *  <dt>jndi.syntax.escape
  60  *  <dd>If present, specifies the escape string for overriding separator,
  61  *      escapes and quotes.
  62  *


 119  * An escaped escape string is not treated as an escape string.
 120  *<li>
 121  * An escape string that does not precede a meta string (quotes or separator)
 122  * and is not at the end of a component is treated as an ordinary string.
 123  *<li>
 124  * A leading separator (the compound name string begins with
 125  * a separator) denotes a leading empty atomic component (consisting
 126  * of an empty string).
 127  * A trailing separator (the compound name string ends with
 128  * a separator) denotes a trailing empty atomic component.
 129  * Adjacent separators denote an empty atomic component.
 130  *</ol>
 131  * <p>
 132  * The string form of the compound name follows the syntax described above.
 133  * When the components of the compound name are turned into their
 134  * string representation, the reserved syntax rules described above are
 135  * applied (e.g. embedded separators are escaped or quoted)
 136  * so that when the same string is parsed, it will yield the same components
 137  * of the original compound name.
 138  *
 139  *<h2>Multithreaded Access</h2>
 140  * A {@code CompoundName} instance is not synchronized against concurrent
 141  * multithreaded access. Multiple threads trying to access and modify a
 142  * {@code CompoundName} should lock the object.
 143  *
 144  * @author Rosanna Lee
 145  * @author Scott Seligman
 146  * @since 1.3
 147  */
 148 
 149 public class CompoundName implements Name {
 150 
 151     /**
 152      * Implementation of this compound name. This field is initialized by the
 153      * constructors and cannot be null.
 154      */
 155     private transient NameImpl impl;
 156     /**
 157       * Syntax properties for this compound name.
 158       * This field is initialized by the constructors and cannot be null.
 159       * It should be treated as a read-only variable by subclasses.


< prev index next >