Class DiffRequest
java.lang.Object
com.gentics.contentnode.rest.model.request.DiffRequest
Class representing a diff request sent to DiffResource. Encapsulates request data.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Template for rendering changesprotected String
First content to be diff'edprotected String
Second content to be diff'edstatic final String
Default template for changesstatic final String
Default template for insertsstatic final String
Default template for removalsstatic final int
Default number of words after the change to be shownstatic final int
Default number of words before the change to be shownprotected String
Regex of content to be ignored while diffingprotected String
Template for rendering insertsprotected String
Template for rendering removalsprotected Integer
Number of words to be shown after the diffprotected Integer
Number of words to be shown before the diff -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the change template.Return the content1.Return the content2.Return the ignore regex that will be used to sanitize the content before the diff is invoked.Return the insert template.Return the remove template.Return the amount of words that should be displayed after the actual diff.Return the number of words before the change to be shown.void
setChangeTemplate
(String changeTemplate) Set the change template.void
setContent1
(String content1) Set the content1.void
setContent2
(String content2) Set the content2.void
setIgnoreRegex
(String ignoreRegex) Set the ignore regex that will be used to sanitize the content before the diff is invoked.void
setInsertTemplate
(String insertTemplate) Set the insert template for the diff request.void
setRemoveTemplate
(String removeTemplate) Set the remove template.void
setWordsAfter
(Integer wordsAfter) Set the amount of words that should be displayed after the actual diff.void
setWordsBefore
(Integer wordsBefore) Set the amount of words that should be displayed before the actual diff.
-
Field Details
-
DEFAULT_CHANGE_TEMPLATE
Default template for changes- See Also:
-
DEFAULT_INSERT_TEMPLATE
Default template for inserts- See Also:
-
DEFAULT_REMOVE_TEMPALTE
Default template for removals- See Also:
-
DEFAULT_WORDS_BEFORE
public static final int DEFAULT_WORDS_BEFOREDefault number of words before the change to be shown- See Also:
-
DEFAULT_WORDS_AFTER
public static final int DEFAULT_WORDS_AFTERDefault number of words after the change to be shown- See Also:
-
content1
First content to be diff'ed -
content2
Second content to be diff'ed -
ignoreRegex
Regex of content to be ignored while diffing -
changeTemplate
Template for rendering changes -
insertTemplate
Template for rendering inserts -
removeTemplate
Template for rendering removals -
wordsBefore
Number of words to be shown before the diff -
wordsAfter
Number of words to be shown after the diff
-
-
Constructor Details
-
DiffRequest
public DiffRequest()Create an empty instance (Used by JAXB)
-
-
Method Details
-
getContent1
Return the content1.- Returns:
- the content1
-
setContent1
Set the content1.- Parameters:
content1
- the content1 to set
-
getContent2
Return the content2.- Returns:
- the content2
-
setContent2
Set the content2.- Parameters:
content2
- the content2 to set
-
getIgnoreRegex
Return the ignore regex that will be used to sanitize the content before the diff is invoked.- Returns:
- the ignoreRegex
-
setIgnoreRegex
Set the ignore regex that will be used to sanitize the content before the diff is invoked.- Parameters:
ignoreRegex
- the ignoreRegex to set
-
getChangeTemplate
Return the change template.The following default template will be used when no template has been set: <del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
- Returns:
- the changeTemplate
-
setChangeTemplate
Set the change template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
- Parameters:
changeTemplate
- the template to set
-
getInsertTemplate
Return the insert template.The following default template will be used when no template has been set: <ins class='diff modified gtx-diff'>$insert</ins>
- Returns:
- the insertTemplate
-
setInsertTemplate
Set the insert template for the diff request.The following default template will be used when no template has been set:
<ins class='diff modified gtx-diff'>$insert</ins>
- Parameters:
insertTemplate
- the template to set
-
getRemoveTemplate
Return the remove template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del>
- Returns:
- the removeTemplate
-
setRemoveTemplate
Set the remove template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del>
- Parameters:
removeTemplate
- the removeTemplate to set
-
getWordsBefore
Return the number of words before the change to be shown. Default value: 10- Returns:
- the wordsBefore
-
setWordsBefore
Set the amount of words that should be displayed before the actual diff. Default value: 10- Parameters:
wordsBefore
- the wordsBefore to set
-
getWordsAfter
Return the amount of words that should be displayed after the actual diff. Default value: 10- Returns:
- the wordsAfter
-
setWordsAfter
Set the amount of words that should be displayed after the actual diff. Default value: 10- Parameters:
wordsAfter
- the wordsAfter to set
-