1. /*
  2. * @(#)NameParser.java 1.8 04/05/05
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.naming;
  8. /**
  9. * This interface is used for parsing names from a hierarchical
  10. * namespace. The NameParser contains knowledge of the syntactic
  11. * information (like left-to-right orientation, name separator, etc.)
  12. * needed to parse names.
  13. *
  14. * The equals() method, when used to compare two NameParsers, returns
  15. * true if and only if they serve the same namespace.
  16. *
  17. * @author Rosanna Lee
  18. * @author Scott Seligman
  19. * @version 1.8 04/05/05
  20. *
  21. * @see CompoundName
  22. * @see Name
  23. * @since 1.3
  24. */
  25. public interface NameParser {
  26. /**
  27. * Parses a name into its components.
  28. *
  29. * @param name The non-null string name to parse.
  30. * @return A non-null parsed form of the name using the naming convention
  31. * of this parser.
  32. * @exception InvalidNameException If name does not conform to
  33. * syntax defined for the namespace.
  34. * @exception NamingException If a naming exception was encountered.
  35. */
  36. Name parse(String name) throws NamingException;
  37. }