XBRLAPI

A Java API for XBRL


org.xbrlapi.data.resource
Class BaseMatcherImpl

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

public abstract class BaseMatcherImpl
extends Object
implements Matcher

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

Constructor Summary
BaseMatcherImpl(Cache cache, Signer signature)
           
 
Method Summary
 boolean equals(Object obj)
           
protected  Cache getCache()
           
protected  List<String> getResourceContent(File file)
           
protected  List<String> getResourceContent(URI uri)
           
 String getSignature(URI uri)
           
protected  Signer getSigner()
           
 int hashCode()
           
protected  void setCache(Cache cache)
           
 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
 
Methods inherited from interface org.xbrlapi.data.resource.Matcher
delete, getAllMatchingURIs, getMatch, hasURI
 

Constructor Detail

BaseMatcherImpl

public BaseMatcherImpl(Cache cache,
                       Signer signature)
                throws XBRLException
Parameters:
cache - The resource cache to be used by the matcher when accessing resources to determine their signature.
signature - The object used to generate resource signatures.
Throws:
XBRLException - if either parameter is null.
Method Detail

getCache

protected Cache getCache()

setCache

protected void setCache(Cache cache)

getSigner

protected Signer getSigner()

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.

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)

getResourceContent

protected List<String> getResourceContent(File file)
                                   throws XBRLException
Throws:
XBRLException

getResourceContent

protected List<String> getResourceContent(URI uri)
                                   throws XBRLException
Throws:
XBRLException

hashCode

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Get Java XBRL API implementation at SourceForge.net.