FileDocCategorySizeDatePackage
BasicClassFilter.javaAPI DocHibernate 3.2.51618Thu Aug 03 15:35:26 BST 2006org.hibernate.bytecode.util

BasicClassFilter

public class BasicClassFilter extends Object implements ClassFilter
BasicClassFilter provides class filtering based on a series of packages to be included and/or a series of explicit class names to be included. If neither is specified, then no restrictions are applied.
author
Steve Ebersole

Fields Summary
private final String[]
includedPackages
private final Set
includedClassNames
private final boolean
isAllEmpty
Constructors Summary
public BasicClassFilter()


	  
		this( null, null );
	
public BasicClassFilter(String[] includedPackages, String[] includedClassNames)

		this.includedPackages = includedPackages;
		if ( includedClassNames != null ) {
			for ( int i = 0; i < includedClassNames.length; i++ ) {
				this.includedClassNames.add( includedClassNames[i] );
			}
		}

		isAllEmpty = ( this.includedPackages == null || this.includedPackages.length == 0 )
		             && ( this.includedClassNames.isEmpty() );
	
Methods Summary
private booleanisInIncludedPackage(java.lang.String className)

		if ( includedPackages != null ) {
			for ( int i = 0; i < includedPackages.length; i++ ) {
				if ( className.startsWith( includedPackages[i] ) ) {
					return true;
				}
			}
		}
		return false;
	
public booleanshouldInstrumentClass(java.lang.String className)

		if ( isAllEmpty ) {
			return true;
		}
		else if ( includedClassNames.contains( className ) ) {
			return true;
		}
		else if ( isInIncludedPackage( className ) ) {
			return true;
		}
		else {
			return false;
		}