Package org.zaproxy.zap.model
Class DefaultTextHttpMessageLocation
- java.lang.Object
-
- org.zaproxy.zap.model.DefaultTextHttpMessageLocation
-
- All Implemented Interfaces:
java.lang.Comparable<MessageLocation>
,HttpMessageLocation
,MessageLocation
,TextHttpMessageLocation
public class DefaultTextHttpMessageLocation extends java.lang.Object implements TextHttpMessageLocation
Default implementation ofTextHttpMessageLocation
.- Since:
- 2.4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zaproxy.zap.model.HttpMessageLocation
HttpMessageLocation.Location
-
-
Constructor Summary
Constructors Constructor Description DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int position)
DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int start, int end, java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(MessageLocation otherLocation)
boolean
equals(java.lang.Object obj)
java.lang.String
getDescription()
Gets the description of this location in the message.int
getEnd()
HttpMessageLocation.Location
getLocation()
int
getStart()
java.lang.Class<HttpMessage>
getTargetMessageClass()
java.lang.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.
-
-
-
Constructor Detail
-
DefaultTextHttpMessageLocation
public DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int position)
-
DefaultTextHttpMessageLocation
public DefaultTextHttpMessageLocation(HttpMessageLocation.Location location, int start, int end, java.lang.String value)
-
-
Method Detail
-
getLocation
public HttpMessageLocation.Location getLocation()
- Specified by:
getLocation
in interfaceHttpMessageLocation
-
getTargetMessageClass
public java.lang.Class<HttpMessage> getTargetMessageClass()
- Specified by:
getTargetMessageClass
in interfaceMessageLocation
-
getDescription
public java.lang.String getDescription()
Description copied from interface:MessageLocation
Gets the description of this location in the message.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.
- Specified by:
getDescription
in interfaceMessageLocation
- Returns:
- the description of the location in the message
-
getValue
public java.lang.String getValue()
Description copied from interface:MessageLocation
Gets the value represented by this location. It might be empty if it represents an insertion position.- Specified by:
getValue
in interfaceMessageLocation
- Returns:
- the value represented by this location, empty if a position
-
getStart
public int getStart()
- Specified by:
getStart
in interfaceTextHttpMessageLocation
-
getEnd
public int getEnd()
- Specified by:
getEnd
in interfaceTextHttpMessageLocation
-
overlaps
public boolean overlaps(MessageLocation otherLocation)
Description copied from interface:MessageLocation
Tells whether or not the given location overlaps with this location.Locations of non compatible types (for example, text and AMF) should return
true
.- Specified by:
overlaps
in interfaceMessageLocation
- Parameters:
otherLocation
- other location to test for overlapping- Returns:
true
if theotherLocation
overlaps with this one,false
otherwise.
-
compareTo
public int compareTo(MessageLocation otherLocation)
- Specified by:
compareTo
in interfacejava.lang.Comparable<MessageLocation>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-