public class AspectModelImpl extends java.lang.Object implements AspectModel
Constructor and Description |
---|
AspectModelImpl(Store store) |
Modifier and Type | Method and Description |
---|---|
void |
addAspect(Aspect aspect)
The aspect will be added as the last aspect in the default axis.
|
void |
addAspect(Aspect parentAspect,
Aspect aspect)
The aspect will be added to the aspect model in the default axis and it
will be immediately follow the parent aspect ID in the list of aspects
associated with the default axis if that axis has the parent aspect in
it.
|
void |
addAspect(java.lang.String axis,
Aspect aspect)
The aspect will be added as the last aspect in the given axis.
|
void |
addAspect(java.lang.String axis,
Aspect parentAspect,
Aspect aspect)
The aspect will be added to the aspect model in the specified axis and it
will be immediately follow the parent aspect ID in the list of aspects
associated with the given axis if that axis has the parent aspect in it.
|
boolean |
axisContainsAspect(java.lang.String axis,
java.lang.String aspectId) |
AspectModel |
duplicate() |
Aspect |
getAspect(java.lang.String aspectId) |
java.lang.String |
getAspectLabel(java.lang.String aspectId,
java.lang.String locale,
java.lang.String resourceRole,
java.lang.String linkRole)
This is a convenience method to give access to the labels generated by
the labellers for each aspect in the aspect model.
|
java.lang.String |
getAspectLabelGivenLists(java.lang.String aspectId,
java.util.List<java.lang.String> locales,
java.util.List<java.lang.String> resourceRoles,
java.util.List<java.lang.String> linkRoles)
This is a convenience method to give access to the labels generated by
the labellers for each aspect in the aspect model.
|
java.util.Collection<Aspect> |
getAspects() |
java.util.List<Aspect> |
getAspects(java.lang.String axis) |
java.lang.String |
getAspectValueLabel(AspectValue value,
java.lang.String locale,
java.lang.String resourceRole,
java.lang.String linkRole)
This is a convenience method to give access to the labels generated by
the labellers for the values of each aspect in the aspect model.
|
java.lang.String |
getAspectValueLabelGivenLists(AspectValue value,
java.util.List<java.lang.String> locales,
java.util.List<java.lang.String> resourceRoles,
java.util.List<java.lang.String> linkRoles)
This is a convenience method to give access to the labels generated by
the labellers for the values of each aspect in the aspect model.
|
java.util.Map<java.lang.String,AspectValue> |
getAspectValues(Fact fact) |
java.util.Map<java.lang.String,AspectValue> |
getAspectValuesFromContext(Context context) |
java.util.Map<java.lang.String,AspectValue> |
getAspectValuesFromContext(Context context,
java.util.Map<java.lang.String,AspectValue> existingValues) |
java.util.Map<java.lang.String,AspectValue> |
getAspectValuesFromFact(Fact fact,
java.util.Map<java.lang.String,AspectValue> existingValues) |
java.util.Map<java.lang.String,AspectValue> |
getAspectValuesFromUnit(Unit unit) |
java.util.Map<java.lang.String,AspectValue> |
getAspectValuesFromUnit(Unit unit,
java.util.Map<java.lang.String,AspectValue> existingValues) |
java.util.Set<java.lang.String> |
getAxes() |
java.lang.String |
getDefaultAxis() |
Labeller |
getLabeller(java.lang.String aspectId) |
boolean |
hasAspect(java.lang.String aspectId) |
boolean |
hasAxis(java.lang.String axis) |
boolean |
hasLabeller(java.lang.String aspectId) |
void |
initialise()
Initialises the aspects and the aspect value labellers
in the aspect model.
|
void |
moveAspects(java.lang.String originalAxis,
java.lang.String newAxis) |
void |
setDefaultAxis(java.lang.String defaultAxis) |
void |
setLabeller(java.lang.String aspectId,
Labeller labeller) |
public AspectModelImpl(Store store) throws XBRLException
store
- The data store required to create domains for some aspects.XBRLException
- if the store is null.public void initialise() throws XBRLException
AspectModel
initialise
in interface AspectModel
XBRLException
AspectModel.initialise()
public java.lang.String getDefaultAxis()
getDefaultAxis
in interface AspectModel
AspectModel.getDefaultAxis()
public void setDefaultAxis(java.lang.String defaultAxis)
setDefaultAxis
in interface AspectModel
defaultAxis
- the axis to add aspects to by default.AspectModel.setDefaultAxis(String)
public boolean hasAxis(java.lang.String axis)
hasAxis
in interface AspectModel
axis
- the axis.AspectModel.hasAxis(String)
public boolean hasAspect(java.lang.String aspectId)
hasAspect
in interface AspectModel
aspectId
- the aspect ID.AspectModel.hasAspect(String)
public Aspect getAspect(java.lang.String aspectId) throws XBRLException
getAspect
in interface AspectModel
aspectId
- the aspect ID.XBRLException
- if the aspect is not in the model.AspectModel.getAspect(String)
public java.util.Collection<Aspect> getAspects() throws XBRLException
getAspects
in interface AspectModel
XBRLException
AspectModel.getAspects()
public java.util.List<Aspect> getAspects(java.lang.String axis)
getAspects
in interface AspectModel
axis
- The unique (for the aspect model) identifier for an axis of
the aspect model. Aspect models can have zero or more axes,
each of which has an ordered sequence of aspects.AspectModel.getAspects(String)
public boolean axisContainsAspect(java.lang.String axis, java.lang.String aspectId)
axisContainsAspect
in interface AspectModel
axis
- The axisaspectId
- the aspectAspectModel.axisContainsAspect(String, String)
public void addAspect(java.lang.String axis, Aspect aspect)
AspectModel
addAspect
in interface AspectModel
axis
- the axis to put the aspect in, in last place in the ordering.aspect
- The aspect to add to the aspect model.AspectModel.addAspect(String, Aspect)
public void addAspect(Aspect aspect)
AspectModel
addAspect
in interface AspectModel
aspect
- The aspect to add to the aspect model.AspectModel.addAspect(Aspect)
public void addAspect(java.lang.String axis, Aspect parentAspect, Aspect aspect) throws XBRLException
AspectModel
addAspect
in interface AspectModel
axis
- the axis to put the aspect in.parentAspect
- The parent aspect for the aspect being added.aspect
- The aspect to add to the aspect model.XBRLException
AspectModel.addAspect(String, Aspect, Aspect)
public Labeller getLabeller(java.lang.String aspectId) throws XBRLException
getLabeller
in interface AspectModel
aspectId
- The ID of the aspect to get the labeller for.XBRLException
- if the aspect ID is null.AspectModel.getLabeller(String)
public boolean hasLabeller(java.lang.String aspectId)
hasLabeller
in interface AspectModel
aspectId
- The ID of the aspect.AspectModel.hasLabeller(String)
public void setLabeller(java.lang.String aspectId, Labeller labeller) throws XBRLException
setLabeller
in interface AspectModel
aspectId
- The ID of the aspect that the labeller is to be used for.labeller
- The labeller to use.XBRLException
- if a parameter is null or if the labeller is not
for the specified aspect.AspectModel.setLabeller(String, Labeller)
public void addAspect(Aspect parentAspect, Aspect aspect) throws XBRLException
AspectModel
addAspect
in interface AspectModel
parentAspect
- The parent aspect for the aspect being added.aspect
- The aspect to add to the aspect model.XBRLException
AspectModel.addAspect(Aspect, Aspect)
public java.util.Set<java.lang.String> getAxes() throws XBRLException
getAxes
in interface AspectModel
XBRLException
AspectModel.getAxes()
public java.util.Map<java.lang.String,AspectValue> getAspectValues(Fact fact) throws XBRLException
getAspectValues
in interface AspectModel
fact
- The fact to get the aspect values for.XBRLException
AspectModel.getAspectValues(Fact)
public java.util.Map<java.lang.String,AspectValue> getAspectValuesFromFact(Fact fact, java.util.Map<java.lang.String,AspectValue> existingValues) throws XBRLException
getAspectValuesFromFact
in interface AspectModel
fact
- The fact to get the aspect values for.existingValues
- The map of aspect values that we already have and so do not
need to get now.XBRLException
AspectModel.getAspectValuesFromFact(Fact, Map)
public java.util.Map<java.lang.String,AspectValue> getAspectValuesFromContext(Context context) throws XBRLException
getAspectValuesFromContext
in interface AspectModel
context
- The context to determine the aspect values from.XBRLException
AspectModel.getAspectValuesFromContext(Context)
public java.util.Map<java.lang.String,AspectValue> getAspectValuesFromContext(Context context, java.util.Map<java.lang.String,AspectValue> existingValues) throws XBRLException
getAspectValuesFromContext
in interface AspectModel
context
- The context to get the aspect values for.existingValues
- The map of aspect values that we already have and so do not
need to get now.XBRLException
AspectModel.getAspectValuesFromContext(Context, Map)
public java.util.Map<java.lang.String,AspectValue> getAspectValuesFromUnit(Unit unit) throws XBRLException
getAspectValuesFromUnit
in interface AspectModel
unit
- The unit to determine the aspect values from.XBRLException
AspectModel.getAspectValuesFromUnit(Unit)
public java.util.Map<java.lang.String,AspectValue> getAspectValuesFromUnit(Unit unit, java.util.Map<java.lang.String,AspectValue> existingValues) throws XBRLException
getAspectValuesFromUnit
in interface AspectModel
unit
- The unit to get the aspect values for.existingValues
- The map of aspect values that we already have and so do not
need to get now.XBRLException
AspectModel.getAspectValuesFromUnit(Unit, Map)
public void moveAspects(java.lang.String originalAxis, java.lang.String newAxis) throws XBRLException
moveAspects
in interface AspectModel
originalAxis
- The axis to move the aspects fromnewAxis
- The axis to move the aspects toXBRLException
- if the original axis does not exist.AspectModel.moveAspects(String, String)
public AspectModel duplicate() throws XBRLException
duplicate
in interface AspectModel
XBRLException
- if the aspect model does not support duplication.AspectModel.duplicate()
public java.lang.String getAspectLabel(java.lang.String aspectId, java.lang.String locale, java.lang.String resourceRole, java.lang.String linkRole) throws XBRLException
AspectModel
getAspectLabel
in interface AspectModel
aspectId
- the ID of the aspect being labelled.locale
- The label localeresourceRole
- The label XLink resource rolelinkRole
- The label link roleXBRLException
- if the aspect is not in the aspect model.AspectModel.getAspectLabel(String, String, String, String)
public java.lang.String getAspectLabelGivenLists(java.lang.String aspectId, java.util.List<java.lang.String> locales, java.util.List<java.lang.String> resourceRoles, java.util.List<java.lang.String> linkRoles) throws XBRLException
AspectModel
getAspectLabelGivenLists
in interface AspectModel
aspectId
- the ID of the aspect being labelled.locales
- The label localeresourceRoles
- The label XLink resource rolelinkRoles
- The label link roleXBRLException
- if the aspect is not in the aspect model.AspectModel.getAspectValueLabelGivenLists(AspectValue, List, List, List)
public java.lang.String getAspectValueLabel(AspectValue value, java.lang.String locale, java.lang.String resourceRole, java.lang.String linkRole) throws XBRLException
AspectModel
getAspectValueLabel
in interface AspectModel
value
- The aspect valuelocale
- The label localeresourceRole
- The label XLink resource rolelinkRole
- The label link roleXBRLException
- if the aspect is not in the aspect model.AspectModel.getAspectValueLabel(AspectValue, String, String, String)
public java.lang.String getAspectValueLabelGivenLists(AspectValue value, java.util.List<java.lang.String> locales, java.util.List<java.lang.String> resourceRoles, java.util.List<java.lang.String> linkRoles) throws XBRLException
AspectModel
getAspectValueLabelGivenLists
in interface AspectModel
value
- The aspect valuelocales
- The list of label locales from first, most preferred to last,
least preferred. The list can include nulls or it can be null.resourceRoles
- The list of label XLink resource roles from first, most
preferred to last, least preferred. The list can include nulls
or it can be null.linkRoles
- The label link role from first, most preferred to last, least
preferred. The list can include nulls or it can be null.XBRLException
- if the aspect is not in the aspect model.AspectModel.getAspectValueLabelGivenLists(AspectValue, List, List, List)