XBRLAPI

A Java API for XBRL


org.xbrlapi.data.resource
Class DefaultMatcherImpl

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

public class DefaultMatcherImpl
extends Object
implements Matcher, Serializable

The default resource matcher implementation is used by stores by default. Note that this matcher is not persistent and identifies no matches.

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

Constructor Summary
DefaultMatcherImpl()
           
 
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.
 String getSignature(URI uri)
           
 int hashCode()
           
 boolean hasURI(URI uri)
           
 void setSigner(Signer signer)
          Call this method if you need to use a different signature generator for the resources you are working with.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMatcherImpl

public DefaultMatcherImpl()
Method Detail

setSigner

public void setSigner(Signer signer)
Description copied from interface: Matcher
Call this method if you need to use a different signature generator for the resources you are working with.

Specified by:
setSigner in interface Matcher
Parameters:
signer - The object used to generate signatures.
See Also:
Matcher.setSigner(Signer)

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)

getSignature

public String getSignature(URI uri)
                    throws XBRLException
Specified by:
getSignature in interface Matcher
Parameters:
uri - The URI of the resource to obtain the signature for.
Returns:
the signature for the resource specified by the URI or null if the resource could not be accessed.
Throws:
XBRLException - if the signature cannot be constructed.
See Also:
Matcher.getSignature(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)

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)

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)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

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

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