1. /*
  2. * Copyright 2001-2002,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs.optional.ide;
  18. import org.apache.tools.ant.BuildException;
  19. /**
  20. * Type class. Holds information about a project edition.
  21. */
  22. public class VAJProjectDescription {
  23. private String name;
  24. private String version;
  25. private boolean projectFound;
  26. public VAJProjectDescription() {
  27. }
  28. public VAJProjectDescription(String n, String v) {
  29. name = n;
  30. version = v;
  31. }
  32. public String getName() {
  33. return name;
  34. }
  35. public String getVersion() {
  36. return version;
  37. }
  38. public boolean projectFound() {
  39. return projectFound;
  40. }
  41. /**
  42. * name of the VAJ project to load into
  43. * the workspace; required
  44. */
  45. public void setName(String newName) {
  46. if (newName == null || newName.equals("")) {
  47. throw new BuildException("name attribute must be set");
  48. }
  49. name = newName;
  50. }
  51. /**
  52. * name of the requested version; required.
  53. */
  54. public void setVersion(String newVersion) {
  55. if (newVersion == null || newVersion.equals("")) {
  56. throw new BuildException("version attribute must be set");
  57. }
  58. version = newVersion;
  59. }
  60. /**
  61. * this may be a helper method, and is being ignored for now
  62. * @ant.attribute ignore="true"
  63. */
  64. public void setProjectFound() {
  65. projectFound = true;
  66. }
  67. }