|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--zyh.robot.ContentManager
The basic service for managing a set of content filters and processors. zyh.robot.ContentManager is with responsibility for registering manifold content filters and content processors. The purpose of content filter is to parse raw data in some formats, such as text, HTML, PostScript or RTF, and stores filtered information and extracted URLs in zyh.robot.Content, a data structure, which holds title, keywords, summary, text and extracted URLs. Content processor decides on the index policy and does actual index process on the Content object, which is constructed by content filter.
When the method getContent
is called,
the ContentManager will attempt to
locate a suitable content filter from those content filters
registered explicitly by the method registerContentFilter
.
When the method getWordIDs
is called,
the ContentManager will attempt to
locate a suitable content processor from those content processors
registered explicitly by the method registerContentProcessors
.
Content
,
ContentFilter
,
ContentProcessor
Constructor Summary | |
ContentManager()
|
Method Summary | |
static Content |
getContent(java.net.URLConnection urlConnection)
Attempts to get a content from a given input stream. |
static java.io.PrintWriter |
getLogWriter()
Gets the log writer. |
static int[] |
getWordIDs(java.lang.Object obj,
Content content)
Sort and Index a content object. |
static void |
println(java.lang.String message)
Prints a message to the current ContentFilter log stream. |
static void |
registerContentFilter(ContentFilter contentFilter)
|
static void |
registerContentFilter(java.lang.String acceptedContenttype,
ContentFilter contentFilter)
Registers the content filter with the ContentManager. |
static void |
registerContentProcessor(Robot robot,
ContentProcessor contentProcessor)
|
static void |
setLogWriter(java.io.PrintWriter out)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ContentManager()
Method Detail |
public static void setLogWriter(java.io.PrintWriter out)
public static java.io.PrintWriter getLogWriter()
public static void println(java.lang.String message)
message
- a log or tracing messagepublic static void registerContentFilter(ContentFilter contentFilter)
public static void registerContentFilter(java.lang.String acceptedContenttype, ContentFilter contentFilter)
acceptedContenttype
- the accepted content typecontentFilter
- the new content filter that is to be registered with the ContentManagerpublic static Content getContent(java.net.URLConnection urlConnection) throws java.io.IOException
InputStream
- an input streampublic static void registerContentProcessor(Robot robot, ContentProcessor contentProcessor)
public static int[] getWordIDs(java.lang.Object obj, Content content) throws java.sql.SQLException
obj
- an robot objectcontent
- an Content object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |