net.dpml.tools.info
Class ListenerDirective

java.lang.Object
  extended bynet.dpml.library.info.AbstractDirective
      extended bynet.dpml.tools.info.ListenerDirective
All Implemented Interfaces:
Comparable, Serializable

public final class ListenerDirective
extends AbstractDirective
implements Comparable

The ListenerDirective is an immutable descriptor used to define a build listener to be attached to an Ant project.

Version:
1.0.0
Author:
The Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
ListenerDirective(String name, int priority, URI uri, String classname, Properties properties)
          Creation of a new listener directive.
 
Method Summary
 int compareTo(Object other)
          Compares this ListenerDirective object to another object.
 boolean equals(Object other)
          Compare this object with another for equality.
 String getClassname()
          Get the listener classname.
 String getName()
          Return the listener name.
 int getPriority()
          Return the listener priority.
 URI getURI()
          Return the listener codebase uri.
 String getURISpec()
          Return the listener codebase uri as a string.
 int hashCode()
          Compute the hash value.
 
Methods inherited from class net.dpml.library.info.AbstractDirective
equals, getProperties, getProperty, hashArray, hashValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerDirective

public ListenerDirective(String name,
                         int priority,
                         URI uri,
                         String classname,
                         Properties properties)
                  throws NullPointerException,
                         IllegalStateException
Creation of a new listener directive.

Parameters:
name - the listener name
priority - the listener priority
uri - the listener codebase
classname - optional classname of the plugin instantiation target
properties - supplimentary properties
Throws:
NullPointerException - if name or dependencies are null
IllegalStateException - if both classname and urn values are null
Method Detail

getName

public String getName()
Return the listener name.

Returns:
the listener name

getPriority

public int getPriority()
Return the listener priority.

Returns:
the priority value

getURI

public URI getURI()
Return the listener codebase uri.

Returns:
the urn

getURISpec

public String getURISpec()
Return the listener codebase uri as a string.

Returns:
the uri value

getClassname

public String getClassname()
Get the listener classname.

Returns:
the classname of the listener

compareTo

public int compareTo(Object other)
              throws ClassCastException
Compares this ListenerDirective object to another object. If the object is an ListenerDirective, this function behaves like compareTo(Integer). Otherwise, it throws a ClassCastException.

Specified by:
compareTo in interface Comparable
Parameters:
other - the Object to be compared.
Returns:
the value 0 if the argument is a ListenerDirective with a priority numerically equal to this ListenerDirective; a value less than 0 if the argument is a ListenerDirective numerically greater than this ListenerDirective; and a value greater than 0 if the argument is a ListenerDirective numerically less than this ListenerDirective.
Throws:
ClassCastException - if the argument is not an ListenerDirective.
See Also:
Comparable

equals

public boolean equals(Object other)
Compare this object with another for equality.

Overrides:
equals in class AbstractDirective
Parameters:
other - the other object
Returns:
true if equal

hashCode

public int hashCode()
Compute the hash value.

Overrides:
hashCode in class AbstractDirective
Returns:
the hashcode value