Package wt.facade.persistedcollection
Class AssociationDisplayAssistant
java.lang.Object
wt.facade.persistedcollection.AssociationDisplayAssistant
- All Implemented Interfaces:
Serializable
Processing class used to obtain localized display values for the association keys stored in the member graph data
when soft filtering is used. Instances of this class are designed to be used for the duration of processing a graph of data.
When processing a graph, an instance can be initialized with a desired locale and custom resource bundle, and the
Example:
getDisplayValue method can be used to obtain localized display values for the association key as stored during
collection post-processing.Example:
AssociationDisplayAssistant displayAssistant = new AssociationDisplayAssistant(locale, "com.myCompany.myBundle");
String displayValue = displayAssistant.getDisplayName(thisRelationKey);
Supported API: true
Extendable: true
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAssociationDisplayAssistant(Locale theLocale, String sCustomBundleName) Constructor taking locale and custom resource bundle name. -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringbuildRelationKey(int iCollectedAsKey) Given a 'collected as key' value from collector results, this method returns the relation key to be stored in the filter graph.static final StringbuildRelationKey(int iCollectedAsKey, ObjectReference refLink) Give a 'collected as key' value from collector results and a reference to a link OID, this method returns the relation key to be stored in the filter graph.final StringGet the resource bundle name used for localizing relationship roles.protected final ResourceBundleGet the resource bundle used for localizing relationship roles.getDisplayValue(String sAssociationKey) For an association key passed in as stored in the filter graph, this method returns the display value found from the custom resource bundle, for the locale initialized on the instance.protected StringgetDisplayValueFromRawEntryValue(String sBundleEntry, String sRawEntryValue) Given the passed in bundle entry key and actual bundle entry value, this method processes the value and either returns it 'as is' if it localized text, or resolves the value if it points to another bundle entry or the model value to use instead.protected static final StringgetLinkName(String sLinkOID) Given an association key from filter graph which is expected to be a standard link association, this method returns the link class name portion of the oid.final LocaleGet locale used for localizing strings.protected final StringgetModelValue(String sBundleEntry) Given a bundle value that specifies to use the value from the model, this method obtains the localized value from the model for the link class specified as the bundle entry.protected final StringgetOtherBundleValue(String sRawEntryValue) For a bundle entry that specifies to use the value from another bundle entry, this value obtains the localized value from the bundle and returns it.protected static final booleanisUseAnotherBundleEntry(String sRawEntryValue) Returns whether this entry is a bundle entry specifying to use the value from another bundle.protected static final booleanisUseModelEntry(String sRawEntryValue) Returns whether this entry is a bundle entry specifying to use the display value from the model resource bundle.
-
Constructor Details
-
AssociationDisplayAssistant
Constructor taking locale and custom resource bundle name. The instance will return all localized values for the passed in locale, using the custom resource bundle as specified.
Supported API: true- Parameters:
theLocale- Locale of display values.sCustomBundleName- Name of custom resource bundle ("wt.facade.persistedcollection.relationResource" used if null).
-
-
Method Details
-
getLocale
Get locale used for localizing strings.
Supported API: true- Returns:
- Locale object (guaranteed non-null).
-
getCustomBundleName
Get the resource bundle name used for localizing relationship roles.
Supported API: true- Returns:
- String identifier of resource bundle, may be null (e.g., "wt.facade.persistedcollection.relationResource").
-
getCustomResourceBundle
Get the resource bundle used for localizing relationship roles.
Supported API: true- Returns:
- Custom resource bundle.
-
getLinkName
Given an association key from filter graph which is expected to be a standard link association, this method returns the link class name portion of the oid.
Supported API: true- Parameters:
sAssociationKey- association key as stored in filter graph- Returns:
- link class name portion of the link oid
-
getDisplayValue
For an association key passed in as stored in the filter graph, this method returns the display value found from the custom resource bundle, for the locale initialized on the instance. If a display value cannot be found in the custom bundle, the association key is passed back as is.
Supported API: true- Parameters:
sAssociationKey- association key- Returns:
- localized value to use for the association key as found from custom bundle, or the association key as is if not found
-
getDisplayValueFromRawEntryValue
Given the passed in bundle entry key and actual bundle entry value, this method processes the value and either returns it 'as is' if it localized text, or resolves the value if it points to another bundle entry or the model value to use instead. If the entry value does specify to grab from another bundle or the model, and in either case a value cannot be obtained, this method will log an error and return null.
Supported API: true- Parameters:
sBundleEntry- name of entry in custom resource bundlesRawEntryValue- raw value of the custom bundle entry- Returns:
- the processed value of the entry (which may come from a model or other bundle lookup)
-
getModelValue
Given a bundle value that specifies to use the value from the model, this method obtains the localized value from the model for the link class specified as the bundle entry.
Supported API: true- Parameters:
sBundleEntry- custom bundle entry, which should be a link class name- Returns:
- localized display value of the class from model, as returned by
getDisplayName(Locale)from itsClassInfoinstance; null is returned if this cannot be obtained
-
isUseModelEntry
Returns whether this entry is a bundle entry specifying to use the display value from the model resource bundle.
Supported API: true- Parameters:
sRawEntryValue- raw value of the bundle entry- Returns:
- true if it specifies to use the model value; false if not
-
getOtherBundleValue
For a bundle entry that specifies to use the value from another bundle entry, this value obtains the localized value from the bundle and returns it.
Supported API: true- Parameters:
sRawEntryValue- bundle entry specifying to use the value from another bundle entry- Returns:
- value from the other bundle; null is returned if the bundle value cannot be obtained
-
isUseAnotherBundleEntry
Returns whether this entry is a bundle entry specifying to use the value from another bundle.
Supported API: true- Parameters:
sRawEntryValue- raw value of the bundle entry- Returns:
- true if it specifies to use another bundle entry; false if not
-
buildRelationKey
Given a 'collected as key' value from collector results, this method returns the relation key to be stored in the filter graph.
Supported API: true- Parameters:
iCollectedAsKey- collected as key value from collector results- Returns:
- relation key as to be stored in filter graph
-
buildRelationKey
Give a 'collected as key' value from collector results and a reference to a link OID, this method returns the relation key to be stored in the filter graph. The link OID may be null if none available.
Supported API: true- Parameters:
iCollectedAsKey- collected as key value from collector resultsrefLink- reference to link object; may be null- Returns:
- relation key as to be stored in filter graph
-