/plugins/CtagsSideKick/tags/release-1_4/ctags/sidekick/mappers/KindTreeMapper.java

# · Java · 44 lines · 22 code · 5 blank · 17 comment · 3 complexity · 37e0ad419f8dcff23b9d9fa79cac892c MD5 · raw file

  1. /*
  2. Copyright (C) 2006 Shlomy Reinstein
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  14. */
  15. package ctags.sidekick.mappers;
  16. import java.util.Vector;
  17. import ctags.sidekick.IObjectProcessor;
  18. import ctags.sidekick.Tag;
  19. public class KindTreeMapper extends AbstractTreeMapper {
  20. private static final String NAME = "Kind";
  21. private static final String DESCRIPTION =
  22. "Adds the tag kind to the tree path.";
  23. public KindTreeMapper() {
  24. super(NAME, DESCRIPTION);
  25. }
  26. public Vector<Object> getPath(Tag tag) {
  27. Vector<Object> path = new Vector<Object>();
  28. String kind = tag.getKind();
  29. if (kind != null && kind.length() > 0)
  30. path.add(kind);
  31. return path;
  32. }
  33. public IObjectProcessor getClone() {
  34. return new KindTreeMapper();
  35. }
  36. }