Interface ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
-
- All Known Implementing Classes:
FileServer.ImageUrlAccordingToHtmlSizeDirectiveTranslator
,ImageUrlAccordingToHtmlSizeDirective.SrcWithSizeParametersTranslator
,SimpleDocumentUrlAccordingToHtmlSizeDirectiveTranslator
- Enclosing class:
- ImageUrlAccordingToHtmlSizeDirective
public static interface ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
This interface permits to the different provider of images to translate an URL with given height and width.When
ImageUrlAccordingToHtmlSizeDirective.SrcTranslator
is called, the given MUST be an URL of an image. Implementations are not in charge to verify this fact.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static List<ImageUrlAccordingToHtmlSizeDirective.SrcTranslator>
getAll()
boolean
isCompliantUrl(String url)
Indicates if the given URL is compliant with the current implementation.String
translateUrl(String url, String width, String height)
Translates the given URL to a new one which is taking into account the given width and the given height.
-
-
-
Method Detail
-
getAll
static List<ImageUrlAccordingToHtmlSizeDirective.SrcTranslator> getAll()
-
isCompliantUrl
boolean isCompliantUrl(String url)
Indicates if the given URL is compliant with the current implementation.- Parameters:
url
- the URL to verify.- Returns:
- true if compliant, false otherwise.
-
translateUrl
String translateUrl(String url, String width, String height)
Translates the given URL to a new one which is taking into account the given width and the given height.isCompliantUrl(String)
MUST be verified before calling this method.- Parameters:
url
- an URL as string.width
- a width which could be an empty string to represent no width.height
- a height which could be an empty string to represent no height.- Returns:
- the translated URL as string.
-
-