org.apache.rat.analysis.license
Class SimplePatternBasedLicense

java.lang.Object
  extended by org.apache.rat.analysis.license.BaseLicense
      extended by org.apache.rat.analysis.license.SimplePatternBasedLicense
All Implemented Interfaces:
IHeaderMatcher
Direct Known Subclasses:
ApacheSoftwareLicense20, DojoLicenseHeader, TMF854LicenseHeader, W3CDocLicense, W3CLicense

public class SimplePatternBasedLicense
extends BaseLicense
implements IHeaderMatcher

Since:
Rat 0.8

Constructor Summary
  SimplePatternBasedLicense()
           
protected SimplePatternBasedLicense(MetaData.Datum pLicenseFamilyCategory, MetaData.Datum pLicenseFamilyName, String pNotes, String[] pPatterns)
           
 
Method Summary
 String[] getPatterns()
           
 boolean match(Document pSubject, String pLine)
          Matches the text accumulated to licenses.
protected  boolean matches(String pLine)
           
 void reset()
          Resets this matches.
 void setPatterns(String[] pPatterns)
           
 
Methods inherited from class org.apache.rat.analysis.license.BaseLicense
getLicenseFamilyCategory, getLicenseFamilyName, getNotes, reportOnLicense, setLicenseFamilyCategory, setLicenseFamilyName, setNotes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePatternBasedLicense

public SimplePatternBasedLicense()

SimplePatternBasedLicense

protected SimplePatternBasedLicense(MetaData.Datum pLicenseFamilyCategory,
                                    MetaData.Datum pLicenseFamilyName,
                                    String pNotes,
                                    String[] pPatterns)
Method Detail

getPatterns

public String[] getPatterns()

setPatterns

public void setPatterns(String[] pPatterns)

matches

protected boolean matches(String pLine)

reset

public void reset()
Description copied from interface: IHeaderMatcher
Resets this matches. Subsequent calls to IHeaderMatcher.match(org.apache.rat.api.Document, java.lang.String) will accumulate new text.

Specified by:
reset in interface IHeaderMatcher

match

public boolean match(Document pSubject,
                     String pLine)
              throws RatHeaderAnalysisException
Description copied from interface: IHeaderMatcher
Matches the text accumulated to licenses. TODO probably a poor design choice - hope to fix later

Specified by:
match in interface IHeaderMatcher
Parameters:
pSubject - TODO
pLine - next line of text, not null
Returns:
TODO
Throws:
RatHeaderAnalysisException


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.