## org.apache.tools.ant
Class ProjectComponent

    java.lang.Object
      |
      +--org.apache.tools.ant.ProjectComponent

Direct Known Subclasses:
  Commandline.Argument, Concat.TextElement, ConditionBase, DataType, Http, IsFalse, IsReference, IsSet, IsTrue, Javadoc.ExtensionInfo, LineTokenizer, Message, Socket, Task, TokenFilter.ChainableReaderFilter, TokenFilter.ContainsString, TokenFilter.DeleteCharacters, TokenFilter.FileTokenizer, TokenFilter.StringTokenizer

public abstract class ProjectComponent
extends java.lang.Object

Base class for components of a project, including tasks and data types. Provides common facilities.

Author:
  Conor MacNeill

Field Summary
`protected Project` `project` Deprecated. You should not be directly accessing this variable directly. You should access project object via the getProject() or setProject() accessor/mutators.

Constructor Summary
`ProjectComponent()` Sole constructor.

Method Summary
`Project` `getProject()` Returns the project to which this component belongs.
`void` `log(java.lang.String msg)` Logs a message with the default (INFO) priority.
`void` `log(java.lang.String msg, int msgLevel)` Logs a message with the given priority.
`void` `setProject(Project project)` Sets the project object of this component.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### project

    protected Project project

  Deprecated. You should not be directly accessing this variable directly. You should access project object via the getProject() or setProject() accessor/mutators.

  Project object of this component.

Constructor Detail

### ProjectComponent

    public ProjectComponent()

  Sole constructor.

Method Detail

### setProject

    public void setProject(Project project)

  Sets the project object of this component. This method is used by Project when a component is added to it so that the component has access to the functions of the project. It should not be used for any other purpose.

  Parameters:
    `project` - Project in whose scope this component belongs. Must not be `null`.

### getProject

    public Project getProject()

  Returns the project to which this component belongs.

  Returns:
    the components's project.

### log

    public void log(java.lang.String msg)

  Logs a message with the default (INFO) priority.

  Parameters:
    `msg` - The message to be logged. Should not be `null`.

### log

    public void log(java.lang.String msg,
                    int msgLevel)

  Logs a message with the given priority.

  Parameters:
    `msg` - The message to be logged. Should not be `null`.
    `msgLevel` - the message priority at which this message is to be logged.

Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.