Package javax.help.search
Class IndexerKit
java.lang.Object
javax.help.search.IndexerKit
- All Implemented Interfaces:
Cloneable
Establishes the requirements of an indexing object for a type
of text content. The DefaultKit acts as a factory for policy.
For example, an implementation
for HTML and RTF can be provided that is replaceable
with other implementations.
New kits are normally created by cloning a prototype kit.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IndexBuilder
protected ConfigFile
protected String
protected Locale
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
clone()
Creates a copy of the indexer kit.protected abstract void
Ends the storing of the document.abstract String
Gets the MIME type of the data that this kit represents support for.Gets the Locale.abstract void
parse
(Reader in, String file, boolean ignoreCharset, IndexBuilder builder, ConfigFile config) Parses content from the given stream.abstract int
parseIntoTokens
(String source, int pos) Parses a string into tokens and stores the tokens.void
Convenience method for setting the locale from a lang string Takes the lang string in the form of "language_country_variant".void
Sets the locale for string tokenizing.protected abstract void
startStoreDocument
(String file) Starts the storing of the dcoument.protected abstract void
storeTitle
(String title) Stores a title in the IndexBuilder.protected abstract void
storeToken
(String token, int pos) Stores a token in the IndexBuilder.
-
Field Details
-
builder
-
config
-
file
-
locale
-
-
Constructor Details
-
IndexerKit
public IndexerKit()
-
-
Method Details
-
clone
Creates a copy of the indexer kit. This allows an implementation to serve as a prototype for others, so that they can be quickly created. -
getContentType
Gets the MIME type of the data that this kit represents support for.- Returns:
- the type
-
setLocale
Sets the locale for string tokenizing. A null locale value is valid and means that no locale has been set for this IndexerKit. -
setLocale
Convenience method for setting the locale from a lang string Takes the lang string in the form of "language_country_variant". Parses the string and creates an appropriate locale.- Parameters:
lang
- A string representation of a locale. If lang is null it is the same as setting the locale to null.
-
getLocale
Gets the Locale. -
parse
public abstract void parse(Reader in, String file, boolean ignoreCharset, IndexBuilder builder, ConfigFile config) throws IOException Parses content from the given stream. The stream is expected to be in a format appropriate for this content handler to parse into tokens according to the locale of the class. In the absense of a locale, the default locale tokenizer is used.- Parameters:
in
- The stream to read from.file
- The file name being parsed.builder
- The IndexBuilder for the full text insertion.config
- The indexer configuration information.- Throws:
IOException
- on any I/O error.
-
parseIntoTokens
Parses a string into tokens and stores the tokens. -
startStoreDocument
Starts the storing of the dcoument.- Throws:
Exception
-
endStoreDocument
Ends the storing of the document.- Throws:
Exception
-
storeToken
Stores a token in the IndexBuilder.- Throws:
Exception
-
storeTitle
Stores a title in the IndexBuilder.- Throws:
Exception
-