Class Resources

java.lang.Object
io.guise.framework.Resources

public class Resources extends Object
Definitions of Guise resources.
Author:
Garret Wilson
  • Field Details

    • RESOURCES_NAMESPACE_PREFIX

      @Deprecated public static final String RESOURCES_NAMESPACE_PREFIX
      Deprecated.
      The recommended prefix to the resources key ontology namespace.
      See Also:
    • RESOURCES_NAMESPACE_URI

      @Deprecated public static final URI RESOURCES_NAMESPACE_URI
      Deprecated.
      The URI to the resource key ontology namespace.
    • DEFAULT_RESOURCE_BUNDLE_BASE_NAME

      public static final String DEFAULT_RESOURCE_BUNDLE_BASE_NAME
      The default base name of the Guise resource bundle.
    • STRING_VALUE_REFERENCE_PREFIX_CHAR

      public static final char STRING_VALUE_REFERENCE_PREFIX_CHAR
      The prefix character used to introduce string value references.
      See Also:
    • LABEL_PROPERTY_KEY_ASPECT

      public static final String LABEL_PROPERTY_KEY_ASPECT
      The aspect used to identify labels as part of resource property keys.
      See Also:
    • GLYPH_PROPERTY_KEY_ASPECT

      public static final String GLYPH_PROPERTY_KEY_ASPECT
      The aspect used to identify glyphs as part of resource property keys.
      See Also:
    • INFO_PROPERTY_KEY_ASPECT

      public static final String INFO_PROPERTY_KEY_ASPECT
      The aspect used to identify info as part of resource property keys.
      See Also:
    • APPLICATION_NAME

      public static final String APPLICATION_NAME
      Label referencing the application name resource.
    • APPLICATION_NAME_SHORT

      public static final String APPLICATION_NAME_SHORT
      Label referencing the short application name resource.
    • APPLICATION_LABEL

      public static final String APPLICATION_LABEL
      Label referencing the application label resource.
    • APPLICATION_DESCRIPTION

      public static final String APPLICATION_DESCRIPTION
      Label referencing the application description resource.
    • APPLICATION_VERSION

      public static final String APPLICATION_VERSION
      Label referencing the application version resource.
    • CONVERTER_INVALID_VALUE_MESSAGE_RESOURCE_REFERENCE

      public static final String CONVERTER_INVALID_VALUE_MESSAGE_RESOURCE_REFERENCE
      The resource reference for a converter message indicating that a value is invalid.
    • VALIDATOR_VALUE_REQUIRED_MESSAGE_RESOURCE_REFERENCE

      public static final String VALIDATOR_VALUE_REQUIRED_MESSAGE_RESOURCE_REFERENCE
      The resource reference for a validator message indicating that a value is required.
    • VALIDATOR_INVALID_VALUE_MESSAGE_RESOURCE_REFERENCE

      public static final String VALIDATOR_INVALID_VALUE_MESSAGE_RESOURCE_REFERENCE
      The resource reference for a validator message indicating that a value is invalid.
    • VALIDATION_FALSE_MESSAGE_RESOURCE_REFERENCE

      public static final String VALIDATION_FALSE_MESSAGE_RESOURCE_REFERENCE
      The resource bundle key for a general failed validation message.
  • Method Details

    • createStringResourceReference

      public static final String createStringResourceReference(String resourceKey)
      Creates a string containing a reference to the given string resource key. The string resource reference is a control string according to ECMA-48, "Control Functions for Coded Character Sets", Section 5.6, "Control strings". A control string begins with the Start of String control character (U+0098) and ends with a String Terminator control character (U+009C). ECMA-48 publication is also approved as ISO/IEC 6429.
      Parameters:
      resourceKey - The resource key to a string in the resources which could be retrieved using GuiseSession.getStringResource(String).
      Returns:
      A string containing a reference to the given resource key, an ECMA-48 control string with the given resource key as its content, which can be resolved using GuiseSession.dereferenceString(String).
      Throws:
      NullPointerException - if the given resource key is null.
      See Also:
    • createStringValueReference

      public static final String createStringValueReference(String value)
      Creates a string containing a value that can be used as an argument in formatting.
      Parameters:
      value - The value to be used as an argument.
      Returns:
      A string containing a reference to the given value, an ECMA-48 control string beginning with '=' with the given Value as its content.
      Throws:
      NullPointerException - if the given value is null.
      See Also:
    • createURIResourceReference

      public static final URI createURIResourceReference(String resourceKey)
      Creates a URI containing a reference to the given string resource key. The URI resource reference is URI with the scheme resource and the scheme-specific part indicating the resource key.
      Parameters:
      resourceKey - The resource key to a string in the resources which could be retrieved using GuiseSession.getURIResource(String).
      Returns:
      A URI containing a reference to the given resource key, which can be resolved using GuiseSession.resolveURI(URI, String...).
      Throws:
      NullPointerException - if the given resource key is null.
    • getResourceKeyName

      public static String getResourceKeyName(Enum<?> e)
      Returns a form of the enum name appropriate for a resource key. The name is converted to lowercaes and all underscore characters ('_') are replaced by periods ('.'). For example, FILE_NOT_FOUND would produce file.not.found.
      Parameters:
      e - The enum instance to convert to a resource key.
      Returns:
      A string representing the enum instance in a style appropriate for use as a resource key.
      See Also:
    • getLabelResourceReference

      public static <E extends Enum<E>> String getLabelResourceReference(Class<E> enumClass)
      Returns a resource reference for the label aspect of a resource key based upon the given enum class. The resource reference will a resource key in the form com.example.EnumClass.label.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      enumClass - The enum class for which to return a resource reference.
      Returns:
      A string resource reference to the label aspect of a resource key based upon the given enum class.
      Throws:
      NullPointerException - if the given enum is null.
      See Also:
    • getLabelResourceReference

      public static <E extends Enum<E>> String getLabelResourceReference(E e)
      Returns a resource reference for the label aspect of a resource key based upon the given enum. The resource reference will a resource key in the form com.example.EnumClass.NAME.label.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      e - The enum instance for which to return a resource reference.
      Returns:
      A string resource reference to the label aspect of a resource key based upon the given enum.
      Throws:
      NullPointerException - if the given enum is null.
      See Also:
    • getGlyphResourceReference

      public static <E extends Enum<E>> URI getGlyphResourceReference(Class<E> enumClass)
      Returns a resource reference for the glyph aspect of a resource key based upon the given enum class. The resource reference will a resource key in the form com.example.EnumClass.glyph.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      enumClass - The enum class for which to return a resource reference.
      Returns:
      A URI resource reference to the glyph aspect of a resource key based upon the given enum class.
      Throws:
      NullPointerException - if the given enum is null.
      See Also:
    • getGlyphResourceReference

      public static <E extends Enum<E>> URI getGlyphResourceReference(E e)
      Returns a resource reference for the glyph aspect of a resource key based upon the given enum. The resource reference will a resource key in the form com.example.EnumClass.NAME.glyph.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      e - The enum instance for which to return a resource reference.
      Returns:
      A URI resource reference to the glyph aspect of a resource key based upon the given enum.
      Throws:
      NullPointerException - if the given enum is null.
      See Also:
    • getInfoResourceReference

      public static <E extends Enum<E>> String getInfoResourceReference(Class<E> enumClass)
      Returns a resource reference for the info aspect of a resource key based upon the given enum class. The resource reference will a resource key in the form com.example.EnumClass.info.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      enumClass - The enum class for which to return a resource reference.
      Returns:
      A string resource reference to the info aspect of a resource key based upon the given enum class.
      Throws:
      NullPointerException - if the given enum is null.
      See Also:
    • getInfoResourceReference

      public static <E extends Enum<E>> String getInfoResourceReference(E e)
      Returns a resource reference for the info aspect of a resource key based upon the given enum. The resource reference will a resource key in the form com.example.EnumClass.NAME.info.
      Type Parameters:
      E - The type of the enum.
      Parameters:
      e - The enum instance for which to return a resource reference.
      Returns:
      A string resource reference to the info aspect of a resource key based upon the given enum.
      Throws:
      NullPointerException - if the given enum is null.
      See Also: