org.apache.tapestry.util
Class DescribedLocation

java.lang.Object
  extended by org.apache.tapestry.util.DescribedLocation
All Implemented Interfaces:
org.apache.hivemind.Location

public class DescribedLocation
extends Object
implements org.apache.hivemind.Location

Implementation of Location that is used to describe a location within a resource. This is used when the location within the resource can't be expressed as a line and column. One example is for setting the location of an annotation. This is useful for line-precise exception reporting of errors related to annotations.

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
DescribedLocation(org.apache.hivemind.Resource resource, String description)
           
 
Method Summary
 boolean equals(Object other)
          A DescribedLocation is equal to another only if their resources are equal, and their descriptions are equal.
 int getColumnNumber()
          Always returns 0.
 int getLineNumber()
          Always returns 0.
 org.apache.hivemind.Resource getResource()
          Returns the resource provided in the constructor.
 String toString()
          Returns the description provided in the constructor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DescribedLocation

public DescribedLocation(org.apache.hivemind.Resource resource,
                         String description)
Method Detail

toString

public String toString()
Returns the description provided in the constructor.

Overrides:
toString in class Object

getResource

public org.apache.hivemind.Resource getResource()
Returns the resource provided in the constructor.

Specified by:
getResource in interface org.apache.hivemind.Location

getLineNumber

public int getLineNumber()
Always returns 0.

Specified by:
getLineNumber in interface org.apache.hivemind.Location

getColumnNumber

public int getColumnNumber()
Always returns 0.

Specified by:
getColumnNumber in interface org.apache.hivemind.Location

equals

public boolean equals(Object other)
A DescribedLocation is equal to another only if their resources are equal, and their descriptions are equal.

Overrides:
equals in class Object


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.