Package com.apgar.common.lib.trigger
Class DefaultValueTrigger
java.lang.Object
com.orchestranetworks.schema.trigger.TableTrigger
com.apgar.common.lib.trigger.DefaultValueTrigger
Table trigger to fill a String field (path as a parameter) with a default value (as a parameter).
The trigger is defined as follows for the table it is applied on in the XSD of its dataset.
<xs:complexType name="SampleTable_Type">
<xs:annotation>
<xs:documentation xml:lang="en-US">
<osd:label>Sample Table</osd:label>
</xs:documentation>
<xs:appinfo>
<osd:table>...</osd:table>
<osd:trigger class="com.apgar.common.lib.trigger.DefaultValueTrigger">
<defaultValue>value</defaultValue>
<pathToField>./pathToField</pathToField>
</osd:trigger>
</xs:appinfo>
</xs:annotation>
</xs:complexType>
- Author:
- APGAR Consulting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the string value to be set to the fieldReturns the path of the field to be set as a stringvoidvoidvoidsetDefaultValue(String defaultValue) Sets the default string value which the field the trigger is applied on will be set tovoidsetPathToField(String pathToField) Sets the path of the fieldvoidsetup(TriggerSetupContext context) Performs type checkMethods inherited from class com.orchestranetworks.schema.trigger.TableTrigger
handleAfterCreate, handleAfterDelete, handleAfterModify, handleBeforeDelete, handleBeforeModify, handleBeforeTransactionCancel, handleBeforeTransactionCommit, zza, zza
-
Constructor Details
-
DefaultValueTrigger
public DefaultValueTrigger()
-
-
Method Details
-
handleNewContext
- Overrides:
handleNewContextin classTableTrigger
-
handleBeforeCreate
- Overrides:
handleBeforeCreatein classTableTrigger- Throws:
OperationException
-
setup
Performs type check- Specified by:
setupin classTableTrigger
-
getDefaultValue
Returns the string value to be set to the field- Returns:
- the string value to be set to the field
-
setDefaultValue
Sets the default string value which the field the trigger is applied on will be set to- Parameters:
defaultValue- String value to be set
-
getPathToField
Returns the path of the field to be set as a string- Returns:
- the formatted String path of the field set by the trigger
-
setPathToField
Sets the path of the field- Parameters:
pathToField- path of the field to be set
-