XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface Labeller

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseLabeller, CachingLabeller, ConceptLabeller, EntityLabeller, ExplicitDimensionLabeller, LabellerImpl, LocationLabeller, PeriodLabeller, PeriodLabellerNaive, PeriodLabellerQuarters, ScenarioLabeller, ScenarioRemainderLabeller, SegmentLabeller, SegmentRemainderLabeller, TupleLabeller, TypedDimensionLabeller, UnitLabeller

public interface Labeller
extends Serializable

Labeller

Classes implementing the Labeller interface are intended to provide access to labels for aspects and their values.

The implementation of a labeller will be specific to one or more particular types of aspect. The constructor for the labeller MUST throw an exception if the labeller is initialised with an aspect that is not of the right type.

Author:
Geoff Shuetrim (geoff@galexy.net)

Method Summary
 Labeller duplicate()
           
 Aspect getAspect()
           
 String getAspectLabel(String locale, URI resourceRole, URI linkRole)
           
 String getAspectLabelWithoutFallback(String locale, URI resourceRole, URI linkRole)
           
 String getAspectValueLabel(AspectValue value, List<String> locales, List<URI> resourceRoles, List<URI> linkRoles)
           
 String getAspectValueLabel(AspectValue value, String locale, URI resourceRole, URI linkRole)
           
 String getAspectValueLabelWithoutFallback(AspectValue value, String locale, URI resourceRole, URI linkRole)
           
 Domain getDomain()
           
 Store getStore()
           
 

Method Detail

getAspect

Aspect getAspect()
Returns:
the aspect that this is a labeller for.

getDomain

Domain getDomain()
Returns:
the domain for the aspect that this is a labeller for.

getStore

Store getStore()
               throws XBRLException
Returns:
the store underpinning the domain for the aspect that this is a labeller for.
Throws:
XBRLException

getAspectLabel

String getAspectLabel(String locale,
                      URI resourceRole,
                      URI linkRole)
Parameters:
locale - The locale (language code etc) of the label. Set to null if the label is not locale dependent.
resourceRole - The resource role of the XLink resource providing the label. Set to null if the label does not depend on the resource role.
linkRole - The link role of the extended link network that is to be analysed to obtain the label. Set to null if the label does not depend on the link role.
Returns:
the label for the aspect based upon the given parameters, falling back to labels generated by superclass labellers where necessary, eventually using just the aspect ID if that is all that is available.

getAspectLabelWithoutFallback

String getAspectLabelWithoutFallback(String locale,
                                     URI resourceRole,
                                     URI linkRole)
Parameters:
locale - The locale (language code etc) of the label. Set to null if the label is not locale dependent.
resourceRole - The resource role of the XLink resource providing the label. Set to null if the label does not depend on the resource role.
linkRole - The link role of the extended link network that is to be analysed to obtain the label. Set to null if the label does not depend on the link role.
Returns:
the label for the aspect based upon the given parameters or null if no such label exists.

getAspectValueLabel

String getAspectValueLabel(AspectValue value,
                           String locale,
                           URI resourceRole,
                           URI linkRole)
Parameters:
value - The aspect value to get a label for.
locale - The locale (language code) of the label. This can be set to null if the label is not locale dependent.
resourceRole - The resource role of the XLink resource providing the label. This can be set to null if the label does not depend on the resource role.
linkRole - The link role of the extended link network that is to be analysed to obtain the label. This can be set to null if the label does not depend on the link role.
Returns:
the label for the aspect value based upon the given parameters, falling back to labels generated by superclass labellers where necessary, eventually using just the aspect value ID if that is all that is available.

getAspectValueLabel

String getAspectValueLabel(AspectValue value,
                           List<String> locales,
                           List<URI> resourceRoles,
                           List<URI> linkRoles)
Parameters:
value - The aspect value to get the label for.
locales - The list of locales, from first (most preferred) to last (least preferred) or null if locale is not a selection criterion.
resourceRoles - The list of label resource roles, from first (most preferred) to last (least preferred) or null if resource role is not a selection criterion.
linkRoles - The list of extended link roles, from first (most preferred) to last (least preferred) or null if link role is not a selection criterion.
Returns:
the label that best fits the selection criteria, falling back to the label provided by the superclass (eventually this is just the aspect value ID in a worst case situation).

The selection criteria are prioritised as follows: try hardest to match locale. After that, try hardest to match resource role. Try least hard to match the extended link role.


getAspectValueLabelWithoutFallback

String getAspectValueLabelWithoutFallback(AspectValue value,
                                          String locale,
                                          URI resourceRole,
                                          URI linkRole)
Parameters:
value - The aspect value to get a label for.
locale - The locale (language code) of the label. This can be set to null if the label is not locale dependent.
resourceRole - The resource role of the XLink resource providing the label. This can be set to null if the label does not depend on the resource role.
linkRole - The link role of the extended link network that is to be analysed to obtain the label. This can be set to null if the label does not depend on the link role.
Returns:
the label for the aspect value based upon the given parameters, without falling back to the label obtained by the superclass, if no label can be obtained. If no label is obtained, a value of null is returned.

duplicate

Labeller duplicate()
                   throws XBRLException
Returns:
a new labeller that is a duplicate of this one. The aspect is not duplicated (the original is used).
Throws:
XBRLException - if the labeller does not support duplication.

Get Java XBRL API implementation at SourceForge.net.