docx4j
docx4j copied to clipboard
Refactor field instruction handling
org.docx4j.model.fields.FieldRef.getInstructions() returns a list of the content between the w:fldChar begin and separate elements; in the simplest case, this will be a single w:instrText object; in a more general case of nested fields it will be a mixture of w:instrText and FieldRef objects.
Calling classes then typically contain a method which extracts the instruction from this list.
Code should be refactored to do this once, possibly in FieldRef.