|
1
|
|
package pro.verron.officestamper.preset.preprocessors.rmlang; |
|
2
|
|
|
|
3
|
|
import org.docx4j.utils.TraversalUtilVisitor; |
|
4
|
|
import org.docx4j.wml.R; |
|
5
|
|
import org.docx4j.wml.RPr; |
|
6
|
|
|
|
7
|
|
import java.util.ArrayList; |
|
8
|
|
import java.util.List; |
|
9
|
|
|
|
10
|
|
/// A visitor implementation for processing Run Properties (RPr) language elements in DOCX documents. This class extends |
|
11
|
|
/// TraversalUtilVisitor to traverse and collect RPr elements that contain language information. |
|
12
|
|
/// |
|
13
|
|
/// This visitor is specifically designed to identify and store RPr objects that have non-null language settings, which |
|
14
|
|
/// can be used for further processing or analysis of document formatting. |
|
15
|
|
public class RprLangVisitor |
|
16
|
|
extends TraversalUtilVisitor<R> { |
|
17
|
|
private final List<RPr> rPrs = new ArrayList<>(); |
|
18
|
|
|
|
19
|
|
@Override |
|
20
|
|
public void apply(R element, Object parent1, List<Object> siblings) { |
|
21
|
|
var elementRPr = element.getRPr(); |
|
22
|
1
1. apply : negated conditional → KILLED
|
if (elementRPr == null) return; |
|
23
|
|
var elementLang = elementRPr.getLang(); |
|
24
|
1
1. apply : negated conditional → SURVIVED
|
if (elementLang == null) return; |
|
25
|
|
rPrs.add(elementRPr); |
|
26
|
|
} |
|
27
|
|
|
|
28
|
|
|
|
29
|
|
/// Returns the list of RPr elements that have been collected during the traversal. These RPr elements contain |
|
30
|
|
/// language information and were identified as having non-null language settings. |
|
31
|
|
/// |
|
32
|
|
/// @return a list of RPr elements with language information |
|
33
|
|
public List<RPr> getrPrs() { |
|
34
|
1
1. getrPrs : replaced return value with Collections.emptyList for pro/verron/officestamper/preset/preprocessors/rmlang/RprLangVisitor::getrPrs → TIMED_OUT
|
return rPrs; |
|
35
|
|
} |
|
36
|
|
} |
| | Mutations |
| 22 |
|
1.1 Location : apply Killed by : pro.verron.officestamper.test.SpelInstantiationTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInstantiationTest]/[test-template:testDateInstantiationAndResolution(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2] negated conditional → KILLED
|
| 24 |
|
1.1 Location : apply Killed by : none negated conditional → SURVIVED
Covering tests
Covered by tests:
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#4]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#3]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#6]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#5]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[test-template:test52(pro.verron.officestamper.test.RegressionTests$Conditions, java.lang.String)]/[test-template-invocation:#7]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#4]
- pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfEndnotes(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#5]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#6]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfFootnotes(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, org.docx4j.openpackaging.packages.WordprocessingMLPackage, java.lang.String)]/[test-template-invocation:#3]
- pro.verron.officestamper.test.ProcessorRepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPartTest]/[test-template:shouldReplicateImageFromTheMainDocumentInTheSubTemplate(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfEndnotes(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfFootnotes(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ProcessorRepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPartTest]/[test-template:shouldReplicateImageFromTheMainDocumentInTheSubTemplate(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ProcessorRepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPartTest]/[test-template:repeatDocPartNestingTest(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test64()]
- pro.verron.officestamper.test.ProcessorRepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPartTest]/[test-template:repeatDocPartNestingTest(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptList()]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptQueue()]
- pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptSet()]
|
| 34 |
|
1.1 Location : getrPrs Killed by : none replaced return value with Collections.emptyList for pro/verron/officestamper/preset/preprocessors/rmlang/RprLangVisitor::getrPrs → TIMED_OUT
|