XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface Aspect

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseAspect, ConceptAspect, ContextAspect, DimensionAspect, EntityIdentifierAspect, ExplicitDimensionAspect, LocationAspect, PeriodAspect, QuarterlyPeriodAspect, ScenarioAspect, ScenarioRemainderAspect, SegmentAspect, SegmentRemainderAspect, TypedDimensionAspect, UnitAspect

public interface Aspect
extends Serializable

Author:
Geoff Shuetrim (geoff@galexy.net)

Field Summary
static String ENTITY_IDENTIFIER
           
static String LOCATION
           
static String PERIOD
           
static String SCENARIO
           
static String SEGMENT
           
static String UNIT
           
 
Method Summary
 void addFact(Fact fact)
          Adds the fact to the aspect, generating the aspect value, and storing the fact for later retrieval by that aspect value.
<A extends AspectValue>
void
addValue(A value)
           
 void clearFacts()
          Removes all facts from the aspect and all aspect values from the aspect.
 void clearSelectionCriterion()
          Sets the selection criterion to null.
 int getAncestorCount()
           
 AspectModel getAspectModel()
           
 String getAxis()
           
 int getDescendantCount()
           
 Set<Fact> getFacts(AspectValue value)
           
<F extends Fragment>
F
getFragment(Fact fact)
           
<F extends Fragment>
F
getFragmentFromStore(Fact fact)
           
 Iterator<AspectValue> getIterator()
           
 String getKey(Fact fact)
           
 Set<Fact> getMatchingFacts()
           
 AspectValue getSelectionCriterion()
           
 AspectValueTransformer getTransformer()
           
 String getType()
           
<A extends AspectValue>
A
getValue(Fact fact)
           
 AspectValue getValue(String id)
           
 List<AspectValue> getValues()
           
 List<AspectValue> getValuesByHierarchy()
           
 boolean hasSelectionCriterion()
           
 boolean hasValue(AspectValue value)
           
 boolean hasValue(String id)
           
 boolean isEmpty()
           
 boolean isMissing()
           
 boolean isOrphan()
           
 boolean isSingular()
           
 void setAspectModel(AspectModel aspectModel)
           
 void setAxis(String axis)
           
 void setSelectionCriterion(AspectValue criterion)
           
 void setTransformer(AspectValueTransformer transformer)
           
 int size()
           
 

Field Detail

PERIOD

static final String PERIOD
See Also:
Constant Field Values

ENTITY_IDENTIFIER

static final String ENTITY_IDENTIFIER
See Also:
Constant Field Values

SEGMENT

static final String SEGMENT
See Also:
Constant Field Values

SCENARIO

static final String SCENARIO
See Also:
Constant Field Values

UNIT

static final String UNIT
See Also:
Constant Field Values

LOCATION

static final String LOCATION
See Also:
Constant Field Values
Method Detail

getType

String getType()
               throws XBRLException
Returns:
the unique aspect identifier.
Throws:
XBRLException - if the aspect identifier cannot be determined.

isEmpty

boolean isEmpty()
Returns:
true if the aspect has no aspect values and false otherwise.

hasValue

boolean hasValue(AspectValue value)
                 throws XBRLException
Parameters:
value - The value to test for.
Returns:
true if the aspect has the given value
Throws:
XBRLException

isSingular

boolean isSingular()
Returns:
true if the aspect has just one aspect value and false otherwise.

isMissing

boolean isMissing()
                  throws XBRLException
Returns:
true if the aspect has just one aspect value that is the missing aspect value and false otherwise.
Throws:
XBRLException

getAxis

String getAxis()
Returns:
axis name or null if the aspect is an orphan (not assigned to an axis in the containing aspect model).

setAxis

void setAxis(String axis)
Parameters:
axis - the name of the axis or null if the aspect is to be an orphan.

isOrphan

boolean isOrphan()
Returns:
true if the aspect is in a dimension of the containing aspect model and false otherwise.

setAspectModel

void setAspectModel(AspectModel aspectModel)
                    throws XBRLException
Parameters:
aspectModel - the aspect model to assign this aspect to.
Throws:
XBRLException - if the aspect model is null.

getAspectModel

AspectModel getAspectModel()
Returns:
the aspect model with this aspect.

getValues

List<AspectValue> getValues()
Returns:
a list of the values for the aspect.

getValuesByHierarchy

List<AspectValue> getValuesByHierarchy()
                                       throws XBRLException
Returns:
a list of the values for the aspect, sorted on the basis of the aspect value hierarchy such that parent values come immediately before their child values.
Throws:
XBRLException

getValue

AspectValue getValue(String id)
Parameters:
id - the identifier generated from the value being sought.
Returns:
the aspect value that has the given identifier.
See Also:
AspectValue.getIdentifier()

hasValue

boolean hasValue(String id)
Parameters:
id - the identifier generated from the value being sought.
Returns:
true if the aspect model has a value with the given id.
See Also:
AspectValue.getIdentifier()

size

int size()
Returns:
the number of values for this aspect.

getIterator

Iterator<AspectValue> getIterator()
Returns:
an iterator over the ordered values for this aspect.

getDescendantCount

int getDescendantCount()
                       throws XBRLException
Returns:
the number of combinations of descendant aspect values (for those descendant aspects in the same dimension of the aspect model).
Throws:
XBRLException

getAncestorCount

int getAncestorCount()
                     throws XBRLException
Returns:
the number of combinations of ancestor aspect values (for those ancestor aspects in the same dimension of the aspect model).
Throws:
XBRLException

getTransformer

AspectValueTransformer getTransformer()
Returns:
the transformer responsible for converting a value for this aspect into a human readable string representation of that value.

setTransformer

void setTransformer(AspectValueTransformer transformer)
Parameters:
transformer - The aspect value transformer responsible for converting a value for this aspect into a human readable string representation of that value.

addValue

<A extends AspectValue> void addValue(A value)
              throws XBRLException
Parameters:
value - The aspect value to add to the aspect.
Throws:
XBRLException - if the aspect value cannot be added because its unique identifier cannot be obtained from the aspect value transformer.

addFact

void addFact(Fact fact)
             throws XBRLException
Adds the fact to the aspect, generating the aspect value, and storing the fact for later retrieval by that aspect value. The fact is not stored for this aspect if it does not have a value for this aspect.

Parameters:
fact - The fact to add.
Throws:
XBRLException.
XBRLException

getValue

<A extends AspectValue> A getValue(Fact fact)
                               throws XBRLException
Parameters:
fact - The fact to get the aspect value for
Returns:
the aspect value for the fact or the MissingAspectValue if the fact does not have a value for this aspect.
Throws:
XBRLException

getFragment

<F extends Fragment> F getFragment(Fact fact)
                               throws XBRLException
Parameters:
fact - the fact to get the fragment for.
Returns:
the fragment required to generate an aspect value from the fact or null if none is available.
Throws:
XBRLException

getFragmentFromStore

<F extends Fragment> F getFragmentFromStore(Fact fact)
                                        throws XBRLException
Parameters:
fact - The fact to get the fragment from.
Returns:
the fragment, retrieved from the data store, that is required to generate an aspect value for the fact; or null if the fragment is not available.
Throws:
XBRLException

getKey

String getKey(Fact fact)
              throws XBRLException
Parameters:
fact - The fact to get an aspect key for.
Returns:
the unique string identifying the fragment that is part of the aspect value for the given fact. This should be the empty string if the fact does not have a value for the aspect.
Throws:
XBRLException

getFacts

Set<Fact> getFacts(AspectValue value)
                   throws XBRLException
Parameters:
value - The aspect value to match
Returns:
the set of facts with the specified aspect value for this aspect.
Throws:
XBRLException - if the aspect value is not a value for this aspect.

getMatchingFacts

Set<Fact> getMatchingFacts()
                           throws XBRLException
Returns:
the set of facts matching the selection criterion set for this aspect or all facts if the selection criterion is cleared (null).
Throws:
XBRLException

hasSelectionCriterion

boolean hasSelectionCriterion()
Returns:
true if the aspect has a selection criterion aspect value and false if that criterion is null.

getSelectionCriterion

AspectValue getSelectionCriterion()
Returns:
the aspect value used by the aspect model for selecting facts based upon this aspect or null if no such criterion has been set.

setSelectionCriterion

void setSelectionCriterion(AspectValue criterion)
Parameters:
criterion - The selection criterion for this aspect.

clearSelectionCriterion

void clearSelectionCriterion()
Sets the selection criterion to null.


clearFacts

void clearFacts()
                throws XBRLException
Removes all facts from the aspect and all aspect values from the aspect. The aspect retains its map from aspect value IDs to aspect value labels, however.

Throws:
XBRLException

Get Java XBRL API implementation at SourceForge.net. Fast, secure and Free Open Source software downloads