ParserSupports (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.condition, class: ParserSupports

# Class ParserSupports

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ParserSupports

All Implemented Interfaces:
  `Cloneable, Condition`

public class ParserSupports extends ProjectComponent implements Condition
Test for the XML parser supporting a particular feature

Since:
  Ant 1.7

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ERROR_BOTH_ATTRIBUTES`
  error - combined attributes not allowed
  `static final String`
  `ERROR_NO_ATTRIBUTES`
  error - missing attribute
  `static final String`
  `ERROR_NO_VALUE`
  error - no value
  `static final String`
  `FEATURE`
  feature
  `static final String`
  `NOT_RECOGNIZED`
  error - not recognized
  `static final String`
  `NOT_SUPPORTED`
  error - not supported
  `static final String`
  `PROPERTY`
  property

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParserSupports()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `eval()`
  Is this condition true?
  `boolean`
  `evalFeature()`
  Set a feature
  `boolean`
  `evalProperty()`
  Set a property
  `void`
  `setFeature(String feature)`
  Feature to probe for.
  `void`
  `setProperty(String property)`
  Property to probe for
  `void`
  `setValue(String value)`
  Optional value to set.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

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

- ## Field Details

  - ### ERROR_BOTH_ATTRIBUTES

    public static final String ERROR_BOTH_ATTRIBUTES
    error - combined attributes not allowed
    See Also:
      - Constant Field Values

  - ### FEATURE

    public static final String FEATURE
    feature
    See Also:
      - Constant Field Values

  - ### PROPERTY

    public static final String PROPERTY
    property
    See Also:
      - Constant Field Values

  - ### NOT_RECOGNIZED

    public static final String NOT_RECOGNIZED
    error - not recognized
    See Also:
      - Constant Field Values

  - ### NOT_SUPPORTED

    public static final String NOT_SUPPORTED
    error - not supported
    See Also:
      - Constant Field Values

  - ### ERROR_NO_ATTRIBUTES

    public static final String ERROR_NO_ATTRIBUTES
    error - missing attribute
    See Also:
      - Constant Field Values

  - ### ERROR_NO_VALUE

    public static final String ERROR_NO_VALUE
    error - no value
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ParserSupports

    public ParserSupports()

- ## Method Details

  - ### setFeature

    public void setFeature(String feature)
    Feature to probe for.
    Parameters:
      `feature` - the feature to probe for.

  - ### setProperty

    public void setProperty(String property)
    Property to probe for
    Parameters:
      `property` - the property to probe for.

  - ### setValue

    public void setValue(String value)
    Optional value to set. Converted to a boolean value when setting a property
    Parameters:
      `value` - the value to set.

  - ### eval

    public boolean eval() throws BuildException
    Is this condition true?.
    Specified by:
      `eval` in interface `Condition`
    Returns:
      true if the condition is true
    Throws:
      `BuildException` - if an error occurs

  - ### evalFeature

    public boolean evalFeature()
    Set a feature
    Returns:
      true if the feature could be set

  - ### evalProperty

    public boolean evalProperty()
    Set a property
    Returns:
      true if the feature could be set