public TokenStream tokenStream( String field, final Reader reader )
{
// do not tokenize field called 'element'
if ( StandardIndexRecordFields.DEPENDENCIES.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '\n';
}
};
}
else if ( StandardIndexRecordFields.FILES.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '\n' && c != '/';
}
};
}
else
if ( StandardIndexRecordFields.CLASSES.equals( field ) || MinimalIndexRecordFields.CLASSES.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '\n' && c != '.';
}
protected char normalize( char c )
{
return Character.toLowerCase( c );
}
};
}
else if ( StandardIndexRecordFields.GROUPID.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '.';
}
protected char normalize( char c )
{
return Character.toLowerCase( c );
}
};
}
else if ( StandardIndexRecordFields.VERSION.equals( field ) ||
StandardIndexRecordFields.BASE_VERSION.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '-';
}
};
}
else if ( StandardIndexRecordFields.FILENAME.equals( field ) ||
MinimalIndexRecordFields.FILENAME.equals( field ) )
{
return new CharTokenizer( reader )
{
protected boolean isTokenChar( char c )
{
return c != '-' && c != '.' && c != '/';
}