Pepper  3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
org.corpus_tools.pepper.modules.PepperModuleProperty< T > Class Template Reference

With properties, the conversion process done by a Pepper module can be customized. More...

Inherits Comparable< PepperModuleProperty<?> >, and Serializable.

Classes

class  NameBuilder
 

Public Member Functions

 PepperModuleProperty (final String name, Class< T > clazz, final String description)
 
 PepperModuleProperty (final String name, Class< T > clazz, final String description, T defaultValue)
 
 PepperModuleProperty (final String name, Class< T > clazz, final String description, final boolean required)
 
 PepperModuleProperty (final String name, Class< T > clazz, final String description, T defaultValue, final boolean required)
 Creates a PepperModuleProperty instance and sets its values to the given ones. More...
 
String getName ()
 
Class< T > getType ()
 
String getDescription ()
 
boolean isRequired ()
 
void setValue (T value)
 
getValue ()
 
final T getDefaultValue ()
 
void setValueString (String value)
 Sets the given value to the internal one. More...
 
String toString ()
 
int compareTo (PepperModuleProperty<?> o)
 
int hashCode ()
 
boolean equals (Object obj)
 

Static Public Member Functions

static NameBuilder create ()
 

Detailed Description

With properties, the conversion process done by a Pepper module can be customized.

A property in general is an attribute value pair, with a unique name and a value influencing the module's behavior. It is possible to add a default value in case the value was not initialized by the Pepper workflow file. A further flag can be used to set the property as required, which means, the property must be set to run the container module. Each property should contain a description, to help the user understanding how to use this property.

A property is created in a fluent way. See the following sample:

PepperModuleProperty.create().withName("MyProp").withType(String.class)
                .withDescription("Please describe the property for the user. ")
                .withDefaultValue("theDefaultWhenNoValueIsSet").isRequired(false).build();

Constructor & Destructor Documentation

◆ PepperModuleProperty() [1/4]

org.corpus_tools.pepper.modules.PepperModuleProperty< T >.PepperModuleProperty ( final String  name,
Class< T >  clazz,
final String  description 
)

◆ PepperModuleProperty() [2/4]

org.corpus_tools.pepper.modules.PepperModuleProperty< T >.PepperModuleProperty ( final String  name,
Class< T >  clazz,
final String  description,
defaultValue 
)

◆ PepperModuleProperty() [3/4]

org.corpus_tools.pepper.modules.PepperModuleProperty< T >.PepperModuleProperty ( final String  name,
Class< T >  clazz,
final String  description,
final boolean  required 
)

◆ PepperModuleProperty() [4/4]

org.corpus_tools.pepper.modules.PepperModuleProperty< T >.PepperModuleProperty ( final String  name,
Class< T >  clazz,
final String  description,
defaultValue,
final boolean  required 
)

Creates a PepperModuleProperty instance and sets its values to the given ones.

Parameters
namename of the property
clazzthe propertys class
descriptiona description to the property
defaultValuesets a default value if no one is set
requireddetermines if the property is required (true means property is required)

Member Function Documentation

◆ setValueString()

void org.corpus_tools.pepper.modules.PepperModuleProperty< T >.setValueString ( String  value)

Sets the given value to the internal one.

In case of the type of this property is not a String, this method will try to cast the given value. Please note, that only supported types can be casted. The following types are provide by a type cast:

Parameters
valueconsumes the given String parameter and transforms it