|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.lt.hog.Module
public abstract class Module
Module
is an abstract class that provides methods for
a module to process an XML string or a DOM tree, respectively.
DeepThought Adaptation by
Robert Barbey
Field Summary | |
---|---|
protected static java.lang.String |
CONFIG_SEARCH_PATH_PROP
This is the property for the config files search path in the config. |
static java.lang.String |
LINE_SEPARATOR
This is the system local newline string. |
static java.lang.String |
MODULE_DEPTH_PROP
Key for depth of this Module in configuration. |
static java.lang.String |
MODULE_LANGUAGE_PROP
Key for language in configurating Properties |
static java.lang.String |
MODULE_NAME_PROP
Key for name of this Module in the config. |
static java.lang.String |
MODULE_ROOTELEMENT_PROP
Key for root element name of this Module in configuration. |
protected static org.apache.log4j.Logger |
moduleLog
A logger for Module s |
protected static java.lang.String |
NO
This is the value for a flag property that is unset. |
protected static java.lang.String |
NONE
This is the value for a property that is not used. |
static java.lang.String |
ROOT
This is the path to the summarizer root directory. |
protected static java.lang.String |
YES
This is the value for a flag property that is set. |
Constructor Summary | |
---|---|
Module()
|
Method Summary | |
---|---|
protected java.lang.String |
getAbsolutOrRelativePath(java.lang.String path)
This takes a file path and returns it if it's an absolut path or appends it to the summarizer root if it's a relative path. |
protected java.util.Properties |
getConfig()
This returns the Properties object with the
individual configs of the module. |
protected java.io.File |
getFileProperty(java.lang.String aProperty)
This returns a File build from the value of a
property as found in the properties object of the module. |
MoCoMan |
getMoCoMan()
Return a reference back to the current MoCoMan instance (uschaefer). |
protected int |
getModuleDepth()
Returns depth of this Module |
protected java.lang.String |
getModuleLanguage()
Returns language of this Module as an abbreviated string. |
protected java.lang.String |
getModuleName()
This returns the key under which the module is stored in the registry. |
protected java.lang.String |
getModuleRootElement()
. |
protected java.lang.String |
getProperty(java.lang.String aProperty)
This returns the value of a property as found in the properties object of the module. |
protected java.lang.String |
getProperty(java.lang.String aProperty,
java.lang.String aDefault)
This returns the value of a property as found in the properties object of the module. |
protected void |
init(java.util.Properties configProps)
This makes the basic initialization of the module for a Properties object configProps . |
abstract java.lang.String |
process(java.lang.String processString)
|
abstract org.w3c.dom.Node |
processDOMTree(org.w3c.dom.Node domTree)
|
protected java.io.File |
searchConfigFile(java.lang.String configFile)
This searchs a config file in the config file search path and returns it's first occurrence. |
protected java.io.File |
searchConfigFile(java.lang.String configFile,
java.util.List dirList)
This searchs a config file in the config file search path and returns it's first occurrence. |
protected void |
setConfig(java.util.Properties aConfig)
This sets the individual configs of the module. |
protected void |
setMoCoMan(MoCoMan mcm)
Store a reference back to the MoCoMan instance (uschaefer). |
protected void |
setModuleDepth(int aDepth)
|
protected void |
setModuleLanguage(java.lang.String aLanguage)
This sets the module language. |
protected void |
setModuleName(java.lang.String aName)
This sets the module name. |
protected void |
setModuleRootElement(java.lang.String sElement)
Set root element name for this Module |
protected void |
setProperty(java.lang.String aProperty,
java.lang.String aValue)
This sets the value of a property in the properties object of the module. |
void |
shutdown()
This is the default shutdown method. |
protected boolean |
suitable(java.lang.String language,
int depth)
Determines whether this Module is suitable for analysis
of a document with given language and depth. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MODULE_NAME_PROP
Module
in the config.
public static final java.lang.String MODULE_LANGUAGE_PROP
Properties
public static final java.lang.String MODULE_DEPTH_PROP
Module
in configuration.
public static final java.lang.String MODULE_ROOTELEMENT_PROP
Module
in configuration.
public static final java.lang.String ROOT
public static final java.lang.String LINE_SEPARATOR
protected static org.apache.log4j.Logger moduleLog
Module
s
protected static final java.lang.String YES
protected static final java.lang.String NO
protected static final java.lang.String NONE
protected static final java.lang.String CONFIG_SEARCH_PATH_PROP
Constructor Detail |
---|
public Module()
Method Detail |
---|
protected java.util.Properties getConfig()
Properties
object with the
individual configs of the module.
Properties
objectprotected void setConfig(java.util.Properties aConfig)
aConfig
- a Properties
objectpublic MoCoMan getMoCoMan()
protected void setMoCoMan(MoCoMan mcm)
mcm
- instance of MoCoMan (given MoCoMan module initialization loop)protected java.lang.String getModuleName()
String
protected void setModuleName(java.lang.String aName)
aName
- a String
protected java.lang.String getModuleLanguage()
Module
as an abbreviated string.
protected void setModuleLanguage(java.lang.String aLanguage)
aLanguage
- protected int getModuleDepth()
Module
protected void setModuleDepth(int aDepth)
protected java.lang.String getModuleRootElement()
String
protected void setModuleRootElement(java.lang.String sElement)
sElement
- a String
public void shutdown() throws ShutdownException
ShutdownException
- if shutdown failsprotected void init(java.util.Properties configProps) throws InitializationException
Properties
object configProps
.
configProps
- a Properties
object that contains
at least the module name
InitializationException
- if initialization failsprotected boolean suitable(java.lang.String language, int depth)
Module
is suitable for analysis
of a document with given language and depth.
language
- depth
-
Module
is suitable for analysispublic abstract java.lang.String process(java.lang.String processString)
public abstract org.w3c.dom.Node processDOMTree(org.w3c.dom.Node domTree)
protected java.io.File getFileProperty(java.lang.String aProperty) throws NoSuchPropertyException
File
build from the value of a
property as found in the properties object of the module.
If the pathname is relative, the summarizer root is added as a
prefix.
aProperty
- a String with the property
- Returns:
- a
File
build from the value of the property
- Throws:
NoSuchPropertyException
- if property is not found
protected java.lang.String getAbsolutOrRelativePath(java.lang.String path)
path
- a String
with a path
protected java.io.File searchConfigFile(java.lang.String configFile) throws InitializationException
CONFIG_SEARCH_PATH_PROP
property
of the config file.
configFile
- a String
with the config filename
File
with the first occurrence of the
config file in the search path
InitializationException
- when config file is not foundprotected java.lang.String getProperty(java.lang.String aProperty) throws NoSuchPropertyException
aProperty
- a String with the property
- Returns:
- a
String
with the value of the property
- Throws:
NoSuchPropertyException
- if property is not found
protected java.lang.String getProperty(java.lang.String aProperty, java.lang.String aDefault)
aProperty
- a String with the propertyaDefault
- a String
with the default value
- Returns:
- a
String
with the value of the property or
the default value if property is not found in config
protected void setProperty(java.lang.String aProperty, java.lang.String aValue)
aProperty
- a String with the propertyaValue
- a String
with the value
protected java.io.File searchConfigFile(java.lang.String configFile, java.util.List dirList) throws InitializationException
configFile
- a String
with the config file's namedirList
- a List
of String
s with
the config file directories
File
with the first occurrence of the
config file in the search path
InitializationException
- when config file is not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |