hudson.plugins.checkstyle.util
Class JavaPackageDetector

java.lang.Object
  extended by hudson.plugins.checkstyle.util.AbstractPackageDetector
      extended by hudson.plugins.checkstyle.util.JavaPackageDetector
All Implemented Interfaces:
PackageDetector

public class JavaPackageDetector
extends AbstractPackageDetector

Detects the package name of a Java file.

Author:
Ulli Hafner

Field Summary
 
Fields inherited from class hudson.plugins.checkstyle.util.AbstractPackageDetector
UNKNOWN_PACKAGE
 
Constructor Summary
JavaPackageDetector()
           
 
Method Summary
 boolean accepts(java.lang.String fileName)
          Returns whether this classifier accepts the specified file for processing.
 java.lang.String detectPackageName(java.io.InputStream stream)
          Detects the package or namespace name of the specified input stream.
 
Methods inherited from class hudson.plugins.checkstyle.util.AbstractPackageDetector
detectPackageName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaPackageDetector

public JavaPackageDetector()
Method Detail

detectPackageName

public java.lang.String detectPackageName(java.io.InputStream stream)
Detects the package or namespace name of the specified input stream. The stream must be closed afterwards.

Parameters:
stream - the content of the file to scan
Returns:
the detected package or namespace name

accepts

public boolean accepts(java.lang.String fileName)
Returns whether this classifier accepts the specified file for processing.

Parameters:
fileName - the file name
Returns:
true if the classifier accepts the specified file for processing.


Copyright © 2008. All Rights Reserved.