public class PepperModuleProperties extends Object implements Serializable
PepperModuleProperty
objects.
This class also offers some methods for accessing and maintaining the
objects.Modifier and Type | Field and Description |
---|---|
protected Map<String,PepperModuleProperty<?>> |
pepperModuleProperties
Internal map to map all
PepperModuleProperty objects to their
name. |
static String |
PROP_AFTER_ADD_SLAYER |
static String |
PROP_AFTER_COPY_RES |
static String |
PROP_AFTER_REMOVE_ANNOTATIONS |
static String |
PROP_AFTER_RENAME_ANNOTATIONS |
static String |
PROP_AFTER_REPORT_CORPUSGRAPH |
static String |
PROP_AFTER_TOKENIZE |
static String |
PROP_BEFORE_ADD_SLAYER |
static String |
PROP_BEFORE_READ_META |
Constructor and Description |
---|
PepperModuleProperties()
Creates instance of
PepperModuleProperties and initializes it
with a set of customization properties. |
Modifier and Type | Method and Description |
---|---|
void |
addProperties(org.eclipse.emf.common.util.URI propURI)
Loads the given file via
Properties.load(java.io.InputStream) and
adds all properties given in the passed Property object. |
void |
addProperty(PepperModuleProperty<?> property)
Adds the given
PepperModuleProperty object to the internal list. |
boolean |
checkProperties()
Checks if all properties marked as required are really set.
|
boolean |
checkProperty(PepperModuleProperty<?> prop)
Checks if the value of given property, when marked as required is really
set.
|
Properties |
getProperties()
Returns a new
Properties object containing all property names and
their values. |
PepperModuleProperty<?> |
getProperty(String propName)
Returns a
PepperModuleProperty object corresponding to the given
property name. |
Collection<PepperModuleProperty<?>> |
getPropertyDesctriptions()
Returns all registered
PepperModuleProperty objects, which are
usable for the corresponding PepperModule . |
Collection<String> |
getPropertyNames()
Returns all property names registered in that object, and therefore
usable for the corresponding
PepperModule . |
void |
removePropertyValue(String propName)
Removes the value of the property with the passed property name from the
properties.
|
<T> void |
setPropertyValue(String propName,
T propValue)
Searches for a
PepperModuleProperty object in registered
PepperModuleProperty objects and sets its value attribute, if a
PepperModuleProperty object was found. |
void |
setPropertyValues(File propFile)
Loads the given file via
Properties.load(java.io.InputStream) and
adds all properties given in the passed Property object. |
void |
setPropertyValues(Properties properties)
Adds all properties given in the passed
Property object. |
List<Character> |
stringToCharList(String input)
Expects a list of characters encoded as a String.
|
String |
toString() |
public static final String PROP_AFTER_ADD_SLAYER
public static final String PROP_AFTER_COPY_RES
public static final String PROP_BEFORE_ADD_SLAYER
public static final String PROP_BEFORE_READ_META
public static final String PROP_AFTER_REPORT_CORPUSGRAPH
public static final String PROP_AFTER_RENAME_ANNOTATIONS
public static final String PROP_AFTER_REMOVE_ANNOTATIONS
public static final String PROP_AFTER_TOKENIZE
protected Map<String,PepperModuleProperty<?>> pepperModuleProperties
PepperModuleProperty
objects to their
name.public PepperModuleProperties()
PepperModuleProperties
and initializes it
with a set of customization properties. These properties are:
public void addProperties(org.eclipse.emf.common.util.URI propURI)
Properties.load(java.io.InputStream)
and
adds all properties given in the passed Property
object. That
means, the corresponding PepperModuleProperty
will be searched
and its value will be set to the one found in the passed
Properties
object. If no corresponding
PepperModuleProperties
object corresponds to one of the
properties contained in the passed Property
object, a new one
will be created.public Properties getProperties()
Properties
object containing all property names and
their values.Properties
objectpublic void setPropertyValues(File propFile)
Properties.load(java.io.InputStream)
and
adds all properties given in the passed Property
object. That
means, the corresponding PepperModuleProperty
will be searched
and its value will be set to the one found in the passed
Properties
object. If no corresponding
PepperModuleProperties
object corresponds to one of the
properties contained in the passed Property
object, a new one
will be created.public void setPropertyValues(Properties properties)
Property
object. That
means, the corresponding PepperModuleProperty
will be searched
and its value will be set to the one found in the passed
Properties
object. If no corresponding
PepperModuleProperties
object corresponds to one of the
properties contained in the passed Property
object, a new one
will be created.public <T> void setPropertyValue(String propName, T propValue)
PepperModuleProperty
object in registered
PepperModuleProperty
objects and sets its value attribute, if a
PepperModuleProperty
object was found.propName
- name of property to search forpropValue
- value to which PepperModuleProperty
s value attribute
is set topublic boolean checkProperties()
PepperModulePropertyException
if a required value is not set.public boolean checkProperty(PepperModuleProperty<?> prop)
PepperModulePropertyException
if a required value
is not set.public void addProperty(PepperModuleProperty<?> property)
PepperModuleProperty
object to the internal list.property
- public PepperModuleProperty<?> getProperty(String propName)
PepperModuleProperty
object corresponding to the given
property name.propName
- name of the propertyPepperModuleProperty
objectpublic Collection<String> getPropertyNames()
PepperModule
.public Collection<PepperModuleProperty<?>> getPropertyDesctriptions()
PepperModuleProperty
objects, which are
usable for the corresponding PepperModule
.public void removePropertyValue(String propName)
propName
- name of the property to be removedpublic List<Character> stringToCharList(String input)
Copyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.