Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ClassPath.java 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Javassist, a Java-bytecode translator toolkit.
  3. * Copyright (C) 1999-2003 Shigeru Chiba. All Rights Reserved.
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. Alternatively, the contents of this file may be used under
  8. * the terms of the GNU Lesser General Public License Version 2.1 or later.
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. */
  15. package javassist;
  16. import java.io.InputStream;
  17. /**
  18. * <code>ClassPath</code> is an interface implemented by objects
  19. * representing a class search path.
  20. * <code>ClassPool</code> uses those objects for reading class files.
  21. *
  22. * <code>The users can define a class implementing this interface so that
  23. * a class file is obtained from a non-standard source.
  24. *
  25. * @see ClassPool#insertClassPath(ClassPath)
  26. * @see ClassPool#appendClassPath(ClassPath)
  27. * @see ClassPool#removeClassPath(ClassPath)
  28. */
  29. public interface ClassPath {
  30. /**
  31. * Opens a class file.
  32. * This method may be called just to examine whether the class file
  33. * exists as well as to read the contents of the file.
  34. *
  35. * <p>This method can return null if the specified class file is not
  36. * found. If null is returned, the next search path is examined.
  37. * However, if an error happens, this method must throw an exception
  38. * so that the search is terminated.
  39. *
  40. * <p>This method should not modify the contents of the class file.
  41. * Use <code>javassist.Translator</code> for modification.
  42. *
  43. * @param classname a fully-qualified class name
  44. * @return the input stream for reading a class file
  45. * @see javassist.Translator
  46. */
  47. InputStream openClassfile(String classname) throws NotFoundException;
  48. /**
  49. * This method is invoked when the <code>ClassPath</code> object is
  50. * detached from the search path. It will be an empty method in most of
  51. * classes.
  52. */
  53. void close();
  54. }