FileDocCategorySizeDatePackage
DottedNameWildcardMatcherImpl.javaAPI DocGlassfish v2 API3654Fri May 04 22:24:08 BST 2007com.sun.enterprise.admin.dottedname

DottedNameWildcardMatcherImpl

public class DottedNameWildcardMatcherImpl extends Object implements DottedNameWildcardMatcher

Fields Summary
final Set
mSearchSet
Constructors Summary
public DottedNameWildcardMatcherImpl(Set searchSet)

		mSearchSet		= searchSet;
	
Methods Summary
public java.util.SetmatchDottedNames(java.lang.String dottedNameString)

		Set	resolvedSet	= null;
		
		if ( dottedNameString.equals( ".*" ) )
		{
			// optimization; match all
			resolvedSet	= new HashSet();
			resolvedSet.addAll( mSearchSet );
		}
		else
		{
			resolvedSet	= resolveAll( dottedNameString, mSearchSet.iterator() );
		}
		
		return( resolvedSet );
	
java.util.SetresolveAll(java.lang.String wildcardedName, java.util.Iterator iter)

		final HashSet	resolvedSet	= new HashSet();
		
		final Pattern	pattern	= Pattern.compile( wildcardedName );
		
		while ( iter.hasNext() )
		{
			final String	candidate	= (String)iter.next();
			
			if ( pattern.matcher( candidate ).matches() )
			{
				resolvedSet.add( candidate );
			}
		}
		
		return( resolvedSet );