public class PwaIcon extends Object implements Serializable
[basename]-[width]x[height].png{?[filehash]}
The trailing ?[filehash] will be added if icon cache is not
controlled by service worker: cached = false
Icon caching is left to the browser if it's not cached with service worker.| Modifier and Type | Class and Description |
|---|---|
static class |
PwaIcon.Domain
Place where icon belongs to (header or manifest.webmanifest).
|
| Modifier | Constructor and Description |
|---|---|
protected |
PwaIcon(PwaIcon icon) |
| Modifier and Type | Method and Description |
|---|---|
org.jsoup.nodes.Element |
asElement()
Gets an
Element presentation of the icon. |
protected BufferedImage |
getBaseImage() |
String |
getCacheFormat()
Gets the cache-string used in Google Workbox caching.
|
PwaIcon.Domain |
getDomain()
Gets the icon
PwaIcon.Domain. |
int |
getHeight()
Gets height of an icon.
|
String |
getHref()
Gets the value of the href attribute.
|
String |
getRelHref()
Return href with '/' -prefix and removed possible ?[fileHash].
|
String |
getSizes()
Gets the value of the sizes attribute.
|
String |
getType()
Gets the value of the type attribute.
|
int |
getWidth()
Gets width of an icon.
|
void |
setImage(BufferedImage image)
Sets the image presenting the icon.
|
void |
setRegistry(PwaRegistry registry) |
boolean |
shouldBeCached()
Should the icon be cached by the Service Worker.
|
void |
write(OutputStream outputStream)
Writes the icon image to output stream.
|
protected PwaIcon(PwaIcon icon)
public org.jsoup.nodes.Element asElement()
Element presentation of the icon.Element presentation of the iconpublic int getWidth()
public int getHeight()
public boolean shouldBeCached()
public String getSizes()
public String getHref()
public String getRelHref()
public String getCacheFormat()
public String getType()
public PwaIcon.Domain getDomain()
PwaIcon.Domain.public void setRegistry(PwaRegistry registry)
public void setImage(BufferedImage image)
image - the image in png formatpublic void write(OutputStream outputStream)
outputStream - output stream to write the icon image toprotected BufferedImage getBaseImage()
Copyright © 2025. All rights reserved.