public interface Document extends DocumentWorkerObject
The document has a reference and fields associated with it which may be manipulated when it is processed. Additionally it may also have custom data associated with it which can be used to affect how the document is processed without actually becoming metadata of the document. Furthermore a document may have subdocuments which can also be manipulated when it is processed.
If there is a failure processing the document then the failure information may also be stored with the document.
| Modifier and Type | Method and Description |
|---|---|
void |
addFailure(String failureId,
String failureMessage)
Records the specified failure on the document.
|
String |
getCustomData(String dataKey)
Used to retrieve any custom data that was sent with the document, but which is not technically part of it.
|
Failures |
getFailures()
Gets the collection of failures that are currently associated with the document.
|
Field |
getField(String fieldName)
Gets a field object for the specified field.
|
Fields |
getFields()
Gets the list of fields currently associated with the document.
|
Document |
getParentDocument()
Returns the parent document of this document, or
null if this document does not have a parent document. |
String |
getReference()
Returns the reference that is associated with the document.
|
Document |
getRootDocument()
Returns the root document of this document's hierarchy.
|
Subdocuments |
getSubdocuments()
Gets the list of subdocuments currently associated with the document.
|
Task |
getTask()
Returns the task that is associated with the document.
|
boolean |
hasChanges()
Returns true if the document has been modified from its original state.
|
boolean |
hasSubdocuments()
Returns true if this document currently has any child subdocuments.
|
void |
reset()
Resets the document, and all of its subdocuments, back to its original state, undoing any modifications that have been made to the
document.
|
void |
resetReference()
Resets the reference back to its original state, undoing any changes made to it using the
setReference() method. |
void |
setReference(String reference)
Sets the reference that should be associated with the document.
|
getApplication@Nonnull Task getTask()
String getReference()
void setReference(String reference)
reference - the reference to be associated with the documentvoid resetReference()
setReference() method.@Nonnull Fields getFields()
@Nonnull Field getField(String fieldName)
fieldName - the name of the field to accessString getCustomData(String dataKey)
dataKey - the key of the data to be retrieved (note that the key lookup is case-sensitive)@Nonnull Failures getFailures()
void addFailure(String failureId, String failureMessage)
failureId - a non-localisable identifier related to the failurefailureMessage - a human readable message relating to the failureDocument getParentDocument()
null if this document does not have a parent document.@Nonnull Document getRootDocument()
@Nonnull Subdocuments getSubdocuments()
Subdocuments are ordered and can be accessed by index. If a subdocument is deleted then it is immediately removed from the list, causing the indexes of the subdocuments following it to be changed.
boolean hasSubdocuments()
boolean hasChanges()
void reset()
Copyright © 2016–2022 EntIT Software LLC, a Micro Focus company. All rights reserved.