FieldType

Inheritance: java.lang.Object

public class FieldType

Specifies Microsoft Word field types.

Examples:

Shows how to insert a field into a document using a field code.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 Field dateField = builder.insertField("DATE \\* MERGEFORMAT");

 Assert.assertEquals(FieldType.FIELD_DATE, dateField.getType());
 Assert.assertEquals("DATE \\* MERGEFORMAT", dateField.getFieldCode());
 

Shows how to work with a FieldStart node.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 FieldDate field = (FieldDate) builder.insertField(FieldType.FIELD_DATE, true);
 field.getFormat().setDateTimeFormat("dddd, MMMM dd, yyyy");
 field.update();

 FieldChar fieldStart = field.getStart();

 Assert.assertEquals(FieldType.FIELD_DATE, fieldStart.getFieldType());
 Assert.assertEquals(false, fieldStart.isDirty());
 Assert.assertEquals(false, fieldStart.isLocked());

 // Retrieve the facade object which represents the field in the document.
 field = (FieldDate) fieldStart.getField();

 Assert.assertEquals(false, field.isLocked());
 Assert.assertEquals(" DATE  \\@ \"dddd, MMMM dd, yyyy\"", field.getFieldCode());

 // Update the field to show the current date.
 field.update();
 

Fields

FieldDescription
FIELD_ADDINSpecifies the ADDIN field.
FIELD_ADDRESS_BLOCKSpecifies the ADDRESSBLOCK field.
FIELD_ADVANCESpecifies the ADVANCE field.
FIELD_ASKSpecifies the ASK field.
FIELD_AUTHORSpecifies the AUTHOR field.
FIELD_AUTO_NUMSpecifies the AUTONUM field.
FIELD_AUTO_NUM_LEGALSpecifies the AUTONUMLGL field.
FIELD_AUTO_NUM_OUTLINESpecifies the AUTONUMOUT field.
FIELD_AUTO_TEXTSpecifies the AUTOTEXT field.
FIELD_AUTO_TEXT_LISTSpecifies the AUTOTEXTLIST field.
FIELD_BARCODESpecifies the BARCODE field.
FIELD_BIBLIOGRAPHYSpecifies the BIBLIOGRAPHY field.
FIELD_BIDI_OUTLINESpecifies the BIDIOUTLINE field.
FIELD_CANNOT_PARSESpecifies that the field was unable to be parsed.
FIELD_CITATIONSpecifies the CITATION field.
FIELD_COMMENTSSpecifies the COMMENTS field.
FIELD_COMPARESpecifies the COMPARE field.
FIELD_CREATE_DATESpecifies the CREATEDATE field.
FIELD_DATASpecifies the DATA field.
FIELD_DATABASESpecifies the DATABASE field.
FIELD_DATESpecifies the DATE field.
FIELD_DDESpecifies the DDE field.
FIELD_DDE_AUTOSpecifies the DDEAUTO field.
FIELD_DISPLAY_BARCODESpecifies the DISPLAYBARCODE field.
FIELD_DOC_PROPERTYSpecifies the DOCPROPERTY field.
FIELD_DOC_VARIABLESpecifies the DOCVARIABLE field.
FIELD_EDIT_TIMESpecifies the EDITTIME field.
FIELD_EMBEDSpecifies the EMBED field.
FIELD_EQUATIONSpecifies the EQ field.
FIELD_FILE_NAMESpecifies the FILENAME field.
FIELD_FILE_SIZESpecifies the FILESIZE field.
FIELD_FILL_INSpecifies the FILLIN field.
FIELD_FOOTNOTE_REFSpecifies the FOOTNOTEREF field.
FIELD_FORMULASpecifies the = (formula) field.
FIELD_FORM_CHECK_BOXSpecifies the FORMCHECKBOX field.
FIELD_FORM_DROP_DOWNSpecifies the FORMDROPDOWN field.
FIELD_FORM_TEXT_INPUTSpecifies the FORMTEXT field.
FIELD_GLOSSARYSpecifies the GLOSSARY field.
FIELD_GO_TO_BUTTONSpecifies the GOTOBUTTON field.
FIELD_GREETING_LINESpecifies the GREETINGLINE field.
FIELD_HTML_ACTIVE_XSpecifies the field that represents an HTML control.
FIELD_HYPERLINKSpecifies the HYPERLINK field.
FIELD_IFSpecifies the IF field.
FIELD_IMPORTSpecifies the IMPORT field.
FIELD_INCLUDESpecifies the INCLUDE field.
FIELD_INCLUDE_PICTURESpecifies the INCLUDEPICTURE field.
FIELD_INCLUDE_TEXTSpecifies the INCLUDETEXT field.
FIELD_INDEXSpecifies the INDEX field.
FIELD_INDEX_ENTRYSpecifies the XE field.
FIELD_INFOSpecifies the INFO field.
FIELD_KEYWORDSpecifies the KEYWORDS field.
FIELD_LAST_SAVED_BYSpecifies the LASTSAVEDBY field.
FIELD_LINKSpecifies the LINK field.
FIELD_LIST_NUMSpecifies the LISTNUM field.
FIELD_MACRO_BUTTONSpecifies the MACROBUTTON field.
FIELD_MERGE_BARCODESpecifies the MERGEBARCODE field.
FIELD_MERGE_FIELDSpecifies the MERGEFIELD field.
FIELD_MERGE_RECSpecifies the MERGEREC field.
FIELD_MERGE_SEQSpecifies the MERGESEQ field.
FIELD_NEXTSpecifies the NEXT field.
FIELD_NEXT_IFSpecifies the NEXTIF field.
FIELD_NONEField type is not specified or unknown.
FIELD_NOTE_REFSpecifies the NOTEREF field.
FIELD_NUM_CHARSSpecifies the NUMCHARS field.
FIELD_NUM_PAGESSpecifies the NUMPAGES field.
FIELD_NUM_WORDSSpecifies the NUMWORDS field.
FIELD_OCXSpecifies the OCX field.
FIELD_PAGESpecifies the PAGE field.
FIELD_PAGE_REFSpecifies the PAGEREF field.
FIELD_PRINTSpecifies the PRINT field.
FIELD_PRINT_DATESpecifies the PRINTDATE field.
FIELD_PRIVATESpecifies the PRIVATE field.
FIELD_QUOTESpecifies the QUOTE field.
FIELD_REFSpecifies the REF field.
FIELD_REF_DOCSpecifies the RD field.
FIELD_REF_NO_KEYWORDSpecifies that the field represents a REF field where the keyword has been omitted.
FIELD_REVISION_NUMSpecifies the REVNUM field.
FIELD_SAVE_DATESpecifies the SAVEDATE field.
FIELD_SECTIONSpecifies the SECTION field.
FIELD_SECTION_PAGESSpecifies the SECTIONPAGES field.
FIELD_SEQUENCESpecifies the SEQ field.
FIELD_SETSpecifies the SET field.
FIELD_SHAPESpecifies the SHAPE field.
FIELD_SKIP_IFSpecifies the SKIPIF field.
FIELD_STYLE_REFSpecifies the STYLEREF field.
FIELD_SUBJECTSpecifies the SUBJECT field.
FIELD_SYMBOLSpecifies the SYMBOL field.
FIELD_TEMPLATESpecifies the TEMPLATE field.
FIELD_TIMESpecifies the TIME field.
FIELD_TITLESpecifies the TITLE field.
FIELD_TOASpecifies the TOA field.
FIELD_TOA_ENTRYSpecifies the TA field.
FIELD_TOCSpecifies the TOC field.
FIELD_TOC_ENTRYSpecifies the TC field.
FIELD_USER_ADDRESSSpecifies the USERADDRESS field.
FIELD_USER_INITIALSSpecifies the USERINITIALS field.
FIELD_USER_NAMESpecifies the USERNAME field.
length

Methods

MethodDescription
fromName(String fieldTypeName)
getName(int fieldType)
getValues()
toString(int fieldType)

FIELD_ADDIN

public static int FIELD_ADDIN

Specifies the ADDIN field.

FIELD_ADDRESS_BLOCK

public static int FIELD_ADDRESS_BLOCK

Specifies the ADDRESSBLOCK field.

FIELD_ADVANCE

public static int FIELD_ADVANCE

Specifies the ADVANCE field.

FIELD_ASK

public static int FIELD_ASK

Specifies the ASK field.

FIELD_AUTHOR

public static int FIELD_AUTHOR

Specifies the AUTHOR field.

FIELD_AUTO_NUM

public static int FIELD_AUTO_NUM

Specifies the AUTONUM field.

public static int FIELD_AUTO_NUM_LEGAL

Specifies the AUTONUMLGL field.

FIELD_AUTO_NUM_OUTLINE

public static int FIELD_AUTO_NUM_OUTLINE

Specifies the AUTONUMOUT field.

FIELD_AUTO_TEXT

public static int FIELD_AUTO_TEXT

Specifies the AUTOTEXT field.

FIELD_AUTO_TEXT_LIST

public static int FIELD_AUTO_TEXT_LIST

Specifies the AUTOTEXTLIST field.

FIELD_BARCODE

public static int FIELD_BARCODE

Specifies the BARCODE field.

FIELD_BIBLIOGRAPHY

public static int FIELD_BIBLIOGRAPHY

Specifies the BIBLIOGRAPHY field.

FIELD_BIDI_OUTLINE

public static int FIELD_BIDI_OUTLINE

Specifies the BIDIOUTLINE field.

FIELD_CANNOT_PARSE

public static int FIELD_CANNOT_PARSE

Specifies that the field was unable to be parsed.

FIELD_CITATION

public static int FIELD_CITATION

Specifies the CITATION field.

FIELD_COMMENTS

public static int FIELD_COMMENTS

Specifies the COMMENTS field.

FIELD_COMPARE

public static int FIELD_COMPARE

Specifies the COMPARE field.

FIELD_CREATE_DATE

public static int FIELD_CREATE_DATE

Specifies the CREATEDATE field.

FIELD_DATA

public static int FIELD_DATA

Specifies the DATA field.

FIELD_DATABASE

public static int FIELD_DATABASE

Specifies the DATABASE field.

FIELD_DATE

public static int FIELD_DATE

Specifies the DATE field.

FIELD_DDE

public static int FIELD_DDE

Specifies the DDE field.

FIELD_DDE_AUTO

public static int FIELD_DDE_AUTO

Specifies the DDEAUTO field.

FIELD_DISPLAY_BARCODE

public static int FIELD_DISPLAY_BARCODE

Specifies the DISPLAYBARCODE field.

FIELD_DOC_PROPERTY

public static int FIELD_DOC_PROPERTY

Specifies the DOCPROPERTY field.

FIELD_DOC_VARIABLE

public static int FIELD_DOC_VARIABLE

Specifies the DOCVARIABLE field.

FIELD_EDIT_TIME

public static int FIELD_EDIT_TIME

Specifies the EDITTIME field.

FIELD_EMBED

public static int FIELD_EMBED

Specifies the EMBED field.

FIELD_EQUATION

public static int FIELD_EQUATION

Specifies the EQ field.

FIELD_FILE_NAME

public static int FIELD_FILE_NAME

Specifies the FILENAME field.

FIELD_FILE_SIZE

public static int FIELD_FILE_SIZE

Specifies the FILESIZE field.

FIELD_FILL_IN

public static int FIELD_FILL_IN

Specifies the FILLIN field.

FIELD_FOOTNOTE_REF

public static int FIELD_FOOTNOTE_REF

Specifies the FOOTNOTEREF field.

FIELD_FORMULA

public static int FIELD_FORMULA

Specifies the = (formula) field.

FIELD_FORM_CHECK_BOX

public static int FIELD_FORM_CHECK_BOX

Specifies the FORMCHECKBOX field.

FIELD_FORM_DROP_DOWN

public static int FIELD_FORM_DROP_DOWN

Specifies the FORMDROPDOWN field.

FIELD_FORM_TEXT_INPUT

public static int FIELD_FORM_TEXT_INPUT

Specifies the FORMTEXT field.

FIELD_GLOSSARY

public static int FIELD_GLOSSARY

Specifies the GLOSSARY field.

FIELD_GO_TO_BUTTON

public static int FIELD_GO_TO_BUTTON

Specifies the GOTOBUTTON field.

FIELD_GREETING_LINE

public static int FIELD_GREETING_LINE

Specifies the GREETINGLINE field.

FIELD_HTML_ACTIVE_X

public static int FIELD_HTML_ACTIVE_X

Specifies the field that represents an HTML control.

public static int FIELD_HYPERLINK

Specifies the HYPERLINK field.

FIELD_IF

public static int FIELD_IF

Specifies the IF field.

FIELD_IMPORT

public static int FIELD_IMPORT

Specifies the IMPORT field.

FIELD_INCLUDE

public static int FIELD_INCLUDE

Specifies the INCLUDE field.

FIELD_INCLUDE_PICTURE

public static int FIELD_INCLUDE_PICTURE

Specifies the INCLUDEPICTURE field.

FIELD_INCLUDE_TEXT

public static int FIELD_INCLUDE_TEXT

Specifies the INCLUDETEXT field.

FIELD_INDEX

public static int FIELD_INDEX

Specifies the INDEX field.

FIELD_INDEX_ENTRY

public static int FIELD_INDEX_ENTRY

Specifies the XE field.

FIELD_INFO

public static int FIELD_INFO

Specifies the INFO field.

FIELD_KEYWORD

public static int FIELD_KEYWORD

Specifies the KEYWORDS field.

FIELD_LAST_SAVED_BY

public static int FIELD_LAST_SAVED_BY

Specifies the LASTSAVEDBY field.

public static int FIELD_LINK

Specifies the LINK field.

FIELD_LIST_NUM

public static int FIELD_LIST_NUM

Specifies the LISTNUM field.

FIELD_MACRO_BUTTON

public static int FIELD_MACRO_BUTTON

Specifies the MACROBUTTON field.

FIELD_MERGE_BARCODE

public static int FIELD_MERGE_BARCODE

Specifies the MERGEBARCODE field.

FIELD_MERGE_FIELD

public static int FIELD_MERGE_FIELD

Specifies the MERGEFIELD field.

FIELD_MERGE_REC

public static int FIELD_MERGE_REC

Specifies the MERGEREC field.

FIELD_MERGE_SEQ

public static int FIELD_MERGE_SEQ

Specifies the MERGESEQ field.

FIELD_NEXT

public static int FIELD_NEXT

Specifies the NEXT field.

FIELD_NEXT_IF

public static int FIELD_NEXT_IF

Specifies the NEXTIF field.

FIELD_NONE

public static int FIELD_NONE

Field type is not specified or unknown.

FIELD_NOTE_REF

public static int FIELD_NOTE_REF

Specifies the NOTEREF field.

FIELD_NUM_CHARS

public static int FIELD_NUM_CHARS

Specifies the NUMCHARS field.

FIELD_NUM_PAGES

public static int FIELD_NUM_PAGES

Specifies the NUMPAGES field.

FIELD_NUM_WORDS

public static int FIELD_NUM_WORDS

Specifies the NUMWORDS field.

FIELD_OCX

public static int FIELD_OCX

Specifies the OCX field.

Normally, Aspose.Words will represent an ActiveX control as a Shape object, but for some documents, where a control does not have data and/or seems to be invalid, it will be represented as a field.

FIELD_PAGE

public static int FIELD_PAGE

Specifies the PAGE field.

FIELD_PAGE_REF

public static int FIELD_PAGE_REF

Specifies the PAGEREF field.

FIELD_PRINT

public static int FIELD_PRINT

Specifies the PRINT field.

FIELD_PRINT_DATE

public static int FIELD_PRINT_DATE

Specifies the PRINTDATE field.

FIELD_PRIVATE

public static int FIELD_PRIVATE

Specifies the PRIVATE field.

FIELD_QUOTE

public static int FIELD_QUOTE

Specifies the QUOTE field.

FIELD_REF

public static int FIELD_REF

Specifies the REF field.

FIELD_REF_DOC

public static int FIELD_REF_DOC

Specifies the RD field.

FIELD_REF_NO_KEYWORD

public static int FIELD_REF_NO_KEYWORD

Specifies that the field represents a REF field where the keyword has been omitted.

FIELD_REVISION_NUM

public static int FIELD_REVISION_NUM

Specifies the REVNUM field.

FIELD_SAVE_DATE

public static int FIELD_SAVE_DATE

Specifies the SAVEDATE field.

FIELD_SECTION

public static int FIELD_SECTION

Specifies the SECTION field.

FIELD_SECTION_PAGES

public static int FIELD_SECTION_PAGES

Specifies the SECTIONPAGES field.

FIELD_SEQUENCE

public static int FIELD_SEQUENCE

Specifies the SEQ field.

FIELD_SET

public static int FIELD_SET

Specifies the SET field.

FIELD_SHAPE

public static int FIELD_SHAPE

Specifies the SHAPE field.

FIELD_SKIP_IF

public static int FIELD_SKIP_IF

Specifies the SKIPIF field.

FIELD_STYLE_REF

public static int FIELD_STYLE_REF

Specifies the STYLEREF field.

FIELD_SUBJECT

public static int FIELD_SUBJECT

Specifies the SUBJECT field.

FIELD_SYMBOL

public static int FIELD_SYMBOL

Specifies the SYMBOL field.

FIELD_TEMPLATE

public static int FIELD_TEMPLATE

Specifies the TEMPLATE field.

FIELD_TIME

public static int FIELD_TIME

Specifies the TIME field.

FIELD_TITLE

public static int FIELD_TITLE

Specifies the TITLE field.

FIELD_TOA

public static int FIELD_TOA

Specifies the TOA field.

FIELD_TOA_ENTRY

public static int FIELD_TOA_ENTRY

Specifies the TA field.

FIELD_TOC

public static int FIELD_TOC

Specifies the TOC field.

FIELD_TOC_ENTRY

public static int FIELD_TOC_ENTRY

Specifies the TC field.

FIELD_USER_ADDRESS

public static int FIELD_USER_ADDRESS

Specifies the USERADDRESS field.

FIELD_USER_INITIALS

public static int FIELD_USER_INITIALS

Specifies the USERINITIALS field.

FIELD_USER_NAME

public static int FIELD_USER_NAME

Specifies the USERNAME field.

length

public static int length

fromName(String fieldTypeName)

public static int fromName(String fieldTypeName)

Parameters:

ParameterTypeDescription
fieldTypeNamejava.lang.String

Returns: int

getName(int fieldType)

public static String getName(int fieldType)

Parameters:

ParameterTypeDescription
fieldTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int fieldType)

public static String toString(int fieldType)

Parameters:

ParameterTypeDescription
fieldTypeint

Returns: java.lang.String