Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

IHierarchy.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Mik Kersten initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.asm;
  13. import java.io.Serializable;
  14. import java.util.*;
  15. import org.aspectj.asm.internal.ProgramElement;
  16. import org.aspectj.bridge.ISourceLocation;
  17. /**
  18. * @author Mik Kersten
  19. */
  20. public interface IHierarchy extends Serializable {
  21. public static final IProgramElement NO_STRUCTURE =
  22. new ProgramElement(
  23. "<build to view structure>",
  24. IProgramElement.Kind.ERROR,
  25. null);
  26. public IProgramElement getElement(String handle);
  27. public IProgramElement getRoot();
  28. public void setRoot(IProgramElement root);
  29. public void addToFileMap(Object key, Object value);
  30. public boolean removeFromFileMap(Object key);
  31. public void setFileMap(HashMap fileMap);
  32. public Object findInFileMap(Object key);
  33. public Set getFileMapEntrySet();
  34. public boolean isValid();
  35. /**
  36. * @return null if not found
  37. */
  38. public IProgramElement findElementForHandle(String handle);
  39. /**
  40. * Returns the first match
  41. *
  42. * @param parent
  43. * @param kind not null
  44. * @return null if not found
  45. */
  46. public IProgramElement findElementForSignature(
  47. IProgramElement parent,
  48. IProgramElement.Kind kind,
  49. String signature);
  50. /**
  51. * Returns the first match
  52. *
  53. * @param parent
  54. * @param kind not null
  55. * @return null if not found
  56. */
  57. public IProgramElement findElementForLabel(
  58. IProgramElement parent,
  59. IProgramElement.Kind kind,
  60. String label);
  61. /**
  62. * @param packageName if null default package is searched
  63. * @param className can't be null
  64. */
  65. public IProgramElement findElementForType(String packageName, String typeName);
  66. /**
  67. * @param sourceFilePath modified to '/' delimited path for consistency
  68. * @return a new structure node for the file if it was not found in the model
  69. */
  70. public IProgramElement findElementForSourceFile(String sourceFile);
  71. /**
  72. * TODO: discriminate columns
  73. */
  74. public IProgramElement findElementForSourceLine(ISourceLocation location);
  75. /**
  76. * Never returns null
  77. *
  78. * @param sourceFilePath canonicalized path for consistency
  79. * @param lineNumber if 0 or 1 the corresponding file node will be returned
  80. * @return a new structure node for the file if it was not found in the model
  81. */
  82. public IProgramElement findElementForSourceLine(String sourceFilePath, int lineNumber);
  83. public IProgramElement findElementForOffSet(String sourceFilePath, int lineNumber, int offSet);
  84. public String getConfigFile();
  85. public void setConfigFile(String configFile);
  86. public void flushTypeMap();
  87. public void flushHandleMap();
  88. public void updateHandleMap(Set deletedFiles);
  89. public void setNameConvertor(INameConvertor convertor);
  90. public INameConvertor getNameConvertor();
  91. }