Klasse Icon

java.lang.Object
org.jupnp.model.meta.Icon
Alle implementierten Schnittstellen:
Validatable

public class Icon extends Object implements Validatable
The metadata of a device icon, might include the actual image data of a local icon.

Note that validation of icons is lax on purpose, a valid Icon might still return null from getMimeType(), getWidth(), getHeight(), and getDepth(). However, getUri() will return a valid URI for a valid Icon.

Autor:
Christian Bauer, Jochen Hiller - use SpecificationViolationReporter
  • Konstruktorübersicht

    Konstruktoren
    Modifizierer
    Konstruktor
    Beschreibung
     
    Icon(String mimeType, int width, int height, int depth, File file)
    Use this constructor if your local icon data can be resolved with a File, the file's name must be unique within the scope of a device.
     
    Icon(String mimeType, int width, int height, int depth, String uniqueName, byte[] data)
    Use this constructor if your local icon data is in a byte[].
     
    Icon(String mimeType, int width, int height, int depth, String uniqueName, InputStream is)
    Use this constructor if your local icon data is an InputStream.
     
    Icon(String mimeType, int width, int height, int depth, String uniqueName, String binHexEncoded)
    Use this constructor if your local icon is binary data encoded with BinHex.
     
    Icon(String mimeType, int width, int height, int depth, URI uri)
    Used internally by jUPnP when RemoteDevice is discovered, you shouldn't have to call this.
     
    Icon(String mimeType, int width, int height, int depth, URL url)
    Use this constructor if your local icon data can be resolved on the classpath, for example: MyClass.class.getResource("/my/icon.png)
    protected
    Icon(MimeType mimeType, int width, int height, int depth, URI uri, byte[] data)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
     
    byte[]
     
    int
     
     
    int
     
     
     
    int
     
     
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • Icon

      public Icon(String mimeType, int width, int height, int depth, URI uri)
      Used internally by jUPnP when RemoteDevice is discovered, you shouldn't have to call this.
    • Icon

      public Icon(String mimeType, int width, int height, int depth, URL url) throws IOException
      Use this constructor if your local icon data can be resolved on the classpath, for example: MyClass.class.getResource("/my/icon.png)
      Parameter:
      url - A URL of the icon data that can be read with new File(url.toURI()).
      Löst aus:
      IOException
    • Icon

      public Icon(String mimeType, int width, int height, int depth, File file) throws IOException
      Use this constructor if your local icon data can be resolved with a File, the file's name must be unique within the scope of a device.
      Löst aus:
      IOException
    • Icon

      public Icon(String mimeType, int width, int height, int depth, String uniqueName, InputStream is) throws IOException
      Use this constructor if your local icon data is an InputStream.
      Parameter:
      uniqueName - Must be a valid URI path segment and unique within the scope of a device.
      Löst aus:
      IOException
    • Icon

      public Icon(String mimeType, int width, int height, int depth, String uniqueName, byte[] data)
      Use this constructor if your local icon data is in a byte[].
      Parameter:
      uniqueName - Must be a valid URI path segment and unique within the scope of a device.
    • Icon

      public Icon(String mimeType, int width, int height, int depth, String uniqueName, String binHexEncoded)
      Use this constructor if your local icon is binary data encoded with BinHex.
      Parameter:
      uniqueName - Must be a valid URI path segment and unique within the scope of a device.
      binHexEncoded - The icon bytes encoded as BinHex.
    • Icon

      protected Icon(MimeType mimeType, int width, int height, int depth, URI uri, byte[] data)
  • Methodendetails

    • getMimeType

      public MimeType getMimeType()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getDepth

      public int getDepth()
    • getUri

      public URI getUri()
    • getData

      public byte[] getData()
    • getDevice

      public Device getDevice()
    • validate

      public List<ValidationError> validate()
      Angegeben von:
      validate in Schnittstelle Validatable
      Gibt zurück:
      An empty List if all rules validated properly, otherwise, the detected errors.
    • deepCopy

      public Icon deepCopy()
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object