Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: custom property resolvers not used in repeatDocPart #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/wickedsource/docxstamper/DocxStamper.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private void initFields() {
commentProcessorRegistry.setExpressionResolver(expressionResolver);
commentProcessorRegistry.setFailOnInvalidExpression(config.isFailOnUnresolvedExpression());
commentProcessorRegistry.registerCommentProcessor(IRepeatProcessor.class, new RepeatProcessor(typeResolverRegistry, expressionResolver));
commentProcessorRegistry.registerCommentProcessor(IParagraphRepeatProcessor.class, new ParagraphRepeatProcessor(typeResolverRegistry));
commentProcessorRegistry.registerCommentProcessor(IRepeatDocPartProcessor.class, new RepeatDocPartProcessor(typeResolverRegistry));
commentProcessorRegistry.registerCommentProcessor(IParagraphRepeatProcessor.class, new ParagraphRepeatProcessor(typeResolverRegistry, expressionResolver));
commentProcessorRegistry.registerCommentProcessor(IRepeatDocPartProcessor.class, new RepeatDocPartProcessor(typeResolverRegistry, expressionResolver));
commentProcessorRegistry.registerCommentProcessor(IDisplayIfProcessor.class, new DisplayIfProcessor());
commentProcessorRegistry.registerCommentProcessor(IReplaceWithProcessor.class,
new ReplaceWithProcessor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.docx4j.wml.P;
import org.wickedsource.docxstamper.api.coordinates.ParagraphCoordinates;
import org.wickedsource.docxstamper.api.typeresolver.TypeResolverRegistry;
import org.wickedsource.docxstamper.el.ExpressionResolver;
import org.wickedsource.docxstamper.processor.BaseCommentProcessor;
import org.wickedsource.docxstamper.replace.PlaceholderReplacer;
import org.wickedsource.docxstamper.util.CommentUtil;
Expand All @@ -29,8 +30,9 @@ private static class ParagraphsToRepeat {

private PlaceholderReplacer<Object> placeholderReplacer;

public ParagraphRepeatProcessor(TypeResolverRegistry typeResolverRegistry) {
public ParagraphRepeatProcessor(TypeResolverRegistry typeResolverRegistry, ExpressionResolver expressionResolver) {
this.placeholderReplacer = new PlaceholderReplacer<>(typeResolverRegistry);
this.placeholderReplacer.setExpressionResolver(expressionResolver);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.docx4j.wml.*;
import org.jvnet.jaxb2_commons.ppp.Child;
import org.wickedsource.docxstamper.api.typeresolver.TypeResolverRegistry;
import org.wickedsource.docxstamper.el.ExpressionResolver;
import org.wickedsource.docxstamper.processor.BaseCommentProcessor;
import org.wickedsource.docxstamper.replace.PlaceholderReplacer;
import org.wickedsource.docxstamper.util.CommentUtil;
Expand All @@ -22,8 +23,9 @@ public class RepeatDocPartProcessor extends BaseCommentProcessor implements IRep
private Map<CommentWrapper, List<Object>> partsToRepeat = new HashMap<>();
private PlaceholderReplacer<Object> placeholderReplacer;

public RepeatDocPartProcessor(TypeResolverRegistry typeResolverRegistry) {
public RepeatDocPartProcessor(TypeResolverRegistry typeResolverRegistry, ExpressionResolver expressionResolver) {
this.placeholderReplacer = new PlaceholderReplacer<>(typeResolverRegistry);
this.placeholderReplacer.setExpressionResolver(expressionResolver);
}

@Override
Expand Down