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.

componentdef.html 2.1 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Componentdef Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="componentdef">componentdef</a></h2>
  23. <h3>Description</h3>
  24. <p>
  25. Adds a component definition to the current project.
  26. A compenent definition is the same as a
  27. <a href="typedef.html">typedef</a> except:
  28. </p>
  29. <ol>
  30. <li>
  31. that it can only be used in other types or tasks that
  32. accept components (by having an <i>add()</i> method).
  33. </li>
  34. <li>
  35. multiple components may have the same name, provided they
  36. implement different interfaces.
  37. </li>
  38. </ol>
  39. <p>
  40. The purpose of this is to allow internal Ant definitions to be
  41. made for tags like "and" or "or".
  42. </p>
  43. <h3>Examples</h3>
  44. <pre> &lt;componentdef name="or" onerror="ignore"
  45. classname="com.apache.tools.ant.taskdefs.conditions.Or"/&gt;
  46. &lt;componentdef name="or" onerror="ignore"
  47. classname="com.apache.tools.ant.types.resources.selectors.Or"/&gt;</pre>
  48. <p>
  49. defines two components with the same name "or"; one is a condition
  50. (see <a href="conditions.html">conditions</a>) and one is
  51. a selector (see <a href="../CoreTypes/selectors.html">selectors</a>).
  52. </p>
  53. </body>
  54. </html>