1 // ======================================================================== 2 // Copyright (c) 2006-2009 Mort Bay Consulting Pty. Ltd. 3 // ------------------------------------------------------------------------ 4 // All rights reserved. This program and the accompanying materials 5 // are made available under the terms of the Eclipse Public License v1.0 6 // and Apache License v2.0 which accompanies this distribution. 7 // The Eclipse Public License is available at 8 // http://www.eclipse.org/legal/epl-v10.html 9 // The Apache License v2.0 is available at 10 // http://www.opensource.org/licenses/apache2.0.php 11 // You may elect to redistribute this code under either of these licenses. 12 // ======================================================================== 13 14 package org.eclipse.jetty.jndi.java; 15 16 import java.util.Properties; 17 18 import javax.naming.CompoundName; 19 import javax.naming.Name; 20 import javax.naming.NameParser; 21 import javax.naming.NamingException; 22 23 24 /** 25 * javaNameParser 26 * 27 */ 28 public class javaNameParser implements NameParser 29 { 30 31 static Properties syntax = new Properties(); 32 33 static 34 { 35 syntax.put("jndi.syntax.direction", "left_to_right"); 36 syntax.put("jndi.syntax.separator", "/"); 37 syntax.put("jndi.syntax.ignorecase", "false"); 38 } 39 40 /** 41 * Parse a name into its components. 42 * @param name The non-null string name to parse. 43 * @return A non-null parsed form of the name using the naming convention 44 * of this parser. 45 * @exception NamingException If a naming exception was encountered. 46 */ 47 public Name parse(String name) throws NamingException 48 { 49 return new CompoundName(name, syntax); 50 } 51 52 }