org.xbrlapi.data.resource
Class InStoreMatcherImpl
java.lang.Object
org.xbrlapi.data.resource.BaseMatcherImpl
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
InStoreMatcherImpl
public InStoreMatcherImpl(Store store,
Cache cache)
throws XBRLException
- Parameters:
store - The data store to use for persisting resource matchescache - The resource cache to be used by the matcher when accessing
resources to determine their signature.
- Throws:
XBRLException - if the cache parameter is null.
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)