1 28 29 package com.caucho.naming; 30 31 import javax.naming.Name ; 32 import javax.naming.NameParser ; 33 import javax.naming.NamingException ; 34 35 public class QNameParser implements NameParser { 36 private ContextImpl context; 37 38 QNameParser(ContextImpl context) 39 { 40 this.context = context; 41 } 42 43 public Name parse(String name) 44 throws NamingException 45 { 46 Name parsedName = new QName(context); 47 48 for (; name != null && ! name.equals(""); name = context.parseRest(name)) { 49 String first = context.parseFirst(name); 50 51 if (first == null) 52 return parsedName; 53 54 parsedName.add(first); 55 } 56 57 return parsedName; 58 } 59 } 60 | Popular Tags |