1. /*
  2. * Copyright 2003-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;
  18. /**
  19. * Used to wrap types.
  20. *
  21. */
  22. public interface TypeAdapter {
  23. /**
  24. * Sets the project
  25. *
  26. * @param p the project instance.
  27. */
  28. void setProject(Project p);
  29. /**
  30. * Gets the project
  31. *
  32. * @return the project instance.
  33. */
  34. Project getProject();
  35. /**
  36. * Sets the proxy object, whose methods are going to be
  37. * invoked by ant.
  38. * A proxy object is normally the object defined by
  39. * a <typedef/> task that is adapted by the "adapter"
  40. * attribute.
  41. *
  42. * @param o The target object. Must not be <code>null</code>.
  43. */
  44. void setProxy(Object o);
  45. /**
  46. * Returns the proxy object.
  47. *
  48. * @return the target proxy object
  49. */
  50. Object getProxy();
  51. /**
  52. * Check if the proxy class is compatible with this adapter - i.e.
  53. * the adapter will be able to adapt instances of the give class.
  54. *
  55. * @param proxyClass the class to be checked.
  56. */
  57. void checkProxyClass(Class proxyClass);
  58. }