alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (CustomScanner.java)

This example Hibernate source code file (CustomScanner.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

annotation, annotation, customscanner, nativescanner, nativescanner, net, network, scanner, scanner, set, set, string, util

The Hibernate CustomScanner.java source code

package org.hibernate.ejb.test.packaging;
import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.Set;
import org.hibernate.ejb.packaging.NamedInputStream;
import org.hibernate.ejb.packaging.NativeScanner;
import org.hibernate.ejb.packaging.Scanner;

/**
 * @author Emmanuel Bernard
 */
public class CustomScanner implements Scanner {
	public static boolean isUsed = false;
	private Scanner scanner = new NativeScanner();

	public static boolean isUsed() {
		return isUsed;
	}

	public static void resetUsed() {
		isUsed = false;
	}

	public Set<Package> getPackagesInJar(URL jartoScan, Set> annotationsToLookFor) {
		isUsed = true;
		return scanner.getPackagesInJar( jartoScan, annotationsToLookFor );
	}

	public Set<Class getClassesInJar(URL jartoScan, Set> annotationsToLookFor) {
		isUsed = true;
		return scanner.getClassesInJar( jartoScan, annotationsToLookFor );
	}

	public Set<NamedInputStream> getFilesInJar(URL jartoScan, Set filePatterns) {
		isUsed = true;
		return scanner.getFilesInJar( jartoScan, filePatterns );
	}

	public Set<NamedInputStream> getFilesInClasspath(Set filePatterns) {
		isUsed = true;
		return scanner.getFilesInClasspath( filePatterns );
	}

	public String getUnqualifiedJarName(URL jarUrl) {
		isUsed = true;
		return scanner.getUnqualifiedJarName( jarUrl );
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate CustomScanner.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.