net.dpml.metro.data
Class CategoryDirective

java.lang.Object
  extended by net.dpml.metro.data.AbstractDirective
      extended by net.dpml.metro.data.CategoryDirective
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CategoriesDirective

public class CategoryDirective
extends AbstractDirective
implements Serializable

A logging category descriptor hierachy. The descriptor contains a category name, a optional priority value, and an optional target. If the priority or target values null, the resulting value will be derived from the parent category desciptor. A category descriptor may 0-n subsidiary categories. CategoryDirective names are relative. For example, the category "orb" will appear as "my-app.orb" if the parent category name is "my-app".

XML

    <categories priority="INFO">
      <category priority="DEBUG"  name="loader" />
      <category priority="WARN"  name="types" />
      <category priority="ERROR"  name="types.builder" target="default"/>
      <category name="profiles" />
      <category name="lifecycle" />
      <category name="verifier" />
    </categories>
 

Version:
1.2.0
Author:
Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
CategoryDirective(String name)
          Creation of a new CategoryDirective using a supplied name.
CategoryDirective(String name, Priority priority)
          Creation of a new CategoryDirective using a supplied name and priority.
CategoryDirective(String name, Priority priority, String target)
          Creation of a new CategoryDirective using a supplied name, priority, target and collection of subsidiary categories.
 
Method Summary
 boolean equals(Object other)
          Test this object for equality with the supplied object.
 String getName()
          Return the category name.
 Priority getPriority()
          Return the logging priority for the category.
 String getTarget()
          Return the default log target for the category.
 int hashCode()
          Return the instance hash code value.
 
Methods inherited from class net.dpml.metro.data.AbstractDirective
getPartHandlerURI, setupURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoryDirective

public CategoryDirective(String name)
Creation of a new CategoryDirective using a supplied name.

Parameters:
name - the category name

CategoryDirective

public CategoryDirective(String name,
                         Priority priority)
Creation of a new CategoryDirective using a supplied name and priority.

Parameters:
name - the category name
priority - the category priority - DEBUG, INFO, WARN, or ERROR

CategoryDirective

public CategoryDirective(String name,
                         Priority priority,
                         String target)
Creation of a new CategoryDirective using a supplied name, priority, target and collection of subsidiary categories.

Parameters:
name - the category name
priority - the category priority - DEBUG, INFO, WARN, or ERROR
target - the name of a logging category target
Method Detail

getName

public String getName()
Return the category name.

Returns:
the category name

getPriority

public Priority getPriority()
Return the logging priority for the category.

Returns:
the logging priority for the category

getTarget

public String getTarget()
Return the default log target for the category.

Returns:
the default target name

equals

public boolean equals(Object other)
Test this object for equality with the supplied object.

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

hashCode

public int hashCode()
Return the instance hash code value.

Overrides:
hashCode in class AbstractDirective
Returns:
the hash value