org.xbrlapi.aspects
Class StoreLabelCache
java.lang.Object
org.xbrlapi.aspects.StoreLabelCache
- All Implemented Interfaces:
- Serializable, LabelCache
public class StoreLabelCache
- extends Object
- implements LabelCache
Provides a label caching system based on the underlying data store.
Do not use this with a DOM based data store. It will cause concurrency problems.
- Author:
- Geoff Shuetrim (geoff@galexy.net)
- See Also:
- Serialized Form
|
Field Summary |
protected static org.apache.log4j.Logger |
logger
|
|
Method Summary |
void |
cacheLabel(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole,
String label,
boolean isFallbackLabel)
Caches the given label, replacing earlier versions of such label in the cache to
ensure that there is only ever one label in the cache that matches the selection
criteria. |
String |
getLabel(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole)
|
String |
getLabelWithoutFallback(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.apache.log4j.Logger logger
StoreLabelCache
public StoreLabelCache(Store store)
throws XBRLException
- Parameters:
store - The data store to use.
- Throws:
XBRLException
getLabel
public String getLabel(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole)
throws XBRLException
- Specified by:
getLabel in interface LabelCache
aspectId - the ID of the aspect - must not be null.valueId - The id of the aspect value - must not be null.locale - The XML language code - can be null.resourceRole - The label resource role - can be null.linkRole - The link role for the extended link containing the label - can be null.
- Returns:
- the label matching the parameters or null if there is no such label in the cache.
- Throws:
XBRLException- See Also:
LabelCache.getLabel(Class, URI, String, String, URI, URI)
getLabelWithoutFallback
public String getLabelWithoutFallback(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole)
throws XBRLException
- Specified by:
getLabelWithoutFallback in interface LabelCache
aspectId - the ID of the aspect - must not be null.valueId - The id of the aspect value - must not be null.locale - The XML language code - can be null.resourceRole - The label resource role - can be null.linkRole - The link role for the extended link containing the label - can be null.
- Returns:
- the label matching the parameters or null if there is no such label in the cache.
Fallback labels (those generated by a superclass of the specified aspect labeller) are not returned.
- Throws:
XBRLException- See Also:
LabelCache.getLabelWithoutFallback(Class, URI, String, String, URI, URI)
cacheLabel
public void cacheLabel(Class<?> labellerClass,
URI aspectId,
String valueId,
String locale,
URI resourceRole,
URI linkRole,
String label,
boolean isFallbackLabel)
throws XBRLException
- Description copied from interface:
LabelCache
- Caches the given label, replacing earlier versions of such label in the cache to
ensure that there is only ever one label in the cache that matches the selection
criteria.
- Specified by:
cacheLabel in interface LabelCache
aspectId - the ID of the aspect - must not be null.valueId - The id of the aspect value - must not be null.locale - The XML language code - can be null.resourceRole - The label resource role - can be null.linkRole - The link role for the extended link containing the label - can be null.label - The label to cache - must not be null.isFallbackLabel - true if the label is a fallback label and false otherwise.
- Throws:
XBRLException- See Also:
LabelCache.cacheLabel(Class, URI, String, String, URI, URI, String, boolean)