generated.docs.javadoc.org.eclipse.dawnsci.nexus.builder.NexusFileBuilder.html Maven / Gradle / Ivy
NexusFileBuilder (h5jan API)
org.eclipse.dawnsci.nexus.builder
Interface NexusFileBuilder
-
- All Known Implementing Classes:
- DefaultNexusFileBuilder
public interface NexusFileBuilder
A builder for building a NeXus file. Wraps a TreeFile
object.
This object should first be configured with the expected content of the
NeXus file by calling newEntry()
, and calling the appropriate
method on that object, or by calling getNXroot()
or
getNexusTree()
and manipulating the nexus objects directly.
Once this object has been configured with the expected NeXus tree, then
the file should be created using #createFile()
. This
creates the NeXus file with the structure as configured.
-
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
NexusScanFile
createFile(boolean async)
Creates the NeXus file with the content as configured with this builder.
TreeFile
getNexusTree()
Returns the wrapped TreeFile
.
NXroot
getNXroot()
Returns the NXrootImpl
object at the root of the NeXus object tree.
NexusEntryBuilder
newEntry()
Creates a new NexusEntryBuilder
with the default name, "entry".
NexusEntryBuilder
newEntry(java.lang.String entryName)
Creates a new NexusEntryBuilder
with the given name.
void
validate()
Validates all entries within the NeXus file.
-
-
Method Detail
-
getNXroot
NXroot getNXroot()
Returns the NXrootImpl
object at the root of the NeXus object tree.
- Returns:
- the
NXrootImpl
-
newEntry
NexusEntryBuilder newEntry()
throws NexusException
Creates a new NexusEntryBuilder
with the default name, "entry".
- Returns:
- new
NexusEntryBuilder
- Throws:
NexusException
- if the entry could not be created for any reason
-
newEntry
NexusEntryBuilder newEntry(java.lang.String entryName)
throws NexusException
Creates a new NexusEntryBuilder
with the given name.
- Parameters:
entryName
- entry name
- Returns:
- new
NexusEntryBuilder
- Throws:
NexusException
- if the entry could not be created for any reason
-
validate
void validate()
throws NexusValidationException
Validates all entries within the NeXus file.
- Throws:
NexusValidationException
- if one or more of the entries in the nexus file
are invalid.
-
createFile
NexusScanFile createFile(boolean async)
throws NexusException
Creates the NeXus file with the content as configured with this builder.
The nexus file is left open and SWMR mode activated.
This file must be closed by calling #closeFile()
(or by using try-with-resources on this object).
- Parameters:
async
- if true, then all writes are done asynchronously
- Throws:
NexusException
- if the nexus file could not be saved for any reason