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

Task.java 1.9 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // ---------------------------------------------------------------------
  2. // (c)2000 Apache Software Foundation
  3. //
  4. // ---------------------------------------------------------------------
  5. package org.apache.ant;
  6. import java.util.*;
  7. /**
  8. * In memory container for an Ant target.
  9. *
  10. * XXX need a way to query which attributes are valid for this particular
  11. * task type... Like into Ant object to do this?
  12. */
  13. public class Task {
  14. // -----------------------------------------------------------------
  15. // PRIVATE DATA MEMBERS
  16. // -----------------------------------------------------------------
  17. /**
  18. *
  19. */
  20. private Hashtable attributes = new Hashtable();
  21. /**
  22. * String containing the type of the task.
  23. */
  24. private String type;
  25. // -----------------------------------------------------------------
  26. // CONSTRUCTORS
  27. // -----------------------------------------------------------------
  28. /**
  29. * Constructs a new Target object with the given name.
  30. */
  31. public Task(String type) {
  32. this.type = type;
  33. }
  34. // -----------------------------------------------------------------
  35. // PUBLIC ACCESSOR METHODS
  36. // -----------------------------------------------------------------
  37. /**
  38. *
  39. */
  40. public void addAttribute(String name, String value) {
  41. attributes.put(name, value);
  42. }
  43. public String getAttribute(String name) {
  44. return (String)attributes.get(name);
  45. }
  46. /**
  47. *
  48. */
  49. public Hashtable getAttributes() {
  50. return attributes;
  51. }
  52. /**
  53. *
  54. */
  55. public Enumeration getAttributeNames() {
  56. return attributes.keys();
  57. }
  58. /**
  59. * Returns a String containing the name of this Target.
  60. */
  61. public String getType() {
  62. return type;
  63. }
  64. /**
  65. *
  66. */
  67. public String toString() {
  68. return "TASK: " + type;
  69. }
  70. }