Package io.guise.framework
Class Resources
java.lang.Object
io.guise.framework.Resources
Definitions of Guise resources.
- Author:
- Garret Wilson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Label referencing the application copyright resource.static final String
Label referencing the application description resource.static final String
Label referencing the application label resource.static final String
Label referencing the application name resource.static final String
Label referencing the short application name resource.static final String
Label referencing the application version resource.static final String
The resource reference for a converter message indicating that a value is invalid.static final String
The default base name of the Guise resource bundle.static final String
The aspect used to identify glyphs as part of resource property keys.static final String
The aspect used to identify info as part of resource property keys.static final String
The aspect used to identify labels as part of resource property keys.static final String
Deprecated.static final URI
Deprecated.static final char
The prefix character used to introduce string value references.static final String
The resource bundle key for a general failed validation message.static final String
The resource reference for a validator message indicating that a value is invalid.static final String
The resource reference for a validator message indicating that a value is required. -
Method Summary
Modifier and TypeMethodDescriptionstatic final String
createStringResourceReference
(String resourceKey) Creates a string containing a reference to the given string resource key.static final String
createStringValueReference
(String value) Creates a string containing a value that can be used as an argument in formatting.static final URI
createURIResourceReference
(String resourceKey) Creates a URI containing a reference to the given string resource key.Returns a resource reference for the glyph aspect of a resource key based upon the given enum.getGlyphResourceReference
(Class<E> enumClass) Returns a resource reference for the glyph aspect of a resource key based upon the given enum class.Returns a resource reference for the info aspect of a resource key based upon the given enum.getInfoResourceReference
(Class<E> enumClass) Returns a resource reference for the info aspect of a resource key based upon the given enum class.Returns a resource reference for the label aspect of a resource key based upon the given enum.getLabelResourceReference
(Class<E> enumClass) Returns a resource reference for the label aspect of a resource key based upon the given enum class.static String
getResourceKeyName
(Enum<?> e) Returns a form of the enum name appropriate for a resource key.
-
Field Details
-
RESOURCES_NAMESPACE_PREFIX
Deprecated.The recommended prefix to the resources key ontology namespace.- See Also:
-
RESOURCES_NAMESPACE_URI
Deprecated.The URI to the resource key ontology namespace. -
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_CHARThe prefix character used to introduce string value references.- See Also:
-
LABEL_PROPERTY_KEY_ASPECT
The aspect used to identify labels as part of resource property keys.- See Also:
-
GLYPH_PROPERTY_KEY_ASPECT
The aspect used to identify glyphs as part of resource property keys.- See Also:
-
INFO_PROPERTY_KEY_ASPECT
The aspect used to identify info as part of resource property keys.- See Also:
-
APPLICATION_NAME
Label referencing the application name resource. -
APPLICATION_NAME_SHORT
Label referencing the short application name resource. -
APPLICATION_LABEL
Label referencing the application label resource. -
APPLICATION_DESCRIPTION
Label referencing the application description resource. -
APPLICATION_COPYRIGHT
Label referencing the application copyright resource. -
APPLICATION_VERSION
Label referencing the application version resource. -
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
The resource reference for a validator message indicating that a value is required. -
VALIDATOR_INVALID_VALUE_MESSAGE_RESOURCE_REFERENCE
The resource reference for a validator message indicating that a value is invalid. -
VALIDATION_FALSE_MESSAGE_RESOURCE_REFERENCE
The resource bundle key for a general failed validation message.
-
-
Method Details
-
createStringResourceReference
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 usingGuiseSession.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 isnull
.- See Also:
-
createStringValueReference
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 isnull
.- See Also:
-
createURIResourceReference
Creates a URI containing a reference to the given string resource key. The URI resource reference is URI with the schemeresource
and the scheme-specific part indicating the resource key.- Parameters:
resourceKey
- The resource key to a string in the resources which could be retrieved usingGuiseSession.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 isnull
.
-
getResourceKeyName
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 producefile.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
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 formcom.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 isnull
.- See Also:
-
Classes.getPropertyName(Class, String)
LABEL_PROPERTY_KEY_ASPECT
createStringResourceReference(String)
-
getLabelResourceReference
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 formcom.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 isnull
.- See Also:
-
Enums.getPropertyName(Enum, String)
LABEL_PROPERTY_KEY_ASPECT
createStringResourceReference(String)
-
getGlyphResourceReference
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 formcom.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 isnull
.- See Also:
-
Classes.getPropertyName(Class, String)
GLYPH_PROPERTY_KEY_ASPECT
createURIResourceReference(String)
-
getGlyphResourceReference
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 formcom.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 isnull
.- See Also:
-
Enums.getPropertyName(Enum, String)
GLYPH_PROPERTY_KEY_ASPECT
createURIResourceReference(String)
-
getInfoResourceReference
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 formcom.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 isnull
.- See Also:
-
Classes.getPropertyName(Class, String)
INFO_PROPERTY_KEY_ASPECT
createStringResourceReference(String)
-
getInfoResourceReference
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 formcom.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 isnull
.- See Also:
-
Enums.getPropertyName(Enum, String)
INFO_PROPERTY_KEY_ASPECT
createStringResourceReference(String)
-