Class CombinedMediaType.EffectiveMediaType
java.lang.Object
org.glassfish.jersey.server.internal.routing.CombinedMediaType.EffectiveMediaType
- Enclosing class:
CombinedMediaType
Media type extended by flag indicating whether media type was
obtained from user annotations Consumes or Produces or has no
annotation and therefore was derived from MessageBodyWorkers.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEffectiveMediaType(String mediaTypeValue) Creates new instance withmediaTypewhich was obtained from user annotationsConsumesorProduces.EffectiveMediaType(javax.ws.rs.core.MediaType mediaType) Creates new instance withmediaTypewhich was obtained from user annotationsConsumesorProduces.EffectiveMediaType(javax.ws.rs.core.MediaType mediaType, boolean fromMessageBodyProviders) Creates new instance withmediaTypeand flag indicating the origin of the mediaType. -
Method Summary
Modifier and TypeMethodDescriptionbooleanjavax.ws.rs.core.MediaTypeReturnsMediaType.inthashCode()(package private) booleanReturn flag value whether theMediaTypewas not defined by annotation and therefore was derived from Message Body Providers.booleanReturns True if SubType ofMediaTypewas originally defined as wildcard.booleanReturns true if Type ofMediaTypewas originally defined as wildcard.toString()
-
Field Details
-
derived
private final boolean derivedTrue if the MediaType was not defined by annotation and therefore was derived from Message Body Providers. -
mediaType
private final javax.ws.rs.core.MediaType mediaType
-
-
Constructor Details
-
EffectiveMediaType
public EffectiveMediaType(javax.ws.rs.core.MediaType mediaType, boolean fromMessageBodyProviders) Creates new instance withmediaTypeand flag indicating the origin of the mediaType.- Parameters:
mediaType- The media type.fromMessageBodyProviders- True ifmediaTypewas derived fromMessageBodyWorkers.
-
EffectiveMediaType
Creates new instance withmediaTypewhich was obtained from user annotationsConsumesorProduces.- Parameters:
mediaTypeValue- The string media type.
-
EffectiveMediaType
public EffectiveMediaType(javax.ws.rs.core.MediaType mediaType) Creates new instance withmediaTypewhich was obtained from user annotationsConsumesorProduces.- Parameters:
mediaType- The media type.
-
-
Method Details
-
isWildcardType
public boolean isWildcardType()Returns true if Type ofMediaTypewas originally defined as wildcard.- Returns:
- Returns true if method
ConsumesorProduceswas annotated with wildcard type (for example '*/*').
-
isWildcardSubType
public boolean isWildcardSubType()Returns True if SubType ofMediaTypewas originally defined as wildcard.- Returns:
- Returns true if method
ConsumesorProduceswas annotated with wildcard subtype (for example 'text/*').
-
getMediaType
public javax.ws.rs.core.MediaType getMediaType()ReturnsMediaType.- Returns:
- Media type.
-
isDerived
boolean isDerived()Return flag value whether theMediaTypewas not defined by annotation and therefore was derived from Message Body Providers.- Returns:
trueif theMediaTypewas not defined by annotation and therefore was derived from Message Body Providers,falseotherwise.
-
toString
-
equals
-
hashCode
public int hashCode()
-