KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > spice > jndikit > DefaultNameParser


1 /*
2  * Copyright (C) The Spice Group. All rights reserved.
3  *
4  * This software is published under the terms of the Spice
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.spice.jndikit;
9
10 import java.io.Serializable JavaDoc;
11 import java.util.Properties JavaDoc;
12 import javax.naming.CompoundName JavaDoc;
13 import javax.naming.Name JavaDoc;
14 import javax.naming.NameParser JavaDoc;
15 import javax.naming.NamingException JavaDoc;
16
17 /**
18  * A simple cas sensitive name parser that reads left
19  * to right with '/' as separator.
20  *
21  * @author Peter Donald
22  * @version $Revision: 1.1 $ $Date: 2003/11/27 00:50:47 $
23  */

24 public class DefaultNameParser
25     implements Serializable JavaDoc, NameParser JavaDoc
26 {
27     private static Properties JavaDoc c_syntax = new Properties JavaDoc();
28
29     static
30     {
31         c_syntax.put( "jndi.syntax.direction", "left_to_right" );
32         c_syntax.put( "jndi.syntax.ignorecase", "false" );
33         c_syntax.put( "jndi.syntax.separator", "/" );
34     }
35
36     public Name JavaDoc parse( final String JavaDoc name )
37         throws NamingException JavaDoc
38     {
39         return new CompoundName JavaDoc( name, c_syntax );
40     }
41 }
42
Popular Tags