XBRLAPI

A Java API for XBRL


org.xbrlapi.data.resource
Class InStoreMatcherImpl

java.lang.Object
  extended by org.xbrlapi.data.resource.BaseMatcherImpl
      extended by org.xbrlapi.data.resource.InStoreMatcherImpl
All Implemented Interfaces:
Serializable, Matcher

public class InStoreMatcherImpl
extends BaseMatcherImpl
implements Matcher

The in-store resource matcher implementation, for use with the persistent store implementations. This matcher MUST use the store that it is doing the matching for.

Author:
Geoffrey Shuetrim (geoff@galexy.net)
See Also:
Serialized Form

Constructor Summary
InStoreMatcherImpl(Store store, Cache cache)
           
 
Method Summary
 URI delete(URI uri)
          Deletes the given URI from the matcher.
 boolean equals(Object obj)
           
 List<URI> getAllMatchingURIs(URI uri)
           
 URI getMatch(URI uri)
          As a side effect, this method adds the specified URI to the matcher.
 Store getStore()
           
 boolean hasURI(URI uri)
           
 
Methods inherited from class org.xbrlapi.data.resource.BaseMatcherImpl
getCache, getResourceContent, getResourceContent, getSignature, getSigner, hashCode, setCache, setSigner
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xbrlapi.data.resource.Matcher
getSignature, setSigner
 

Constructor Detail

InStoreMatcherImpl

public InStoreMatcherImpl(Store store,
                          Cache cache)
                   throws XBRLException
Parameters:
store - The data store to use for persisting resource matches
cache - The resource cache to be used by the matcher when accessing resources to determine their signature.
Throws:
XBRLException - if the cache parameter is null.
Method Detail

getStore

public Store getStore()
Returns:
the store used by this matcher.

getMatch

public URI getMatch(URI uri)
             throws XBRLException
Description copied from interface: Matcher
As a side effect, this method adds the specified URI to the matcher.

Specified by:
getMatch in interface Matcher
Parameters:
uri - The URI of the resource to be tested for a match.
Returns:
the URI of the matching resource in the data store if one exists and the original URI otherwise (because it becomes the matching URI in the data store).
Throws:
XBRLException
See Also:
Matcher.getMatch(URI)

getAllMatchingURIs

public List<URI> getAllMatchingURIs(URI uri)
                             throws XBRLException
Specified by:
getAllMatchingURIs in interface Matcher
Parameters:
uri - The URI of the resource to be tested for a match.
Returns:
a list of all URIs that match the given URI, including the given URI.
Throws:
XBRLException
See Also:
Matcher.getAllMatchingURIs(java.net.URI)

delete

public URI delete(URI uri)
           throws XBRLException
Description copied from interface: Matcher
Deletes the given URI from the matcher.

Specified by:
delete in interface Matcher
Parameters:
uri - The URI to delete.
Returns:
the new match URI for documents that used to match the given URI or null if there is none.
Throws:
XBRLException - if the URI is null.
See Also:
Matcher.delete(URI)

hasURI

public boolean hasURI(URI uri)
               throws XBRLException
Specified by:
hasURI in interface Matcher
Parameters:
uri - The URI to test.
Returns:
true if the matcher has a URI that is a match for the given URI (this match may be the URI itself).
Throws:
XBRLException
See Also:
Matcher.hasURI(java.net.URI)

equals

public boolean equals(Object obj)
Overrides:
equals in class BaseMatcherImpl
See Also:
Object.equals(java.lang.Object)

Get Java XBRL API implementation at SourceForge.net.