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
Field | Description |
---|---|
FIELD_ADDIN | Specifies the ADDIN field. |
FIELD_ADDRESS_BLOCK | Specifies the ADDRESSBLOCK field. |
FIELD_ADVANCE | Specifies the ADVANCE field. |
FIELD_ASK | Specifies the ASK field. |
FIELD_AUTHOR | Specifies the AUTHOR field. |
FIELD_AUTO_NUM | Specifies the AUTONUM field. |
FIELD_AUTO_NUM_LEGAL | Specifies the AUTONUMLGL field. |
FIELD_AUTO_NUM_OUTLINE | Specifies the AUTONUMOUT field. |
FIELD_AUTO_TEXT | Specifies the AUTOTEXT field. |
FIELD_AUTO_TEXT_LIST | Specifies the AUTOTEXTLIST field. |
FIELD_BARCODE | Specifies the BARCODE field. |
FIELD_BIBLIOGRAPHY | Specifies the BIBLIOGRAPHY field. |
FIELD_BIDI_OUTLINE | Specifies the BIDIOUTLINE field. |
FIELD_CANNOT_PARSE | Specifies that the field was unable to be parsed. |
FIELD_CITATION | Specifies the CITATION field. |
FIELD_COMMENTS | Specifies the COMMENTS field. |
FIELD_COMPARE | Specifies the COMPARE field. |
FIELD_CREATE_DATE | Specifies the CREATEDATE field. |
FIELD_DATA | Specifies the DATA field. |
FIELD_DATABASE | Specifies the DATABASE field. |
FIELD_DATE | Specifies the DATE field. |
FIELD_DDE | Specifies the DDE field. |
FIELD_DDE_AUTO | Specifies the DDEAUTO field. |
FIELD_DISPLAY_BARCODE | Specifies the DISPLAYBARCODE field. |
FIELD_DOC_PROPERTY | Specifies the DOCPROPERTY field. |
FIELD_DOC_VARIABLE | Specifies the DOCVARIABLE field. |
FIELD_EDIT_TIME | Specifies the EDITTIME field. |
FIELD_EMBED | Specifies the EMBED field. |
FIELD_EQUATION | Specifies the EQ field. |
FIELD_FILE_NAME | Specifies the FILENAME field. |
FIELD_FILE_SIZE | Specifies the FILESIZE field. |
FIELD_FILL_IN | Specifies the FILLIN field. |
FIELD_FOOTNOTE_REF | Specifies the FOOTNOTEREF field. |
FIELD_FORMULA | Specifies the = (formula) field. |
FIELD_FORM_CHECK_BOX | Specifies the FORMCHECKBOX field. |
FIELD_FORM_DROP_DOWN | Specifies the FORMDROPDOWN field. |
FIELD_FORM_TEXT_INPUT | Specifies the FORMTEXT field. |
FIELD_GLOSSARY | Specifies the GLOSSARY field. |
FIELD_GO_TO_BUTTON | Specifies the GOTOBUTTON field. |
FIELD_GREETING_LINE | Specifies the GREETINGLINE field. |
FIELD_HTML_ACTIVE_X | Specifies the field that represents an HTML control. |
FIELD_HYPERLINK | Specifies the HYPERLINK field. |
FIELD_IF | Specifies the IF field. |
FIELD_IMPORT | Specifies the IMPORT field. |
FIELD_INCLUDE | Specifies the INCLUDE field. |
FIELD_INCLUDE_PICTURE | Specifies the INCLUDEPICTURE field. |
FIELD_INCLUDE_TEXT | Specifies the INCLUDETEXT field. |
FIELD_INDEX | Specifies the INDEX field. |
FIELD_INDEX_ENTRY | Specifies the XE field. |
FIELD_INFO | Specifies the INFO field. |
FIELD_KEYWORD | Specifies the KEYWORDS field. |
FIELD_LAST_SAVED_BY | Specifies the LASTSAVEDBY field. |
FIELD_LINK | Specifies the LINK field. |
FIELD_LIST_NUM | Specifies the LISTNUM field. |
FIELD_MACRO_BUTTON | Specifies the MACROBUTTON field. |
FIELD_MERGE_BARCODE | Specifies the MERGEBARCODE field. |
FIELD_MERGE_FIELD | Specifies the MERGEFIELD field. |
FIELD_MERGE_REC | Specifies the MERGEREC field. |
FIELD_MERGE_SEQ | Specifies the MERGESEQ field. |
FIELD_NEXT | Specifies the NEXT field. |
FIELD_NEXT_IF | Specifies the NEXTIF field. |
FIELD_NONE | Field type is not specified or unknown. |
FIELD_NOTE_REF | Specifies the NOTEREF field. |
FIELD_NUM_CHARS | Specifies the NUMCHARS field. |
FIELD_NUM_PAGES | Specifies the NUMPAGES field. |
FIELD_NUM_WORDS | Specifies the NUMWORDS field. |
FIELD_OCX | Specifies the OCX field. |
FIELD_PAGE | Specifies the PAGE field. |
FIELD_PAGE_REF | Specifies the PAGEREF field. |
FIELD_PRINT | Specifies the PRINT field. |
FIELD_PRINT_DATE | Specifies the PRINTDATE field. |
FIELD_PRIVATE | Specifies the PRIVATE field. |
FIELD_QUOTE | Specifies the QUOTE field. |
FIELD_REF | Specifies the REF field. |
FIELD_REF_DOC | Specifies the RD field. |
FIELD_REF_NO_KEYWORD | Specifies that the field represents a REF field where the keyword has been omitted. |
FIELD_REVISION_NUM | Specifies the REVNUM field. |
FIELD_SAVE_DATE | Specifies the SAVEDATE field. |
FIELD_SECTION | Specifies the SECTION field. |
FIELD_SECTION_PAGES | Specifies the SECTIONPAGES field. |
FIELD_SEQUENCE | Specifies the SEQ field. |
FIELD_SET | Specifies the SET field. |
FIELD_SHAPE | Specifies the SHAPE field. |
FIELD_SKIP_IF | Specifies the SKIPIF field. |
FIELD_STYLE_REF | Specifies the STYLEREF field. |
FIELD_SUBJECT | Specifies the SUBJECT field. |
FIELD_SYMBOL | Specifies the SYMBOL field. |
FIELD_TEMPLATE | Specifies the TEMPLATE field. |
FIELD_TIME | Specifies the TIME field. |
FIELD_TITLE | Specifies the TITLE field. |
FIELD_TOA | Specifies the TOA field. |
FIELD_TOA_ENTRY | Specifies the TA field. |
FIELD_TOC | Specifies the TOC field. |
FIELD_TOC_ENTRY | Specifies the TC field. |
FIELD_USER_ADDRESS | Specifies the USERADDRESS field. |
FIELD_USER_INITIALS | Specifies the USERINITIALS field. |
FIELD_USER_NAME | Specifies the USERNAME field. |
length |
Methods
Method | Description |
---|---|
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.
FIELD_AUTO_NUM_LEGAL
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.
FIELD_HYPERLINK
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.
FIELD_LINK
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:
Parameter | Type | Description |
---|---|---|
fieldTypeName | java.lang.String |
Returns: int
getName(int fieldType)
public static String getName(int fieldType)
Parameters:
Parameter | Type | Description |
---|---|---|
fieldType | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int fieldType)
public static String toString(int fieldType)
Parameters:
Parameter | Type | Description |
---|---|---|
fieldType | int |
Returns: java.lang.String