org.apache.myfaces.trinidad.skin

## Class SkinMetadata

- java.lang.Object
- - org.apache.myfaces.trinidad.skin.SkinMetadata

-     public final class SkinMetadata
      extends Object

  SkinMetadata encapsulates information about a skin. SkinMetadata is instantiated using the nested Builder class.

       SkinMetadata mySkinMetadata = new SkinMetadata.Builder()
                                          .baseSkinId("alta-v1.desktop")
                                          .id("mySkin.desktop")
                                          .family("mySkin")
                                          .renderKitId(SkinMetadata.RenderKit.DESKTOP)
                                          .styleSheetName("my/css/location.css")
                                          .version(new SkinVersion("v1"))
                                          .build();

  SkinMetadata is used mainly in two ways: First, as a representation of a Skin. Second, as a means to query Skins.

  SkinProvider#getSkinMetadata returns a collection of SkinMetadata. The collection returned from this method can be built by the SkinProvider implementations beforehand, so that it can publish the information about the skins that it supports to callers. Creation of SkinMetadata is a far less costly process than creating a Skin. SkinMetadata created for this purpose should contain all relevant information. SkinProviders can also use SkinMetadata objects to create the actual Skin objects using SkinFactory#createSkin API as well. In this case, SkinMetadata should be well formed with all relevant information so that SkinFactory can create the skin.

  SkinMetadata is used as query object to retrieve Skin from a SkinProvider#getSkin. Querying Skins are based on id, family, version and renderkit. For querying Skins, user should set either id or family as mandatory. Other information (even if present) are not relevant while searching for a skin.

  See Also:
    `SkinProvider`, `SkinMetadata.Builder`, `Skin`, `SkinFeatures`, `CustomMetadata`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SkinMetadata.Builder` convenience builder class for SkinMetadata SkinMetadata object can be created using this:
    `static class` | `SkinMetadata.RenderKitId` Enumeration representing RenderKit

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getBaseSkinId()`
    `String` | `getFamily()`
    `SkinFeatures` | `getFeatures()`
    `String` | `getId()`
    `CustomMetadata` | `getMetadata()`
    `String` | `getRenderKitId()`
    `String` | `getResourceBundleName()`
    `String` | `getStyleSheetName()`
    `javax.el.ValueExpression` | `getTranslationSource()`
    `SkinVersion` | `getVersion()`
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getId

          public String getId()

      Returns:
        id of the Skin

    - #### getFamily

          public String getFamily()

      Returns:
        family which the Skin belongs to

    - #### getRenderKitId

          public String getRenderKitId()

      Returns:
        renderKit `RenderKit` id of the Skin

    - #### getVersion

          public SkinVersion getVersion()

      Returns:
        version `SkinVersion` of the Skin

    - #### getStyleSheetName

          public String getStyleSheetName()

      Returns:
        styleSheetName for the Skin. This points to the actual Skin file and is loaded using NameResolver `NameResolver` implementation.

    - #### getResourceBundleName

          public String getResourceBundleName()

      Returns:
        resource bundle name for the Skin which contains the translations. If both translationSource and resourceBundleName is provided, resourceBundleName takes the precedence.

    - #### getTranslationSource

          public javax.el.ValueExpression getTranslationSource()

      Returns:
        translation source for the Skin, alternate way to specify the translations. If both translationSource and resourceBundleName is provided, resourceBundleName takes the precedence.

    - #### getBaseSkinId

          public String getBaseSkinId()

      Returns:
        id of the base Skin for this Skin

    - #### getFeatures

          public SkinFeatures getFeatures()

      Returns:
        features `SkinFeatures` for this Skin

    - #### getMetadata

          public CustomMetadata getMetadata()

      Returns:
        metadata `CustomMetadata` for this Skin

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.