public final class ReqIFFile
extends java.lang.Object
ReqIFArchive
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
extension |
Modifier and Type | Method and Description |
---|---|
static ReqIFFile |
create(java.lang.String path,
java.lang.String comment,
java.util.Date creationTime,
java.lang.String repositoryId,
java.lang.String reqIFToolId,
java.lang.String sourceToolId,
java.lang.String title,
java.lang.String reqIFIdentifier)
Creates a new ReqIF file at the location specified and using the specified parameters for the Header
|
CoreContent |
getCoreContent()
The
CoreContent object contained within this ReqIFFile object. |
java.lang.String |
getExchangeConversationIdentifier()
The unique exchange conversation identifier for this ReqIF file.
|
java.lang.String |
getFilename()
The name of the ReqIF file either standalone or within the archive.
|
java.lang.String |
getFullPath()
Returns the path of this
ReqIFFile |
java.util.List<ReferencedFile> |
getReferencedFiles() |
ReqIFArchive |
getReqIFArchive() |
TheHeader |
getTheHeader()
|
ToolExtensions |
getToolExtensions()
The
ToolExtensions object contained within this ReqIFFile object. |
boolean |
isModified()
Returns the modified status of this ReqIF file.
|
boolean |
isUniqueIdentifier(java.lang.String identifier)
Checks whether the specified identifier is defined in this
ReqIFFile |
static ReqIFFile |
load(java.lang.String reqIFPath,
java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
Create a
ReqIFFile object from an existing .reqif file outside of an ReqIFArchive . |
void |
save(java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
Saves this ReqIF.
|
void |
setExchangeConversationIdentifier(java.lang.String exchangeConversationIdentifier)
Sets the exchange conversation identifier for this ReqIF file.
|
void |
setFilename(java.lang.String filename)
Renames the ReqIF file
|
void |
setIsModified(boolean isModified)
Allows to set the modified state of the ReqIF file.
|
static ValidationOutcome |
validate(java.lang.String reqIFPath,
java.util.function.Consumer<java.lang.String> logValidationMessage)
Performs validation of the ReqIF file specified by reqIFPath against reqif.xsd.
|
public static final java.lang.String extension
public java.util.List<ReferencedFile> getReferencedFiles()
public boolean isModified()
true
if any part of this ReqIF has been changed since it was either created or loaded
false
otherwisepublic static ReqIFFile load(java.lang.String reqIFPath, java.util.function.Consumer<ValidationMessage> validationMessageConsumer) throws FileException, ValidationException, com.reqdesign.reqif.LicenseException
ReqIFFile
object from an existing .reqif file outside of an ReqIFArchive
.reqIFPath
- path to the .reqif file, not nullvalidationMessageConsumer
- a consumer of validation message objects ValidationMessage
, not nullReqIFFile
objectFileException
- if the specified file is missing, corrupt or an IO exception occursValidationException
- if xsd validation or schema compliance errors occur that prevent loading e.g., REQ-IF-HEADER
errorsLicenseException
- if a valid license is not installedpublic static ReqIFFile create(java.lang.String path, java.lang.String comment, java.util.Date creationTime, java.lang.String repositoryId, java.lang.String reqIFToolId, java.lang.String sourceToolId, java.lang.String title, java.lang.String reqIFIdentifier) throws InvalidValueException, InvalidIdentifierException, FileException, com.reqdesign.reqif.LicenseException
path
- the path for the new ReqIFFile, not nullcomment
- the value to be assigned to the COMMENT
header element, can be nullcreationTime
- the value to be assigned to the CREATION-DATE
header element, can be null to auto-assign 'now'repositoryId
- the value to be assigned to the REPOSITORY-ID
header element, can be nullreqIFToolId
- the value to be assigned to the REQ-IF-TOOL-ID
header element, not nullsourceToolId
- the value to be assigned to the SOURCE-TOOL-ID
header element, not nulltitle
- the value to be assigned to the TITLE
header element, not nullreqIFIdentifier
- the value to be assigned to the @IDENTIFIER
header attribute, not null and uniqueReqIFFile
object, not nullInvalidValueException
- if any parameter contains an unexpected valueInvalidIdentifierException
- if the reqIFIdentifier parameter is not a valid xsd:IDFileException
- if an exception occurs in the file system during ReqIF creationLicenseException
- if a valid license is not installedpublic boolean isUniqueIdentifier(java.lang.String identifier)
ReqIFFile
identifier
- String
identifier to checkBoolean
flag indicating wehether the specified identifier is defined in this ReqIFFile
public ReqIFArchive getReqIFArchive()
ReqIFArchive
object, nullablepublic java.lang.String getFilename()
public void setFilename(java.lang.String filename) throws java.lang.IllegalArgumentException
filename
- the String
name to set for the filename, not nulljava.lang.IllegalArgumentException
- if the filename is invalidpublic TheHeader getTheHeader()
TheHeader
objectpublic CoreContent getCoreContent()
CoreContent
object contained within this ReqIFFile
object.CoreContent
objectpublic ToolExtensions getToolExtensions()
ToolExtensions
object contained within this ReqIFFile
object.ToolExtensions
object, not nullpublic java.lang.String getFullPath()
ReqIFFile
ReqIFFile
public java.lang.String getExchangeConversationIdentifier()
The ReqIF standard currently does not allow identifying which "conversation" (a.k.a. exchange process) a ReqIF XML document belongs to. This is solved by having an explicit "conversation identifier", that means: each exchange process gets its own, distinct identifier. It is an identifier that is created during the first export of a ReqIF XML document in a chain of exports and imports, and is not changed by following imports and exports of ReqIF XML documents. To preserve the conversation identifier, each exported ReqIF file stores the conversation identifier.
public void setExchangeConversationIdentifier(java.lang.String exchangeConversationIdentifier) throws InvalidValueException
exchangeConversationIdentifier
- the exchange conversation identifier to set for this ReqIF file, not nullInvalidValueException
- if the specified value is null or emptypublic void save(java.util.function.Consumer<ValidationMessage> validationMessageConsumer) throws FileException
ReqIFArchive
, calling this method will save the ReqIF
inside the archive but the archive must still be saved by calling the ReqIFArchive.save(Consumer)
method
if the archive was loaded or ReqIFArchive.saveAs(String, Consumer)
if the archive was created.validationMessageConsumer
- a consumer of validation message objects ValidationMessage
, not nullFileException
- if a file system exception occurspublic void setIsModified(boolean isModified)
isModified
- the required modified state boolean
public static ValidationOutcome validate(java.lang.String reqIFPath, java.util.function.Consumer<java.lang.String> logValidationMessage) throws FileException
reqIFPath
- the full path to the ReqIF file, not nulllogValidationMessage
- a consumer of validation messages, can be null in which case validation messages are ignoredValidationOutcome
enumeration value, not nullFileException
- if the specified file does not exist