Fields { public static ReferenceField createReferenceField(OdfElement odfElement, String referenceName) { return new ReferenceField(odfElement, referenceName); } private  Fields(); static DateField createDateField(OdfElement odfElement); static DateField createFixedDateField(OdfElement odfElement); static TimeField createTimeField(OdfElement odfElement); static TimeField createFixedTimeField(OdfElement odfElement); static PageNumberField createPreviousPageNumberField(OdfElement odfElement); static PageNumberField createCurrentPageNumberField(OdfElement odfElement); static PageNumberField createNextPageNumberField(OdfElement odfElement); static PageCountField createPageCountField(OdfElement odfElement); static TitleField createTitleField(OdfElement odfElement); static SubjectField createSubjectField(OdfElement odfElement); static AuthorField createAuthorNameField(OdfElement odfElement); static AuthorField createAuthorInitialsField(OdfElement odfElement); static ChapterField createChapterField(OdfElement odfElement); static ReferenceField createReferenceField(OdfElement odfElement, String referenceName); static VariableField createSimpleVariableField(VariableContainer container, String name); static VariableField createUserVariableField(VariableContainer container, String name, String value); static ConditionField createConditionField(OdfElement odfElement, String condition, String trueText,
			String falseText); static ConditionField createHiddenTextField(OdfElement odfElement, String condition, String text);  }
@Test public void testCreateReferenceField() { try { TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT)); TextSpanElement newTextSpanElement = doc.newParagraph("Reference Content:").newTextSpanElement(); newTextSpanElement.setTextContent("This is a test reference content."); ReferenceField referenceField = Fields.createReferenceField(newTextSpanElement, "test-ref"); Assert.assertNotNull(referenceField); referenceField .appendReferenceTo(doc.newParagraph("User Reference Field:"), ReferenceField.DisplayType.TEXT); } catch (Exception e) { Logger.getLogger(FieldsTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }