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.0 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. https://www.apache.org/licenses/LICENSE-2.0
  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. <html lang="en">
  17. <head>
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Componentdef Task</title>
  20. </head>
  21. <body>
  22. <h2 id="componentdef">componentdef</h2>
  23. <h3>Description</h3>
  24. <p>Adds a component definition to the current project. A component definition is the same as
  25. a <a href="typedef.html">typedef</a> except:</p>
  26. <ol>
  27. <li>that it can only be used in other types or tasks that accept components (by having
  28. an <code>add()</code> method).</li>
  29. <li>multiple components may have the same name, provided they implement different interfaces.</li>
  30. </ol>
  31. <p>The purpose of this is to allow internal Apache Ant definitions to be made for tags
  32. like <samp>and</samp> or <samp>or</samp>.</p>
  33. <h3>Examples</h3>
  34. <p>Define two components with the same name <samp>or</samp>; one is a
  35. condition (see <a href="conditions.html">conditions</a>) and one is a
  36. selector (see <a href="../Types/selectors.html">selectors</a>).</p>
  37. <pre>
  38. &lt;componentdef name="or" onerror="ignore"
  39. classname="com.apache.tools.ant.taskdefs.conditions.Or"/&gt;
  40. &lt;componentdef name="or" onerror="ignore"
  41. classname="com.apache.tools.ant.types.resources.selectors.Or"/&gt;</pre>
  42. </body>
  43. </html>