XBRLAPI

A Java API for XBRL


org.xbrlapi.data
Interface Store

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseStoreImpl, StoreImpl, StoreImpl, StoreImpl, StoreImpl

public interface Store
extends Serializable

The data store interface, defining all methods that need to be implemented by a data store to support the XBRLAPI. The store constructor needs to initialise the data structure. For example, the constructor would be required to establish a database connection if an XML database is being used to handle the underlying data. Alternatively, the constructor would establish an XML DOM document if an XML DOM were being used as the underlying data structure. Similarly, initialisation steps would be taken if XML data binding to Java objects were being used to handle the underlying data.

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Method Summary
 void augmentNetworkForFragment(Fragment fragment, Network network)
          This method is recursive.
 void augmentNetworksForFragment(Fragment fragment, URI arcrole, Networks networks)
          This method is recursive.
 void clearFilteringURIs()
          Specify that the data store is not to filter query results to only come from a specified set of URIs.
 void close()
          Close the data store.
 void delete()
          Close and then delete the data store.
 void deleteDocument(URI uri)
          This deletion method does not ensure that all other documents that link to the document being deleted are also deleted.
 void deleteRelatedDocuments(URI uri)
          This deletion method ensures that all related documents are also deleted from the data store.
 Set<String> getAllFactIndices()
           
 List<Fact> getAllFacts()
           
 List<Fact> getAllFacts(URI uri)
           
 Analyser getAnalyser()
           
 Set<String> getArcIndices(String linkIndex)
           
 Set<String> getArcIndices(URI arcrole)
           
 Set<URI> getArcroles()
           
 Set<URI> getArcroles(URI linkRole)
           
 List<ArcroleType> getArcroleTypes()
           
 List<ArcroleType> getArcroleTypes(URI uri)
           
 List<Arc> getArcs(String linkIndex)
           
 List<Arc> getArcs(URI arcrole, String linkIndex)
           
<F extends Fragment>
List<F>
getChildFragments(Class<?> childClass, String parentIndex)
           
<F extends Fragment>
List<F>
getChildFragments(String interfaceName, String parentIndex)
          Deprecated.  
 Document getCompositeDocument()
          Get all data in the store as a single XML DOM object including the annotations used in the XBRLComposer project.
 Concept getConcept(URI namespace, String name)
           
 Element getDocumentAsDOM(URI uri)
          Get a single document in the store as a DOM.
 List<URI> getDocumentsToDiscover()
           
 Set<URI> getDocumentURIs()
          Get a list of the URIs that have been stored.
 Set<String> getExtendedLinkIndices(URI linkRole)
           
 List<ExtendedLink> getExtendedLinks(URI linkrole)
           
 Set<String> getFactIndices()
           
 List<Fact> getFacts()
           
 List<Fact> getFacts(Concept concept)
           
 List<Fact> getFacts(URI uri)
           
 List<Fact> getFacts(URI namespace, String localname)
           
 Set<URI> getFilteringURIs()
           
 Set<String> getFragmentIndices(String interfaceName)
           
 Set<String> getFragmentIndicesFromDocument(URI uri)
           
 Set<String> getFragmentIndicesFromDocument(URI uri, String interfaceName)
           
<F extends Fragment>
List<F>
getFragmentsFromDocument(URI uri, Class<?> fragmentClass)
           
<F extends Fragment>
List<F>
getFragmentsFromDocument(URI uri, String interfaceName)
          Utility method to return a list of fragments in a data store that have a type corresponding to the specified fragment interface name and that are in the document with the specified URI.
<D extends SchemaDeclaration>
D
getGlobalDeclaration(URI namespace, String name)
           
 String getId(String input)
           
 List<Item> getItems()
           
 List<Item> getItems(URI uri)
           
 List<LabelResource> getLabels(String fragment)
          Implemented by getLabels(String,URI,URI,String).
 List<LabelResource> getLabels(String fragment, String language)
          Implemented by getLabels(String,URI,URI,String).
 List<LabelResource> getLabels(String fragment, URI resourceRole)
          Implemented by getLabels(String,URI,URI,String).
 List<LabelResource> getLabels(String fragment, URI resourceRole, String language)
          Implemented by getLabels(String,URI,URI,String).
 List<LabelResource> getLabels(String fragment, URI linkRole, URI resourceRole, String language)
          If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of
 Language getLanguage(String encoding, String code)
           
 Map<String,Language> getLanguageMap(String code)
           
 List<Language> getLanguages(String code)
           
 Set<URI> getLinkRoles()
           
 Set<URI> getLinkRoles(URI arcrole)
           
 Matcher getMatcher()
           
 Network getMinimalNetwork(Set<Fragment> fragments, URI linkRole, URI arcrole)
           
 Networks getMinimalNetworksWithArcrole(Fragment fragment, URI arcrole)
          Convenience method for a single fragment.
 Networks getMinimalNetworksWithArcrole(Set<Fragment> fragments, URI arcrole)
          Get the networks that, at a minimum, contain the relationships from each of the given fragments working back through ancestor relationships as far as possible.
 Set<URI> getMinimumDocumentSet(Collection<URI> starters)
           
 Set<URI> getMinimumDocumentSet(URI uri)
          This is just a convenience method.
 Set<URI> getMissingDocumentURIs()
           
<F extends Fragment>
Set<F>
getNetworkRoots(URI linkRole, URI arcrole)
          This implementation is not as strict as the XBRL 2.1 specification requires but it is generally faster and delivers sensible results.
 Networks getNetworks()
          Note that this can massively overload resources if the data store is large because much of the information in the store will be reflected in -in-memory objects.
 Networks getNetworks(URI arcrole)
           
 Networks getNetworks(URI linkRole, URI arcrole)
           
 Networks getNetworksFrom(String sourceIndex)
          Implemented by getNetworksFrom(String,URI,URI).
 Networks getNetworksFrom(String sourceIndex, URI arcrole)
          Implemented by getNetworksFrom(String,URI,URI).
 Networks getNetworksFrom(String sourceIndex, URI linkRole, URI arcrole)
           
 Networks getNetworksTo(String targetIndex)
          Implemented by getNetworksTo(String,URI,URI).
 Networks getNetworksTo(String targetIndex, URI arcrole)
          Implemented by getNetworksTo(String,URI,URI).
 Networks getNetworksTo(String targetIndex, URI linkRole, URI arcrole)
          If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of
 long getNumberOfXMLResources(Class<?> specifiedClass)
           
 Set<URI> getReferencedDocuments(URI uri)
          Override this method in a data store implementation if the data store implementation supports XQuery (rather than XPath).
 List<ReferenceResource> getReferences(String fragment)
          Implemented by getReferences(String,URI,URI,String).
 List<ReferenceResource> getReferences(String fragment, String language)
          Implemented by getReferences(String,URI,URI,String).
 List<ReferenceResource> getReferences(String fragment, URI resourceRole)
          Implemented by getReferences(String,URI,URI,String).
 List<ReferenceResource> getReferences(String fragment, URI resourceRole, String language)
          Implemented by getReferences(String,URI,URI,String).
 List<ReferenceResource> getReferences(String fragment, URI linkRole, URI resourceRole, String language)
          If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of
 List<URI> getReferencingDocuments(URI uri)
           
 List<Fragment> getReferencingFragments(URI uri)
           
 SortedSet<Relationship> getRelationshipsFrom(String sourceIndex, URI linkRole, URI arcrole)
          If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of
 SortedSet<Relationship> getRelationshipsTo(String targetIndex, URI linkRole, URI arcrole)
           
 List<URI> getResourceRoles()
           
 List<RoleType> getRoleTypes()
           
 List<RoleType> getRoleTypes(URI uri)
           
<F extends Fragment>
F
getRootFragmentForDocument(URI uri)
           
 Set<String> getRootFragmentIndices(String interfaceName)
           
<F extends Fragment>
List<F>
getRootFragments()
           
<F extends Fragment>
List<F>
getRootFragments(String type)
           
 Schema getSchema(URI targetNamespace)
           
<F extends SchemaContent>
F
getSchemaContent(URI namespace, String name)
           
 int getSize()
           
 Set<String> getSourceIndices(String targetIndex, URI linkRole, URI arcrole)
           
<F extends Fragment>
List<F>
getSources(String targetIndex, URI linkRole, URI arcrole)
           
 Document getStoreAsDOM()
          Get all data in the store as a single XML DOM object.
 List<Stub> getStubs()
           
 List<Stub> getStubs(URI uri)
           
 Element getSubtree(Fragment f)
          Returns the root element of the subtree starting with the fragment with the specified index.
<F extends Fragment>
List<F>
getTargets(String sourceIndex, URI linkRole, URI arcrole)
           
 List<Tuple> getTuples()
           
 List<Tuple> getTuples(URI uri)
           
<F extends XML>
F
getXMLResource(String index)
          Retrieves an XML Resource from a data store.
<F extends XML>
List<F>
getXMLResources(Class<?> specifiedClass)
          Return a list of XML resources in a data store that have a type corresponding to the specified XML resource interface name.
<F extends XML>
List<F>
getXMLResources(String interfaceName)
          Return a list of XML resources in a data store that have a type corresponding to the specified XML resource interface name.
 boolean hasAllRelationships(URI document)
           
 boolean hasDocument(URI uri)
          Test if a particular URI is already in the data store.
 boolean hasXMLResource(String index)
          Test if a store contains a specific fragment, as identified by its index.
 boolean isFilteringByURIs()
           
 boolean isLoading()
           
 boolean isPersistingRelationships()
           
 void persist(XML xml)
          Store a fragment.
 void persistLoaderState(Map<URI,String> documents)
          Stores the state of the document discovery process.
 void persistStub(URI document, String reason)
           
 long queryCount(String query)
          This method must be synchronised
 Set<String> queryForIndices(String query)
          Run a query against the collection of all fragments in the store.
 String queryForString(String query)
          Run a query that is required to return a single string.
 Set<String> queryForStrings(String query)
          Run a query that is required to return a sequence of strings.
<F extends XML>
List<F>
queryForXMLResources(String query)
          Run a query against the collection of all fragments in the store.
 void recindLoadingRightsFor(Loader loader, URI document)
          Loaders need to call this method to indicate that they are recinding responsibility for loading the document.
 void remove(String index)
          Remove a fragment from the underlying data structure.
 void remove(XML xml)
          Remove a XML resource from the underlying data structure.
 void removeStub(Stub stub)
           
 boolean requestLoadingRightsFor(Loader loader, URI document)
          Loaders need to call this method to indicate that they are going to take responsibility for loading the document.
 void saveDocuments(File destination)
          Serializes the individual documents in the data store, saving them into a directory structure that is placed into the specified directory.
 void saveDocuments(File destination, String uriPrefix)
          Serializes those documents in the data store with a URI that begins with the specified URI prefix.
 void saveStoreAsSingleDocument(File file)
          Creates a single DOM structure from all documents in the data store and saves this single XML structure in the specified file.
 String serialize(Element what)
          Serialize the specified XML DOM node.
 void serialize(Element what, File destination)
          Serialize the specified XML DOM to the specified destination.
 void serialize(Element what, OutputStream destination)
          Serialize the specified XML DOM to the specified destination.
 void setAnalyser(Analyser analyser)
           
 void setFilteringURIs(Set<URI> uris)
           
 void setMatcher(Matcher matcher)
          Sets the matcher for the store to use.
 void setNamespaceBinding(URI namespace, String prefix)
           
 void startLoading(Loader loader)
           
 void stopLoading(Loader loader)
           
 void sync()
          Flush all database updates to the data store.
 

Method Detail

close

void close()
           throws XBRLException
Close the data store. This method must be synchronized. Throws XBRLException if the data store cannot be closed.

Throws:
XBRLException

persist

void persist(XML xml)
             throws XBRLException
Store a fragment. Implementations of this method must always be synchronized.

Parameters:
xml - The fragment to be added to the store.
Throws:
XBRLException - if the fragment cannot be added to the store.

hasXMLResource

boolean hasXMLResource(String index)
                       throws XBRLException
Test if a store contains a specific fragment, as identified by its index. Implementations of this method must be synchronized.

Parameters:
index - The index of the fragment to test for.
Returns:
true iff the store contains a fragment with the specified fragment index.
Throws:
XBRLException - If the test cannot be conducted.

getXMLResource

<F extends XML> F getXMLResource(String index)
                             throws XBRLException
Retrieves an XML Resource from a data store. Implementations of this method must be synchronized.

Parameters:
index - The index of the XML resource.
Returns:
The XML resource corresponding to the specified index.
Throws:
XBRLException - if the XML resource cannot be retrieved.

remove

void remove(String index)
            throws XBRLException
Remove a fragment from the underlying data structure. If a fragment with the same ID does not already exist in the data store then no action is required. Implementations of this method must be synchronized.

Parameters:
index - The index of the fragment to be removed from the DTS store.
Throws:
XBRLException - if the fragment cannot be removed from the store.

remove

void remove(XML xml)
            throws XBRLException
Remove a XML resource from the underlying data structure. If a XML resource with the same ID does not already exist in the data store then no action is required.

Parameters:
xml - The XML resource to remove.
Throws:
XBRLException - if the XML resource cannot be removed from the store.

setNamespaceBinding

void setNamespaceBinding(URI namespace,
                         String prefix)
                         throws XBRLException
Parameters:
namespace - The namespace to bind a prefix to for querying
prefix - The prefix to bind to the namespace for querying
Throws:
XBRLException - if either argument is null.

deleteDocument

void deleteDocument(URI uri)
                    throws XBRLException
This deletion method does not ensure that all other documents that link to the document being deleted are also deleted. This can cause relationships in the data store to be non-resolvable.

Parameters:
uri - The URI of the document to delete from the data store.
Throws:
XBRLException

deleteRelatedDocuments

void deleteRelatedDocuments(URI uri)
                            throws XBRLException
This deletion method ensures that all related documents are also deleted from the data store. A related document is defined as a document that causes the discovery of this document. Note that this means that applying this method to an XBRL instance only causes the XBRL instance to be deleted because no other documents cause discovery of this document. This method is intended to allow document deletions to occur without violating the closure property of a DTS. In otherwords, if you want to delete the specified document from the DTS defined by the content of the data store, you also delete all documents that would require it to be in the DTS.

Parameters:
uri - The URI of the document to delete.
Throws:
XBRLException

queryForXMLResources

<F extends XML> List<F> queryForXMLResources(String query)
                                         throws XBRLException
Run a query against the collection of all fragments in the store. Implementations of this method must be synchronized.

Parameters:
query - The XQuery query to run against the set of fragments. Any occurrences of the string #roots# in a query will be deemed to be a marker for the root elements of the fragments in an XML database collection and it will be substituted with the necessary expression to identify those roots in the data store.
Returns:
a list of matching fragments or the empty list if no matching fragments exist.
Throws:
XBRLException - if the query cannot be executed.

queryForIndices

Set<String> queryForIndices(String query)
                            throws XBRLException
Run a query against the collection of all fragments in the store. Implementations of this method must be synchronized.

Parameters:
query - The XQuery query to run against the set of fragments. Any occurrences of the string #roots# in a query will be deemed to be a marker for the root elements of the fragments in an XML database collection and it will be substituted with the necessary expression to identify those roots in the data store. The query MUST return a sequence of XML resource metadata root elements matching the query. Otherwise, results from the query will be unpredictable.
Returns:
a set of the indices of XML resources matching the query.
Throws:
XBRLException - if the query cannot be executed.

queryCount

long queryCount(String query)
                throws XBRLException
This method must be synchronised

Parameters:
query - The XQuery to run. Any occurrences of the string #roots# in a query will be deemed to be a marker for the root elements of the fragments in an XML database collection and it will be substituted with the necessary expression to identify those roots in the data store.
Returns:
a count of the number of results returned by the query.
Throws:
XBRLException - if the query cannot be executed.

queryForStrings

Set<String> queryForStrings(String query)
                            throws XBRLException
Run a query that is required to return a sequence of strings. Implementations of this method must be synchronized.

Parameters:
query - The XQuery query to run against the set of fragments. Any occurrences of the string #roots# in a query will be deemed to be a marker for the root elements of the fragments in an XML database collection and it will be substituted with the necessary expression to identify those roots in the data store.
Returns:
a list of strings, each of which is a query result.
Throws:
XBRLException - if the query cannot be executed or if the query results are not strings.

queryForString

String queryForString(String query)
                      throws XBRLException
Run a query that is required to return a single string. Implementations of this method must be synchronized.

Parameters:
query - The XQuery query to run against the set of fragments. Any occurrences of the string #roots# in a query will be deemed to be a marker for the root elements of the fragments in an XML database collection and it will be substituted with the necessary expression to identify those roots in the data store.
Returns:
a single string that is the query result or null if the query does not return any strings.
Throws:
XBRLException - if the query cannot be executed or if the query result is not a single string.

serialize

void serialize(Element what,
               OutputStream destination)
               throws XBRLException
Serialize the specified XML DOM to the specified destination.

Parameters:
what - the root element of the DOM to be serialised.
destination - The destination output stream to be serialised to.
Throws:
XBRLException - if the DOM cannot be serialised because the destination cannot be written to or some other different problem occurs during serialisation.

serialize

void serialize(Element what,
               File destination)
               throws XBRLException
Serialize the specified XML DOM to the specified destination.

Parameters:
what - the root element of the DOM to be serialised.
destination - The destination file to be serialised to.
Throws:
XBRLException - if the DOM cannot be serialised because the destination cannot be written to or some other different problem occurs during serialisation.

serialize

String serialize(Element what)
                 throws XBRLException
Serialize the specified XML DOM node.

Parameters:
what - the root element of the DOM to be serialised.
Returns:
a string containing the serialized XML.
Throws:
XBRLException

getDocumentAsDOM

Element getDocumentAsDOM(URI uri)
                         throws XBRLException
Get a single document in the store as a DOM.

Parameters:
uri - The URI of the document to be retrieved.
Returns:
a DOM Document containing the XML representation of the file at the specified URI. Returns null if the store does not contain a document with the given URI.
Throws:
XBRLException - if the document cannot be constructed as a DOM.

saveDocuments

void saveDocuments(File destination)
                   throws XBRLException
Serializes the individual documents in the data store, saving them into a directory structure that is placed into the specified directory. The directory structure that is created mirrors the structure of the URIs of the documents. Note that the URIs of the documents that are written out will be reflected in the paths to those documents using the same rules as those applied for document caching.

Parameters:
destination - The folder in which the directory structure and the documents in the data store are to be saved.
Throws:
XBRLException - If the root folder does not exist or is not a directory or if the documents in the store cannot be saved to the local file system.

saveDocuments

void saveDocuments(File destination,
                   String uriPrefix)
                   throws XBRLException
Serializes those documents in the data store with a URI that begins with the specified URI prefix. They are saved to the local file system in the same manner as is applied for the saveDocuments method that operates on all documents in the data store.

Parameters:
destination - The folder in which the directory structure and the documents in the data store are to be saved.
uriPrefix - All documents in the data store with a URI that begins with the string specified by uriPrefix will be saved to the local file system.
Throws:
XBRLException - If the root folder does not exist or is not a directory or if the documents in the store cannot be saved to the local file system.

saveStoreAsSingleDocument

void saveStoreAsSingleDocument(File file)
                               throws XBRLException
Creates a single DOM structure from all documents in the data store and saves this single XML structure in the specified file.

Parameters:
file - The file to save the Store content to.
Throws:
XBRLException - if the documents in the store cannot be saved to the single file.

getSubtree

Element getSubtree(Fragment f)
                   throws XBRLException
Returns the root element of the subtree starting with the fragment with the specified index. All subtrees for a given store instance are produced from the one XML DOM and so can be appended to each other as required.

Parameters:
f - The fragment at the root of the subtree.
Returns:
The root element of the subtree headed by the fragment with the specified index.
Throws:
XBRLException - if the subtree cannot be constructed.

getStoreAsDOM

Document getStoreAsDOM()
                       throws XBRLException
Get all data in the store as a single XML DOM object.

Returns:
the XML DOM representation of the XBRL information in the data store.
Throws:
XBRLException - if the DOM cannot be constructed.

getCompositeDocument

Document getCompositeDocument()
                              throws XBRLException
Get all data in the store as a single XML DOM object including the annotations used in the XBRLComposer project.

Returns:
the composed data store as a DOM object.
Throws:
XBRLException - if the composed data store cannot be constructed.

getDocumentURIs

Set<URI> getDocumentURIs()
                         throws XBRLException
Get a list of the URIs that have been stored.

Returns:
a list of the URIs in the data store.
Throws:
XBRLException - if the list cannot be constructed.

hasDocument

boolean hasDocument(URI uri)
                    throws XBRLException
Test if a particular URI is already in the data store.

Parameters:
uri - the string representation of the URI to be tested for.
Returns:
true if the document is in the store and false otherwise.
Throws:
XBRLException.
XBRLException

persistLoaderState

void persistLoaderState(Map<URI,String> documents)
                        throws XBRLException
Stores the state of the document discovery process.

Parameters:
documents - The map from URIs of the documents remaining to be discovered to the textual reason why the document has not yet been discovered.
Throws:
XBRLException

getSize

int getSize()
            throws XBRLException
Returns:
the number of fragments in the data store.
Throws:
XBRLException - if the number of fragments cannot be determined.

getDocumentsToDiscover

List<URI> getDocumentsToDiscover()
                                 throws XBRLException
Returns:
the list of URIs of the documents remaining to be analysed.
Throws:
XBRLException - if any of the document URIs are malformed.

getStubs

List<Stub> getStubs()
                    throws XBRLException
Returns:
a list of stub fragments (Those fragments indicating a document that needs to be added to the data store).
Throws:
XBRLException

getStubs

List<Stub> getStubs(URI uri)
                    throws XBRLException
Parameters:
uri - The string value of the URI of the document to get the stub for.
Returns:
the list of stub fragments for the given URI.
Throws:
XBRLException

persistStub

void persistStub(URI document,
                 String reason)
                 throws XBRLException
Parameters:
document - The document to store a stub for.
reason - The reason the document has not been stored.
Throws:
XBRLException

removeStub

void removeStub(Stub stub)
                throws XBRLException
Parameters:
stub - The stub to be removed from the data store.
Throws:
XBRLException

getXMLResources

<F extends XML> List<F> getXMLResources(String interfaceName)
                                    throws XBRLException
Return a list of XML resources in a data store that have a type corresponding to the specified XML resource interface name.

Parameters:
interfaceName - The name of the interface. EG: If a list of org.xbrlapi.impl.ReferenceArcImpl fragments is required then this parameter would have a value of "ReferenceArc". Note that if the parameter contains full stops, then it is used directly as the value for the fragment type, enabling fragment extensions to exploit this method without placing fragment implementations in the org.xbrlapi package.
Returns:
a list of XML resources with the given fragment type.
Throws:
XBRLException

getXMLResources

<F extends XML> List<F> getXMLResources(Class<?> specifiedClass)
                                    throws XBRLException
Return a list of XML resources in a data store that have a type corresponding to the specified XML resource interface name.

Parameters:
specifiedClass - The class of XML resources to retrieve.
Returns:
a list of XML resources with the given fragment type.
Throws:
XBRLException

getNumberOfXMLResources

long getNumberOfXMLResources(Class<?> specifiedClass)
                             throws XBRLException
Parameters:
specifiedClass - The class of XML resource to count.
Returns:
The number of XML resources of the given class type in the data store.
Throws:
XBRLException

getChildFragments

<F extends Fragment> List<F> getChildFragments(String interfaceName,
                                               String parentIndex)
                                           throws XBRLException
Deprecated. 

Parameters:
interfaceName - The name of the interface. EG: If a list of org.xbrlapi.impl.ReferenceArcImpl fragments is required then this parameter would have a value of "ReferenceArc". Note that this method does not yet recognise fragment subtypes so a request for an Arc would not return all ReferenceArcs as well as other types of arcs.
parentIndex - The index of the parent fragment.
Returns:
a list of fragments with the given fragment type and with the given parent fragment. The list is empty if there are not child fragments.
Throws:
XBRLException

getNetworks

Networks getNetworks(URI linkRole,
                     URI arcrole)
                     throws XBRLException
Parameters:
linkRole - The linkrole of the networks.
arcrole - The arcrole of the networks.
Returns:
the collection of networks expressed using arcs that involve this linkrole and arcrole.
Throws:
XBRLException

getNetworks

Networks getNetworks(URI arcrole)
                     throws XBRLException
Parameters:
arcrole - The XLink arcrole value.
Returns:
the collection of networks expressed using arcs that involve this arc role.
Throws:
XBRLException

getNetworks

Networks getNetworks()
                     throws XBRLException
Note that this can massively overload resources if the data store is large because much of the information in the store will be reflected in -in-memory objects. Use this method with care.

Returns:
the collection of all networks in the store.
Throws:
XBRLException

getTargets

<F extends Fragment> List<F> getTargets(String sourceIndex,
                                        URI linkRole,
                                        URI arcrole)
                                    throws XBRLException
Type Parameters:
F - The type of fragment.
Parameters:
sourceIndex - The index of the source fragment.
linkRole - The XLink link role.
arcrole - The XLink arcrole.
Returns:
the list of targets from the specified source where the relationship has the given link role and arcrole. If the link role is null then targets of relationships with any linkrole are returned. If the arcrole is null then targets of relationships with any arcrole are returned.
Throws:
XBRLException

getSources

<F extends Fragment> List<F> getSources(String targetIndex,
                                        URI linkRole,
                                        URI arcrole)
                                    throws XBRLException
Type Parameters:
F - The type of fragment.
Parameters:
targetIndex - The index of the target fragment.
linkRole - The XLink link role.
arcrole - The XLink arcrole.
Returns:
the set of sources related to the specified target where the relationship has the given link role and arcrole. If the link role is null then sources of relationships with any linkrole are returned. If the arcrole is null then sources of relationships with any arcrole are returned.
Throws:
XBRLException

getSourceIndices

Set<String> getSourceIndices(String targetIndex,
                             URI linkRole,
                             URI arcrole)
                             throws XBRLException
Parameters:
targetIndex - The index of the target fragment.
linkRole - The XLink link role.
arcrole - The XLink arcrole.
Returns:
the set of indices of sources related to the specified target where the relationship has the given link role and arcrole. If the link role is null then sources of relationships with any linkrole are returned. If the arcrole is null then indices of sources of relationships with any arcrole are returned.
Throws:
XBRLException

setAnalyser

void setAnalyser(Analyser analyser)
Parameters:
analyser - The persisted network analyser to use for network analysis when building the aspect model. Set to null if you do not want to build the aspect model using persisted network information.

getAnalyser

Analyser getAnalyser()
Returns:
the persisted network analyser if one is being used and null otherwise.

isPersistingRelationships

boolean isPersistingRelationships()
Returns:
true if the store is using persisted network information rather than using the raw network information embodied in XBRL fragments. Returns false otherwise.
See Also:
Analyser

getFragmentsFromDocument

<F extends Fragment> List<F> getFragmentsFromDocument(URI uri,
                                                      String interfaceName)
                                                  throws XBRLException
Utility method to return a list of fragments in a data store that have a type corresponding to the specified fragment interface name and that are in the document with the specified URI.

Parameters:
uri - The URI of the document to get the fragments from.
interfaceName - The name of the interface. EG: If a list of fragments is required then this parameter would have a value of "ReferenceArc". Note that this method does not yet recognise fragment subtypes so a request for an Arc would not return all ReferenceArcs as well as other types of arcs.
Returns:
a list of fragments with the given fragment type and in the given document.
Throws:
XBRLException

getFragmentsFromDocument

<F extends Fragment> List<F> getFragmentsFromDocument(URI uri,
                                                      Class<?> fragmentClass)
                                                  throws XBRLException
Parameters:
uri - The URI of the document to get the fragments from.
fragmentClass - The class of fragment being sought.
Returns:
a list of fragments in the given fragment class and in the given document.
Throws:
XBRLException
See Also:
getFragmentsFromDocument(URI, String)

getFragmentIndices

Set<String> getFragmentIndices(String interfaceName)
                               throws XBRLException
Parameters:
interfaceName - The name of the interface. EG: If a list of Concept fragments is required then this parameter would have a value of "Concept". Note that this method does not yet recognise fragment subtypes so a request for an ElementDeclaration would not return all concepts as well as other XML Schema element declarations.
Returns:
a list of fragment indices with the given fragment type.
Throws:
XBRLException

getRootFragmentIndices

Set<String> getRootFragmentIndices(String interfaceName)
                                   throws XBRLException
Parameters:
interfaceName - The name of the interface. EG: If a list of Concept fragments is required then this parameter would have a value of "Concept". Note that this method does not yet recognise fragment subtypes so a request for an ElementDeclaration would not return all concepts as well as other XML Schema element declarations.
Returns:
a list of root fragment indices with the given fragment type.
Throws:
XBRLException

getFragmentIndicesFromDocument

Set<String> getFragmentIndicesFromDocument(URI uri,
                                           String interfaceName)
                                           throws XBRLException
Parameters:
uri - The URI of the document to get the fragments from.
interfaceName - The name of the interface. EG: If a list of concept fragments is required then this parameter would have a value of "Concept". Note that this method does not yet recognise fragment subtypes so a request for an ElementDeclaration would not return all concepts as well as other XML Schema element declarations.
Returns:
a list of fragment indices with the given fragment type and in the given document.
Throws:
XBRLException

getFragmentIndicesFromDocument

Set<String> getFragmentIndicesFromDocument(URI uri)
                                           throws XBRLException
Parameters:
uri - The URI of the document to get the fragments from.
Returns:
a list of indices for fragments in the given document.
Throws:
XBRLException

getRootFragmentForDocument

<F extends Fragment> F getRootFragmentForDocument(URI uri)
                                              throws XBRLException
Type Parameters:
F - The fragment extension class
Parameters:
uri - The URI of the document to get the root fragment for.
Returns:
the root fragment of the document with the given URI or null if no root fragment is available for the given URI.
Throws:
XBRLException - if more than one root fragment is found in the data store.

getRootFragments

<F extends Fragment> List<F> getRootFragments()
                                          throws XBRLException
Type Parameters:
F - The fragment extension class
Returns:
the list of root fragments of the documents in the store.
Throws:
XBRLException - if more than one root fragment is found in the data store.

getRootFragments

<F extends Fragment> List<F> getRootFragments(String type)
                                          throws XBRLException
Type Parameters:
F - The fragment extension class
Parameters:
type - The type of fragment to select by. getXMLResources(String) gives details on how the type parameter is to be used.
Returns:
the list of root fragments of the documents in the store where the root fragments are of the specified type.
Throws:
XBRLException

delete

void delete()
            throws XBRLException
Close and then delete the data store. This method must be synchronized.

Throws:
XBRLException - if the data store cannot be deleted.

getId

String getId(String input)
             throws XBRLException
Parameters:
input - The string that may be used to generate the id.
Returns:
the ID to be used for storing XML resources in the data store. One of these IDs is generated for each document in the data store and then a counter is appended to that ID to get uniqueness for each fragment in that document. These IDs are also used for a variety of other kinds of XML resources stored in the data store.
Throws:
XBRLException

getLanguage

Language getLanguage(String encoding,
                     String code)
                     throws XBRLException
Parameters:
encoding - The code identifying the language that the name of the language is expressed in.
code - The code that identifies the language being named.
Returns:
the Language fragment that specifies the name of the language for the given code, expressed in the language identified by the encoding or null or if there is no matching language name in the data store. The input parameters are converted to upper case before processing.
Throws:
XBRLException - if either parameter equals null.

getLanguages

List<Language> getLanguages(String code)
                            throws XBRLException
Parameters:
code - The language code to get the language fragments for. The code is converted to upper case before processing.
Returns:
the list of language fragments giving names for the language associated with the specified language code.
Throws:
XBRLException - if the language code is null.

getLanguageMap

Map<String,Language> getLanguageMap(String code)
                                    throws XBRLException
Parameters:
code - The language code to get a map of language fragments for.
Returns:
a map of languages. Each fragment in the map is keyed by the fragment encoding and it is a fragment supplying a name in the encoding for the language identified by the code.
Throws:
XBRLException

setMatcher

void setMatcher(Matcher matcher)
                throws XBRLException
Sets the matcher for the store to use. Care should be taken to ensure that the one matcher is used for all documents in the store.

Parameters:
matcher - the matcher to use to identify identical resources.
Throws:
XBRLException - if the matcher is null;

getMatcher

Matcher getMatcher()
Returns:
the matcher used by the store to identify identical resources.

getReferencingDocuments

List<URI> getReferencingDocuments(URI uri)
                                  throws XBRLException
Parameters:
uri - The URI of the referenced document.
Returns:
a list of the URIs of the documents directly referencing the specified document as targets of their XLinks (custom or otherwise).
Throws:
XBRLException - if the list of referencing documents cannot be populated.

getReferencingFragments

List<Fragment> getReferencingFragments(URI uri)
                                       throws XBRLException
Parameters:
uri - The URI of the referenced document.
Returns:
a list of the fragments directly referencing the specified document as targets of their XLinks (custom or otherwise). The list is empty if there are no fragments with the specified URI as the target URI of their link.
Throws:
XBRLException.
XBRLException

getReferencedDocuments

Set<URI> getReferencedDocuments(URI uri)
                                throws XBRLException
Override this method in a data store implementation if the data store implementation supports XQuery (rather than XPath).

Parameters:
uri - The URI of the referencing document.
Returns:
a set of the documents directly referenced by this document.
Throws:
XBRLException - if the set of referenced documents cannot be populated.

setFilteringURIs

void setFilteringURIs(Set<URI> uris)
Parameters:
uris - The set of URIs to restrict query results to coming from. The set of URIs is set to the empty set if this parameter is null.

getFilteringURIs

Set<URI> getFilteringURIs()
Returns:
the set of URIs to filter query results. Empty set if no URIs are being used to filter query results.

clearFilteringURIs

void clearFilteringURIs()
Specify that the data store is not to filter query results to only come from a specified set of URIs.


isFilteringByURIs

boolean isFilteringByURIs()
Returns:
true if the data store is restricting query results to come from a specific set of documents and false otherwise.

sync

void sync()
          throws XBRLException
Flush all database updates to the data store.

Throws:
XBRLException - if the sync operation fails.

getFacts

List<Fact> getFacts()
                    throws XBRLException
Returns:
a list of all of the root-level facts in the data store (those facts that are children of the root element of an XBRL instance). Returns an empty list if no facts are found.
Throws:
XBRLException
See Also:
getFacts(), getAllFacts()

getFactIndices

Set<String> getFactIndices()
                           throws XBRLException
Returns:
a set of the indices of all root-level facts (those facts that are children of the root element of an XBRL instance). Returns an empty set if no such facts are found in the data store.
Throws:
XBRLException

getAllFactIndices

Set<String> getAllFactIndices()
                              throws XBRLException
Returns:
a set of the indices of all facts (including those facts that are children of tuples). Returns an empty set if no such facts are found in the data store.
Throws:
XBRLException

getItems

List<Item> getItems()
                    throws XBRLException
Returns:
a list of all of the items in the data store.
Throws:
XBRLException

getTuples

List<Tuple> getTuples()
                      throws XBRLException
Returns:
a list of all of the tuples in the data store.
Throws:
XBRLException

getSchema

Schema getSchema(URI targetNamespace)
                 throws XBRLException
Parameters:
targetNamespace - The target namespace of the schema.
Returns:
the root fragment of the schema or null if there are no schemas with the specified target namespace.
Throws:
XBRLException - if there is more than one schema with the given target namespace or if the target namespace is null.

getFacts

List<Fact> getFacts(URI uri)
                    throws XBRLException
Parameters:
uri - The URI of the document to get the facts from.
Returns:
a list of all of the root-level facts in the specified document.
Throws:
XBRLException

getAllFacts

List<Fact> getAllFacts(URI uri)
                       throws XBRLException
Parameters:
uri - The URI of the document to get the facts from.
Returns:
a list of all of the facts (root level and those nested in tuples) in the document with the specified URI.
Throws:
XBRLException

getAllFacts

List<Fact> getAllFacts()
                       throws XBRLException
Returns:
a list of all of the facts (root level and those nested in tuples) in the data store.
Throws:
XBRLException

getItems

List<Item> getItems(URI uri)
                    throws XBRLException
Parameters:
uri - The URI of the document to get the items from.
Returns:
a list of all of the root-level items in the data store.
Throws:
XBRLException

getTuples

List<Tuple> getTuples(URI uri)
                      throws XBRLException
Parameters:
uri - The URI of the document to get the facts from.
Returns:
a list of all of the root-level tuples in the specified document.
Throws:
XBRLException

getNetworkRoots

<F extends Fragment> Set<F> getNetworkRoots(URI linkRole,
                                            URI arcrole)
                                        throws XBRLException
This implementation is not as strict as the XBRL 2.1 specification requires but it is generally faster and delivers sensible results. It will only fail if people use the same link role and arc role but rely on arc or link element differences to distinguish networks.

Implementation strategy is:
1. Get all extended link elements with the given link role.
2. Get all arcs with the given arc role.
3. Get all resources at the source of the arcs.
4. Return only those source resources that that are not target resources also.

Parameters:
linkRole - the role on the extended links that contain the network arcs.
arcrole - the arcrole on the arcs describing the network.
Returns:
The list of fragments for each of the resources that is identified as a root of the specified network (noting that a root resource is defined as a resource that is at the source of one or more relationships in the network and that is not at the target of any relationships in the network).
Throws:
XBRLException

getConcept

Concept getConcept(URI namespace,
                   String name)
                   throws XBRLException
Parameters:
namespace - The namespace for the concept.
name - The local name for the concept.
Returns:
the concept fragment for the specified namespace and name.
Throws:
XBRLException - if more than one matching concept is found in the data store or if no matching concepts are found in the data store.

getGlobalDeclaration

<D extends SchemaDeclaration> D getGlobalDeclaration(URI namespace,
                                                     String name)
                                                 throws XBRLException
Parameters:
namespace - The target namespace for the schema containing the global declaration.
name - The local name for the global declaration.
Returns:
the declaration fragment with the specified namespace and name.
Throws:
XBRLException - if more than one matching declaration is found in the data store or if no matching declarations are found in the data store.

getArcroleTypes

List<ArcroleType> getArcroleTypes()
                                  throws XBRLException
Returns:
a list of arcroleType fragments
Throws:
XBRLException

getArcroleTypes

List<ArcroleType> getArcroleTypes(URI uri)
                                  throws XBRLException
Returns:
a list of arcroleType fragments with a given arcrole
Throws:
XBRLException

getRoleTypes

List<RoleType> getRoleTypes()
                            throws XBRLException
Returns:
a list of roleType fragments
Throws:
XBRLException

getRoleTypes

List<RoleType> getRoleTypes(URI uri)
                            throws XBRLException
Returns:
a list of RoleType fragments with a given role
Throws:
XBRLException

getResourceRoles

List<URI> getResourceRoles()
                           throws XBRLException
Returns:
a hash map indexed by resource roles that are used in extended links in the data store.
Throws:
XBRLException

getMinimumDocumentSet

Set<URI> getMinimumDocumentSet(Collection<URI> starters)
                               throws XBRLException
Parameters:
starters - The collection of URIs of the documents to use as starting points for analysis.
Returns:
set of URIs for the documents in the data store that are referenced, directly or indirectly, by any of the documents identified by the supplied collection of document URIs.
Throws:
XBRLException - if some of the referenced documents are not in the data store.

getMinimumDocumentSet

Set<URI> getMinimumDocumentSet(URI uri)
                               throws XBRLException
This is just a convenience method.

Parameters:
uri - The single document URI to use as starting points for analysis.
Returns:
set of URIs for the documents in the data store that are referenced, directly or indirectly, by the document identified by the supplied URI.
Throws:
XBRLException - if some of the referenced documents are not in the data store.

getExtendedLinks

List<ExtendedLink> getExtendedLinks(URI linkrole)
                                    throws XBRLException
Parameters:
linkrole - The required linkrole value.
Returns:
the list of extended links with the specified linkrole.
Throws:
XBRLException

getExtendedLinkIndices

Set<String> getExtendedLinkIndices(URI linkRole)
                                   throws XBRLException
Parameters:
linkRole - The link role to use to identify the extended links to retrieve.
Returns:
the list of indices of extended links with the given link role value.
Throws:
XBRLException

getArcs

List<Arc> getArcs(URI arcrole,
                  String linkIndex)
                  throws XBRLException
Parameters:
arcrole - The arcrole to use to identify the arcs to retrieve.
linkIndex - The index of the extended link containing the arcs to retrieve.
Returns:
the list of indices of arcs matching the selection criteria.
Throws:
XBRLException
XBRLException

getArcIndices

Set<String> getArcIndices(String linkIndex)
                          throws XBRLException
Parameters:
linkIndex - The index of the extended link containing the arcs to retrieve.
Returns:
the list of indices of arcs matching the selection criteria.
Throws:
XBRLException

getArcIndices

Set<String> getArcIndices(URI arcrole)
                          throws XBRLException
Parameters:
arcrole - The arcrole to use to identify the arcs to retrieve.
Returns:
the list of indices of arcs with a given arc role value.
Throws:
XBRLException

getArcs

List<Arc> getArcs(String linkIndex)
                  throws XBRLException
Parameters:
linkIndex - The index of the extended link containing the arcs to retrieve.
Returns:
the list of indices of arcs matching the selection criteria.
Throws:
XBRLException
XBRLException

getMinimalNetworksWithArcrole

Networks getMinimalNetworksWithArcrole(Set<Fragment> fragments,
                                       URI arcrole)
                                       throws XBRLException
Get the networks that, at a minimum, contain the relationships from each of the given fragments working back through ancestor relationships as far as possible. This is useful for building up networks of relationships where you know the leaf nodes you want and need to get the necessary branches back to the relevant heirarchy roots but do not want any branches leading to other leaf nodes. The method only generates networks using active relationships (not overridden or prohibited relationships).

Parameters:
fragments - The fragments to analyse.
arcrole - The required arcrole.
Returns:
The networks containing the relationships.
Throws:
XBRLException

getMinimalNetworksWithArcrole

Networks getMinimalNetworksWithArcrole(Fragment fragment,
                                       URI arcrole)
                                       throws XBRLException
Convenience method for a single fragment.

Throws:
XBRLException
See Also:
getMinimalNetworksWithArcrole(Set,URI)

getMinimalNetwork

Network getMinimalNetwork(Set<Fragment> fragments,
                          URI linkRole,
                          URI arcrole)
                          throws XBRLException
Parameters:
fragments - The set of target node fragments in the network.
linkRole - The network link role value.
arcrole - The network arcrole value.
Returns:
the network built out from relevant roots to the supplied fragments. Branches (and trees) with no nodes in them that correspond to the supplied fragments are not included in the returned network.
Throws:
XBRLException

augmentNetworkForFragment

void augmentNetworkForFragment(Fragment fragment,
                               Network network)
                               throws XBRLException
This method is recursive.

Parameters:
fragment - The fragment to use as the target for the relationships to be added to the networks.
network - The network that is to be augmented.
Throws:
XBRLException

augmentNetworksForFragment

void augmentNetworksForFragment(Fragment fragment,
                                URI arcrole,
                                Networks networks)
                                throws XBRLException
This method is recursive.

Parameters:
fragment - The fragment to use as the target for the relationships to be added to the networks.
arcrole - The arcrole for the networks to augment.
networks - The networks to augment.
Throws:
XBRLException

getArcroles

Set<URI> getArcroles()
                     throws XBRLException
Returns:
a list of arc roles that are used in extended links in the data store.
Throws:
XBRLException

getArcroles

Set<URI> getArcroles(URI linkRole)
                     throws XBRLException
Parameters:
linkRole - the specified linkrole to use in selecting arcroles.
Returns:
a list of arc roles that are used in extended links with the given link role.
Throws:
XBRLException - if any of the arcroles is not a valid URI.

getLinkRoles

Set<URI> getLinkRoles()
                      throws XBRLException
Returns:
a hash map indexed by link roles that are used in extended links in the data store.
Throws:
XBRLException

getLinkRoles

Set<URI> getLinkRoles(URI arcrole)
                      throws XBRLException
Parameters:
arcrole - The arcrole determining the extended links that are to be examined for linkroles that are used on links containing arcs with the required arcrole.
Returns:
a hashmap of link roles, with one entry for each link role that is used on an extended link that contains an arc with the required arcrole.
Throws:
XBRLException

getNetworksFrom

Networks getNetworksFrom(String sourceIndex,
                         URI arcrole)
                         throws XBRLException
Implemented by getNetworksFrom(String,URI,URI).

Parameters:
sourceIndex - The source fragment index
arcrole - The XLink arcrole
Returns:
a set of networks comprising the relationships from the source fragment with the given arcrole.
Throws:
XBRLException

getNetworksFrom

Networks getNetworksFrom(String sourceIndex)
                         throws XBRLException
Implemented by getNetworksFrom(String,URI,URI).

Parameters:
sourceIndex - The source fragment index
Returns:
a set of networks comprising the relationships from the source fragment.
Throws:
XBRLException

getNetworksFrom

Networks getNetworksFrom(String sourceIndex,
                         URI linkRole,
                         URI arcrole)
                         throws XBRLException
Parameters:
sourceIndex - The source fragment index
linkRole - The XLink link role
arcrole - The XLink arcrole
Returns:
a set of networks comprising the relationships from the source fragment with the given link role and arcrole.
Throws:
XBRLException

getNetworksTo

Networks getNetworksTo(String targetIndex,
                       URI linkRole,
                       URI arcrole)
                       throws XBRLException
If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of

Parameters:
targetIndex - The target fragment index
linkRole - The XLink link role or null if networks for all link roles are sought
arcrole - The XLink arcrole or null if networks for all arcroles are sought
Returns:
a set of networks comprising the relationships to the target fragment meeting the specified criteria.
Throws:
XBRLException

getNetworksTo

Networks getNetworksTo(String targetIndex,
                       URI arcrole)
                       throws XBRLException
Implemented by getNetworksTo(String,URI,URI).

Parameters:
targetIndex - The target fragment index
arcrole - The XLink arcrole
Returns:
a set of networks comprising the relationships to the target fragment with the given arcrole.
Throws:
XBRLException

getNetworksTo

Networks getNetworksTo(String targetIndex)
                       throws XBRLException
Implemented by getNetworksTo(String,URI,URI).

Parameters:
targetIndex - The target fragment index
Returns:
a set of networks comprising the relationships to the target fragment.
Throws:
XBRLException

getRelationshipsFrom

SortedSet<Relationship> getRelationshipsFrom(String sourceIndex,
                                             URI linkRole,
                                             URI arcrole)
                                             throws XBRLException
If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of

Parameters:
sourceIndex - The source fragment index
linkRole - The XLink link role
arcrole - The XLink arcrole
Returns:
a sorted set of active relationships from the source fragment with the given link role and arcrole that have been persisted. The relationships are ordered by the order attributes on the arcs expressing the relationships.
Throws:
XBRLException

hasAllRelationships

boolean hasAllRelationships(URI document)
                            throws XBRLException
Parameters:
document - The document URI.
Returns:
true if the store contains persisted relationships for all of the relationships expressed by the arcs in the specified document and false otherwise.
Throws:
XBRLException

getRelationshipsTo

SortedSet<Relationship> getRelationshipsTo(String targetIndex,
                                           URI linkRole,
                                           URI arcrole)
                                           throws XBRLException
Parameters:
targetIndex - The target fragment index
linkRole - The XLink link role
arcrole - The XLink arcrole
Returns:
a sorted set of active relationships to the target fragment with the given link role and arcrole. The relationships are ordered by the order attribute on the arcs expressing them. The linkRole and the arcrole are ignored as selection criteria if they are null.
Throws:
XBRLException

getLabels

List<LabelResource> getLabels(String fragment,
                              URI linkRole,
                              URI resourceRole,
                              String language)
                              throws XBRLException
If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of

Parameters:
fragment - the index of the fragment that we are getting labels for
linkRole - The required link role or null if not used.
resourceRole - The required resource role or null if not used.
language - The required language code or null if not used.
Returns:
the set of labels matching the specified criteria.
Throws:
XBRLException

getLabels

List<LabelResource> getLabels(String fragment,
                              URI resourceRole,
                              String language)
                              throws XBRLException
Implemented by getLabels(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting labels for
resourceRole - The required resource role or null if not used.
language - The required language code or null if not used.
Returns:
the set of labels matching the specified criteria.
Throws:
XBRLException

getLabels

List<LabelResource> getLabels(String fragment,
                              String language)
                              throws XBRLException
Implemented by getLabels(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting labels for
language - The required language code or null if not used.
Returns:
the set of labels matching the specified criteria.
Throws:
XBRLException

getLabels

List<LabelResource> getLabels(String fragment)
                              throws XBRLException
Implemented by getLabels(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting labels for
Returns:
the set of labels matching the specified criteria.
Throws:
XBRLException

getLabels

List<LabelResource> getLabels(String fragment,
                              URI resourceRole)
                              throws XBRLException
Implemented by getLabels(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting labels for
resourceRole - The required resource role or null if not used.
Returns:
the set of labels matching the specified criteria.
Throws:
XBRLException

getReferences

List<ReferenceResource> getReferences(String fragment,
                                      URI linkRole,
                                      URI resourceRole,
                                      String language)
                                      throws XBRLException
If using persisted relationships then the set of relationships used to generate the results can be modified by appropriate choice of

Parameters:
fragment - the index of the fragment that we are getting references for
linkRole - The required link role or null if not used.
resourceRole - The required resource role or null if not used.
language - The required language code or null if not used.
Returns:
the set of references matching the specified criteria.
Throws:
XBRLException

getReferences

List<ReferenceResource> getReferences(String fragment,
                                      URI resourceRole,
                                      String language)
                                      throws XBRLException
Implemented by getReferences(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting references for
resourceRole - The required resource role or null if not used.
language - The required language code or null if not used.
Returns:
the set of references matching the specified criteria.
Throws:
XBRLException

getReferences

List<ReferenceResource> getReferences(String fragment,
                                      String language)
                                      throws XBRLException
Implemented by getReferences(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting references for
language - The required language code or null if not used.
Returns:
the set of references matching the specified criteria.
Throws:
XBRLException

getReferences

List<ReferenceResource> getReferences(String fragment)
                                      throws XBRLException
Implemented by getReferences(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting references for
Returns:
the set of references matching the specified criteria.
Throws:
XBRLException

getReferences

List<ReferenceResource> getReferences(String fragment,
                                      URI resourceRole)
                                      throws XBRLException
Implemented by getReferences(String,URI,URI,String).

Parameters:
fragment - the index of the fragment that we are getting references for
resourceRole - The required resource role or null if not used.
Returns:
the set of references matching the specified criteria.
Throws:
XBRLException

getMissingDocumentURIs

Set<URI> getMissingDocumentURIs()
                                throws XBRLException
Returns:
a list of the URIs of documents that are discoverable given the content of the data store but that are not themselves in the data store.
Throws:
XBRLException

requestLoadingRightsFor

boolean requestLoadingRightsFor(Loader loader,
                                URI document)
                                throws XBRLException
Loaders need to call this method to indicate that they are going to take responsibility for loading the document. This can be used to prevent the same document from being loaded by several loaders operating in parallel.

Parameters:
loader - The loader claiming loading rights.
document - The URI of the document that a loader is about to start loading.
Returns:
false if the document is already claimed by a different loader and true otherwise. Only start loading if this function returns true.
Throws:
XBRLException

recindLoadingRightsFor

void recindLoadingRightsFor(Loader loader,
                            URI document)
Loaders need to call this method to indicate that they are recinding responsibility for loading the document. This can be used to prevent the same document from being loaded by several loaders operating in parallel.

Parameters:
loader - The loader recinding loading rights.
document - The URI of the document whose loading rights are being recinded.

startLoading

void startLoading(Loader loader)
Parameters:
loader - The loader that has started to use this store for data loading.

stopLoading

void stopLoading(Loader loader)
Parameters:
loader - The loader that has stopped using this store for data loading.

isLoading

boolean isLoading()
Returns:
true if the store is currently being used by any loader for loading data.

getSchemaContent

<F extends SchemaContent> F getSchemaContent(URI namespace,
                                             String name)
                                         throws XBRLException
Parameters:
namespace - The target namespace of the schema with the desired content.
name - The name given to the schema component.
Returns:
The Schema content fragment that contains the declaration of the desired XML Schema component or null if no such fragment is in the data store.
Throws:
XBRLException

getChildFragments

<F extends Fragment> List<F> getChildFragments(Class<?> childClass,
                                               String parentIndex)
                                           throws XBRLException
Parameters:
childClass - The class of child fragment.
parentIndex - The index of the parent fragment.
Returns:
a list of fragments in the given fragment class and with the given parent fragment. The list is empty if there are no child fragments.
Throws:
XBRLException

getFacts

List<Fact> getFacts(URI namespace,
                    String localname)
                    throws XBRLException
Parameters:
namespace - The namespace of the facts to select.
localname - The local name of the facts to select.
Returns:
the list of facts with the given namespace and local name in the data store.
Throws:
XBRLException - if either parameter is null.

getFacts

List<Fact> getFacts(Concept concept)
                    throws XBRLException
Parameters:
concept - The concept to get the facts for.
Returns:
the list of facts in the data store reporting values for the specified concept.
Throws:
XBRLException - if the parameter is null.

Get Java XBRL API implementation at SourceForge.net.