Skip to content

Cannot register new custom function #90

@Aleksa-Amp

Description

@Aleksa-Amp

I am trying to register new custom expression function:

return new DocxStamperConfiguration()
            .exposeInterfaceToExpressionLanguage(TestFunction.class, new TestFunctionImpl())
            .build();
public interface TestFunction{
        void test();
    }

    public static class TestFunctionImpl implements TestFunction{
        @Override
        public void test() {
            System.out.println("Test");
        }
    }

But once I try to process document I get the following error:

IllegalArgumentException: object is not an instance of declaring class

This is the expression in my docx file: ${test()}.
How can I solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions