|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.tools.resource.ResourceInfo
A Resource, which may have multiple localizations.
Supported API: false
Extendable: false
buildResource()
,
write()
Field Summary | |
protected static boolean |
BACKUP
|
protected boolean |
baseHasChanged
|
private ResourceBuilder |
builder
|
private static String |
CLASSNAME
|
private String[] |
comments
|
protected static String |
COMPILE
|
private boolean |
containsCategory
|
protected boolean |
customHasChanged
|
private boolean |
customizable
|
private com.objectspace.jgl.OrderedMap |
customizedValue
|
private ResourceInfo |
defaultInfo
|
protected static boolean |
DEL_SOURCE
|
private boolean |
deprecated
|
private String |
extendClass
|
static String |
EXTENSION
|
protected static boolean |
FORCE_COMPILE
|
protected static boolean |
FROM_DEFAULT_FORCE
|
protected static Locale[] |
FROM_DEFAULT_LOCALES
|
private Locale |
locale
|
private Hashtable |
localization
|
protected static String |
MSG_CAT
|
private String |
name
|
private boolean |
replacement
|
private static String |
RESOURCE
|
protected static String |
TRANSLATION_SECTION_MARKER
|
protected static boolean |
TRANSLATION_SUPPORT
|
protected boolean |
translationSectionStarted
|
private boolean |
updated
|
private com.objectspace.jgl.OrderedMap |
value
|
Constructor Summary | |
protected |
ResourceInfo()
|
Method Summary | |
void |
buildResource()
Use this ResourceInfo to build a resource, which can be used at run-time, for resource value lookups. |
void |
buildResourceSet()
Build resource bundles for this ResourceInfo and all of its associated localizations. |
protected boolean |
containsCategory()
Gets the category containment status of this ResourceInfo object. |
(package private) static String |
directory(String name,
boolean customization)
|
private String |
filename(boolean customization)
Determines the filename for storinh the Info. |
static String |
filename(String name)
|
(package private) static String |
filename(String name,
Locale locale,
boolean customization)
|
protected ResourceBuilder |
getBuilder()
Gets the object for the association that plays role: builder. |
String[] |
getComments()
Gets the value of the attribute: comments. |
ResourceValue |
getCustomizedValue(String key)
Gets the object for the association that plays role: customizedValue. |
Enumeration |
getCustomizedValues()
Get the set of customized values for the ResourceInfo. |
Enumeration |
getCustomizedView()
Get the runtime view of the values for the ResourceInfo. |
protected ResourceInfo |
getDefaultInfo()
Gets the object for the association that plays role: defaultInfo. |
String |
getExtendClass()
Gets the value of the attribute: extendClass; The name of the class that the runtime built resource will extend. |
Locale |
getLocale()
Gets the value of the attribute: locale; The locale that this resource applies to. |
ResourceInfo |
getLocalization(Locale locale)
Gets the object for the association that plays role: localization. |
String |
getName()
Gets the value of the attribute: name; The fully qualified name for this resource. |
protected String |
getResourceType()
Gets the resource type. |
ResourceValue |
getValue(String key)
Gets the object for the association that plays role: value. |
Enumeration |
getValues()
Get the set of current values for the ResourceInfo. |
boolean |
isCustomizable()
Gets the value of the attribute: customizable; Specifies if this resource can be customized. |
boolean |
isDeprecated()
Gets the value of the attribute: deprecated; Specifies if this bundle is deprecated. |
protected boolean |
isEmpty(Dictionary a_value)
Determine if a_value is empty (null or zero length). |
protected static boolean |
isEmpty(String a_value)
Determine if a_value is empty (null or zero length). |
protected boolean |
isFromDefault(Locale locale)
Determine if a locale is one that will be built from the default file. |
protected static boolean |
isPrimaryKey(String theKey)
|
boolean |
isReplacement()
Gets the value of the attribute: replacement; Specifies if this customization is a complete replacement of the base resource info. |
protected void |
load(Dictionary source,
boolean customization)
Load the state of this instance from the source. |
protected ResourceInfo |
loadAll()
Construct a new instance of the current object's class. |
(package private) static String |
localePattern(String name)
|
protected abstract ResourceInfo |
makeInfo()
Construct a new instance of the current object's class. |
protected abstract ResourceValue |
makeValue(String a_Key)
Make a new ResourceValue, for this ResourceInfo. |
private void |
nameValidate(String a_Name)
|
protected void |
notifyLocalizations(ResourceValue oldValue,
ResourceValue a_Value)
|
ResourceInfo |
obtainLocalization(Locale locale)
Obtain a locale specific version of this ResourceInfo, by returning an existing instance for the locale, or by constructing a new instance if one does not exist. |
ResourceValue |
obtainValue(String a_Key,
boolean customization)
Obtain a ResourceValue, by returning a copy of an existing instance for a_Key, or by constructing a new instance if one does not exist. |
protected Dictionary |
order(Dictionary table)
|
protected void |
populateResource(Dictionary keyValues,
Dictionary constants,
ResourceValue rv)
Populate the resource with the values needed at run-time. |
protected void |
printFormat(PrintWriter output)
|
void |
putCustomizedValue(String key,
Object value)
Make a new customized ResourceValue for this ResourceInfo, based on the key and value, and put it into the ResourceInfo. |
ResourceValue |
putCustomizedValue(String key,
ResourceValue a_CustomizedValue)
Sets the object for the association that plays role: customizedValue. |
protected ResourceInfo |
putLocalization(Locale locale,
ResourceInfo a_Localization)
Sets the object for the association that plays role: localization. |
void |
putValue(String key,
Object value)
Make a new ResourceValue for this ResourceInfo, based on the key and value, and put it into the ResourceInfo. |
ResourceValue |
putValue(String key,
ResourceValue a_Value)
Sets the object for the association that plays role: value. |
ResourceValue |
removeCustomizedValue(String key)
Removes the value, for specified key, of the attribute: customizedValue. |
protected ResourceInfo |
removeLocalization(Locale locale)
Removes the value, for specified key, of the attribute: localization. |
ResourceValue |
removeValue(String key)
Removes the value, for specified key, of the attribute: value. |
private boolean |
resourceCompileNeeded()
|
private boolean |
resourceCompileNeeded(File ootb_info,
File custom_info,
String name_only,
Locale rb_locale)
|
void |
setComments(String[] a_Comments)
Sets the value of the attribute: comments. |
protected void |
setContainsCategory(boolean contains_category)
Sets the category containment status of this ResourceInfo object. |
void |
setCustomizable(boolean a_Customizable)
Sets the value of the attribute: customizable; Specifies if this resource can be customized. |
void |
setDeprecated(boolean a_Deprecated)
Sets the value of the attribute: deprecated; Specifies if this bundle is deprecated. |
void |
setExtendClass(String a_ExtendClass)
Sets the value of the attribute: extendClass; The name of the class that the runtime built resource will extend. |
void |
setLocale(Locale a_Locale)
Sets the value of the attribute: locale; The locale that this resource applies to. |
void |
setName(String a_Name)
Sets the value of the attribute: name; The fully qualified name for this resource. |
void |
setReplacement(boolean a_Replacement)
Sets the value of the attribute: replacement; Specifies if this customization is a complete replacement of the base resource info. |
String |
toString()
|
void |
write()
Persist the current state of this ResourceInfo to a file. |
protected void |
write(Dictionary table,
boolean customization)
|
void |
writeSet()
Persist the current state of this ResourceInfo and all of its associated localizations. |
protected void |
writeTranslationSupport(PrintWriter output,
ResourceValue rv)
|
protected void |
writeUnlocalizedValue(PrintWriter output,
ResourceValue rv)
|
protected void |
writeValue(PrintWriter output,
ResourceValue rv)
Write the state of a particular ResourceValue to the output target. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private String name
private Locale locale
private String extendClass
private boolean customizable
private boolean replacement
private boolean deprecated
private String[] comments
private boolean updated
private com.objectspace.jgl.OrderedMap value
private ResourceInfo defaultInfo
private Hashtable localization
private com.objectspace.jgl.OrderedMap customizedValue
private ResourceBuilder builder
protected static final String COMPILE
protected static final boolean BACKUP
protected static final boolean DEL_SOURCE
protected static final boolean FORCE_COMPILE
protected static final boolean TRANSLATION_SUPPORT
protected static final boolean FROM_DEFAULT_FORCE
protected static final Locale[] FROM_DEFAULT_LOCALES
protected static final String TRANSLATION_SECTION_MARKER
protected static final String MSG_CAT
protected boolean translationSectionStarted
protected boolean baseHasChanged
protected boolean customHasChanged
private boolean containsCategory
public static final String EXTENSION
Constructor Detail |
protected ResourceInfo()
Method Detail |
public String getName()
public void setName(String a_Name) throws WTPropertyVetoException
a_Name
-
WTPropertyVetoException
private void nameValidate(String a_Name) throws WTPropertyVetoException
a_Name
-
WTPropertyVetoException
public Locale getLocale()
public void setLocale(Locale a_Locale) throws WTPropertyVetoException
a_Locale
-
WTPropertyVetoException
public String getExtendClass()
public void setExtendClass(String a_ExtendClass) throws WTPropertyVetoException
a_ExtendClass
-
WTPropertyVetoException
public boolean isCustomizable()
public void setCustomizable(boolean a_Customizable) throws WTPropertyVetoException
a_Customizable
-
WTPropertyVetoException
public boolean isReplacement()
public void setReplacement(boolean a_Replacement) throws WTPropertyVetoException
a_Replacement
-
WTPropertyVetoException
public boolean isDeprecated()
public void setDeprecated(boolean a_Deprecated) throws WTPropertyVetoException
a_Deprecated
-
WTPropertyVetoException
public String[] getComments()
public void setComments(String[] a_Comments) throws WTPropertyVetoException
a_Comments
-
WTPropertyVetoException
public ResourceValue getValue(String key)
key
-
putValue(String,ResourceValue)
public ResourceValue putValue(String key, ResourceValue a_Value) throws WTPropertyVetoException
key
- a_Value
-
WTPropertyVetoException
public ResourceValue removeValue(String key)
key
-
protected ResourceInfo getDefaultInfo()
public ResourceInfo getLocalization(Locale locale)
locale
-
protected ResourceInfo putLocalization(Locale locale, ResourceInfo a_Localization) throws WTPropertyVetoException
locale
- a_Localization
-
WTPropertyVetoException
protected ResourceInfo removeLocalization(Locale locale)
locale
-
public ResourceValue getCustomizedValue(String key)
key
-
public ResourceValue putCustomizedValue(String key, ResourceValue a_CustomizedValue) throws WTPropertyVetoException
key
- a_CustomizedValue
-
WTPropertyVetoException
public ResourceValue removeCustomizedValue(String key)
key
-
protected ResourceBuilder getBuilder()
protected abstract ResourceInfo makeInfo() throws WTPropertyVetoException
WTPropertyVetoException
protected abstract ResourceValue makeValue(String a_Key) throws WTPropertyVetoException
a_Key
-
WTPropertyVetoException
public ResourceInfo obtainLocalization(Locale locale) throws WTPropertyVetoException
locale
-
WTPropertyVetoException
public ResourceValue obtainValue(String a_Key, boolean customization) throws WTPropertyVetoException
a_Key
- customization
-
WTPropertyVetoException
public void putValue(String key, Object value) throws WTPropertyVetoException
key
- value
-
WTPropertyVetoException
public void putCustomizedValue(String key, Object value) throws WTPropertyVetoException
key
- value
-
WTPropertyVetoException
public void buildResourceSet() throws WTPropertyVetoException, FileNotFoundException, IOException
WTPropertyVetoException
FileNotFoundException
IOException
buildResource()
public void buildResource() throws WTPropertyVetoException, FileNotFoundException, IOException
WTPropertyVetoException
FileNotFoundException
IOException
buildResourceSet()
protected void populateResource(Dictionary keyValues, Dictionary constants, ResourceValue rv) throws WTPropertyVetoException
keyValues
- constants
- rv
-
WTPropertyVetoException
public void writeSet()
write()
public void write()
writeSet()
protected void writeValue(PrintWriter output, ResourceValue rv)
output
- rv
- protected void load(Dictionary source, boolean customization) throws WTPropertyVetoException
source
- customization
-
WTPropertyVetoException
public Enumeration getValues()
public Enumeration getCustomizedValues()
public Enumeration getCustomizedView()
protected Dictionary order(Dictionary table)
protected void write(Dictionary table, boolean customization)
private boolean resourceCompileNeeded()
private boolean resourceCompileNeeded(File ootb_info, File custom_info, String name_only, Locale rb_locale)
private String filename(boolean customization)
customization
- is
public static String filename(String name)
static String filename(String name, Locale locale, boolean customization)
static String directory(String name, boolean customization)
static String localePattern(String name)
protected ResourceInfo loadAll() throws WTPropertyVetoException
WTPropertyVetoException
protected void notifyLocalizations(ResourceValue oldValue, ResourceValue a_Value) throws WTPropertyVetoException
WTPropertyVetoException
protected void writeTranslationSupport(PrintWriter output, ResourceValue rv)
protected void writeUnlocalizedValue(PrintWriter output, ResourceValue rv)
protected void printFormat(PrintWriter output)
protected static boolean isPrimaryKey(String theKey)
protected void setContainsCategory(boolean contains_category)
protected boolean containsCategory()
protected String getResourceType()
public String toString()
protected static boolean isEmpty(String a_value)
protected boolean isEmpty(Dictionary a_value)
protected boolean isFromDefault(Locale locale)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |