You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IElementHandleProvider.java 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* *******************************************************************
  2. * Copyright (c) 2003 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * Mik Kersten initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.asm;
  13. import java.io.File;
  14. import org.aspectj.bridge.ISourceLocation;
  15. /**
  16. * Adapter used to uniquely identify program element handles. Can be implemented and overridden in @see{AsmManager} in order to
  17. * provide IDE-specific mechanisms of identifying elements. For example, AJDT uses workspace-relative paths that are understood by
  18. * its JavaCore class.
  19. *
  20. * @author Mik Kersten
  21. */
  22. public interface IElementHandleProvider {
  23. /**
  24. * @return a String uniquely identifying this element
  25. */
  26. String createHandleIdentifier(ISourceLocation location);
  27. /**
  28. * @return a String uniquely identifying this element
  29. */
  30. String createHandleIdentifier(File sourceFile, int line, int column, int offset);
  31. /**
  32. * @return a String uniquely identifying this element
  33. */
  34. String createHandleIdentifier(IProgramElement ipe);
  35. /**
  36. * NOTE: this is necessary for the current implementation to look up nodes, but we may want to consider removing it.
  37. *
  38. * @return a String corresponding to the
  39. */
  40. String getFileForHandle(String handle);
  41. /**
  42. * NOTE: this is necessary for the current implementation to look up nodes, but we may want to consider removing it.
  43. *
  44. * @return the line number corresponding to this handel
  45. */
  46. int getLineNumberForHandle(String handle);
  47. int getOffSetForHandle(String handle);
  48. /**
  49. * Initializes handle provider state.
  50. *
  51. * The initializer is invoked when a new ASM is created on a full build.
  52. */
  53. void initialize();
  54. }