org.springframework.web.servlet.mvc.condition
Class AbstractMediaTypeExpression

java.lang.Object
  extended by org.springframework.web.servlet.mvc.condition.AbstractMediaTypeExpression
All Implemented Interfaces:
java.lang.Comparable<AbstractMediaTypeExpression>, MediaTypeExpression
Direct Known Subclasses:
ConsumesRequestCondition.ConsumeMediaTypeExpression, ProducesRequestCondition.ProduceMediaTypeExpression

abstract class AbstractMediaTypeExpression
extends java.lang.Object
implements java.lang.Comparable<AbstractMediaTypeExpression>, MediaTypeExpression

Supports media type expressions as described in: RequestMapping.consumes() and RequestMapping.produces().

Since:
3.1
Author:
Arjen Poutsma, Rossen Stoyanchev

Field Summary
private  boolean isNegated
           
private  MediaType mediaType
           
 
Constructor Summary
AbstractMediaTypeExpression(MediaType mediaType, boolean negated)
           
AbstractMediaTypeExpression(java.lang.String expression)
           
 
Method Summary
 int compareTo(AbstractMediaTypeExpression other)
           
 boolean equals(java.lang.Object obj)
           
 MediaType getMediaType()
           
 int hashCode()
           
 boolean isNegated()
           
 boolean match(HttpServletRequest request)
           
protected abstract  boolean matchMediaType(HttpServletRequest request)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mediaType

private final MediaType mediaType

isNegated

private final boolean isNegated
Constructor Detail

AbstractMediaTypeExpression

AbstractMediaTypeExpression(java.lang.String expression)

AbstractMediaTypeExpression

AbstractMediaTypeExpression(MediaType mediaType,
                            boolean negated)
Method Detail

getMediaType

public MediaType getMediaType()
Specified by:
getMediaType in interface MediaTypeExpression

isNegated

public boolean isNegated()
Specified by:
isNegated in interface MediaTypeExpression

match

public final boolean match(HttpServletRequest request)

matchMediaType

protected abstract boolean matchMediaType(HttpServletRequest request)

compareTo

public int compareTo(AbstractMediaTypeExpression other)
Specified by:
compareTo in interface java.lang.Comparable<AbstractMediaTypeExpression>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object