public class DefaultTextHttpMessageLocation extends Object implements TextHttpMessageLocation
TextHttpMessageLocation
.HttpMessageLocation.Location
Constructor and Description |
---|
DefaultTextHttpMessageLocation(HttpMessageLocation.Location location,
int position) |
DefaultTextHttpMessageLocation(HttpMessageLocation.Location location,
int start,
int end,
String value) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MessageLocation otherLocation) |
boolean |
equals(Object obj) |
String |
getDescription()
Gets the description of this location in the message.
|
int |
getEnd() |
HttpMessageLocation.Location |
getLocation() |
int |
getStart() |
Class<HttpMessage> |
getTargetMessageClass() |
String |
getValue()
Gets the value represented by this location.
|
int |
hashCode() |
boolean |
overlaps(MessageLocation otherLocation)
Tells whether or not the given location overlaps with this location.
|
public DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int position)
public DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int start, int end, String value)
public HttpMessageLocation.Location getLocation()
getLocation
in interface HttpMessageLocation
public Class<HttpMessage> getTargetMessageClass()
getTargetMessageClass
in interface MessageLocation
public String getDescription()
MessageLocation
Should be internationalised as it might be shown in GUI components.
Examples, of possible descriptions:
Example 1: This message location represents a POST parameter, in an HTTP message, it could return:
POST parameter
Example 2: It's manually selected a value of a HTTP request header, it could return:
Header [start index, end index]
For text selections is advised to return the coordinates of the selected content or position.
getDescription
in interface MessageLocation
public String getValue()
MessageLocation
getValue
in interface MessageLocation
public int getStart()
getStart
in interface TextHttpMessageLocation
public int getEnd()
getEnd
in interface TextHttpMessageLocation
public boolean overlaps(MessageLocation otherLocation)
MessageLocation
Locations of non compatible types (for example, text and AMF) should return true
.
overlaps
in interface MessageLocation
otherLocation
- other location to test for overlappingtrue
if the otherLocation
overlaps with this one, false
otherwise.public int compareTo(MessageLocation otherLocation)
compareTo
in interface Comparable<MessageLocation>