BaseIfAttribute (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.attribute, class: BaseIfAttribute

Package org.apache.tools.ant.attribute

# Class BaseIfAttribute

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.attribute.BaseIfAttribute

All Implemented Interfaces:
  `Cloneable`, `EnableAttribute`

Direct Known Subclasses:
  `IfBlankAttribute`, `IfSetAttribute`, `IfTrueAttribute`

public abstract class BaseIfAttribute extends ProjectComponent implements EnableAttribute
An abstract class for if/unless attributes. This contains a boolean flag to specify whether this is an if or unless attribute.

Since:
  Ant 1.9.1

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseIfAttribute()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `convertResult(boolean val)`
  convert the result.
  `protected Map<String,String>`
  `getParams(UnknownElement el)`
  Get all the attributes in the ant-attribute:param namespace and place them in a map.
  `protected boolean`
  `isPositive()`
  Get the positive flag.
  `protected void`
  `setPositive(boolean positive)`
  Set the positive flag.

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.tools.ant.attribute.EnableAttribute

  `isEnabled`

- ## Constructor Details

  - ### BaseIfAttribute

    public BaseIfAttribute()

- ## Method Details

  - ### setPositive

    protected void setPositive(boolean positive)
    Set the positive flag.
    Parameters:
      `positive` - the value to use.

  - ### isPositive

    protected boolean isPositive()
    Get the positive flag.
    Returns:
      the flag.

  - ### convertResult

    protected boolean convertResult(boolean val)
    convert the result.
    Parameters:
      `val` - the result to convert
    Returns:
      val if positive or !val if not.

  - ### getParams

    protected Map<String,String> getParams(UnknownElement el)
    Get all the attributes in the ant-attribute:param namespace and place them in a map.
    Parameters:
      `el` - the element this attribute is in.
    Returns:
      a map of attributes.