generated.docs.javadoc.org.eclipse.dawnsci.nexus.builder.NexusEntryBuilder.html Maven / Gradle / Ivy
NexusEntryBuilder (h5jan API)
org.eclipse.dawnsci.nexus.builder
Interface NexusEntryBuilder
-
- All Known Implementing Classes:
- DefaultNexusEntryBuilder
public interface NexusEntryBuilder
A builder for building a NeXus entry (NXentry
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
<N extends NXobject>
N
add(NexusObjectProvider<N> nexusObjectProvider)
Add the nexus object for the given NexusObjectProvider
provider
to this entry.
java.util.List<NXobject>
addAll(java.util.Collection<? extends NexusObjectProvider<?>> nexusObjectProviders)
Adds the nexus objects for the given NexusObjectProvider
s to
this entry.
void
addDefaultGroups()
Add the default groups to the entry.
void
addMetadata(NexusMetadataProvider metadataProvider)
Adds the given metadata to this entry.
NexusDataBuilder
createDefaultData()
Creates a new NexusDataBuilder
wrapping a new NXdata
object,
added to this entry with the default name 'data'.
DataNode
getDataNode(java.lang.String relativePath)
Returns the data node with the given path relative to the wrapped NXentryImpl
java.lang.String
getEntryName()
Returns the name of the wrapped NXentry
within the root node
of the nexus file
NXentry
getNXentry()
Returns the wrapped NXentry
object.
void
modifyEntry(java.util.Collection<NexusEntryModification> modifications)
Modifies the entry according to the given modifications.
void
modifyEntry(CustomNexusEntryModification modification)
Performs a custom modification to the wrapped NXentry
.
void
modifyEntry(NexusEntryModification modification)
Modifies the entry according to the given modification.
NexusApplicationBuilder
newApplication(NexusApplicationDefinition applicationDefinition)
Creates a new application wrapping an NXsubentry
object within this entry.
NexusApplicationBuilder
newApplication(java.lang.String entryName,
NexusApplicationDefinition applicationDefinition)
Creates a new application,
wrapping an NXsubentry
with the given name.
NexusDataBuilder
newData(java.lang.String name)
Creates a new NexusDataBuilder
wrapping a new NXdata
object
added to this entry with the given name.
void
setInstrumentName(java.lang.String instrumentName)
Sets the name of the NXinstrument
object within this entry.
void
validate()
Validate any NXsubentry
s within this entry according to their
application definitions.
-
-
Method Detail
-
addDefaultGroups
void addDefaultGroups()
Add the default groups to the entry. This method should be called before
calling add(NexusObjectProvider)
.
-
add
<N extends NXobject> N add(NexusObjectProvider<N> nexusObjectProvider)
throws NexusException
Add the nexus object for the given NexusObjectProvider
provider
to this entry. The nexus object (i.e. group node) returned by the
NexusObjectProvider#createNexusObject(NexusNodeFactory)
is added to the entry at an appropriate location.
For example, the NexusObjectProvider
could provide an NXdetector
which would be added to the NXinstrument
object in the nexus tree.
- Parameters:
nexusObjectProvider
- nexus object provider
- Returns:
- the nexus object created by the
NexusObjectProvider
- Throws:
NexusException
- if the nexus object could not be added for any reason
-
addAll
java.util.List<NXobject> addAll(java.util.Collection<? extends NexusObjectProvider<?>> nexusObjectProviders)
throws NexusException
Adds the nexus objects for the given NexusObjectProvider
s to
this entry. The nexus objects (i.e. group nodes) returned by the
NexusObjectProvider#createNexusObject(NexusNodeFactory)
is
added to the entry at an appropriate location.
For example, the NexusObjectProvider
could provide an NXdetector
which would be added to the NXinstrument
object in the nexus tree.
- Parameters:
nexusObjectProviders
-
- Returns:
- the nexus objects created by the
NexusObjectProvider
s
- Throws:
NexusException
- if the nexus objects could not be added for any reason
-
addMetadata
void addMetadata(NexusMetadataProvider metadataProvider)
throws NexusException
Adds the given metadata to this entry. A field is added to the wrapped
NXentry
(or to a child node of the appropriate type
as returned by NexusMetadataProvider.getCategory()
) for each
metadata entry.
- Parameters:
metadataProvider
- metadata provider
- Throws:
NexusException
- if the metadata could not be added for any reason
-
modifyEntry
void modifyEntry(CustomNexusEntryModification modification)
throws NexusException
Performs a custom modification to the wrapped NXentry
.
- Parameters:
modification
- custom modification
- Throws:
NexusException
- if the modification could not be performed for any reason
-
modifyEntry
void modifyEntry(NexusEntryModification modification)
throws NexusException
Modifies the entry according to the given modification.
- Parameters:
modification
- modification
- Throws:
NexusException
- if the modification could not be performed for any reason
-
modifyEntry
void modifyEntry(java.util.Collection<NexusEntryModification> modifications)
throws NexusException
Modifies the entry according to the given modifications.
- Parameters:
modifications
- modifications
- Throws:
NexusException
- if the modifications could not be performed for any reason
-
createDefaultData
NexusDataBuilder createDefaultData()
throws NexusException
Creates a new NexusDataBuilder
wrapping a new NXdata
object,
added to this entry with the default name 'data'. This is equivalent to
invoking newData("data")
.
- Returns:
- new
NexusDataBuilder
- Throws:
NexusException
- if the data could not be created for any reason
-
newData
NexusDataBuilder newData(java.lang.String name)
throws NexusException
Creates a new NexusDataBuilder
wrapping a new NXdata
object
added to this entry with the given name.
- Parameters:
name
-
- Returns:
- new
NexusDataBuilder
- Throws:
NexusException
- if the data could not be created for any reason
-
setInstrumentName
void setInstrumentName(java.lang.String instrumentName)
Sets the name of the NXinstrument
object within this entry.
- Parameters:
instrumentName
- instrument name
-
newApplication
NexusApplicationBuilder newApplication(NexusApplicationDefinition applicationDefinition)
throws NexusException
Creates a new application wrapping an NXsubentry
object within this entry.
- Parameters:
applicationDefinition
- application definition enumeration constant
- Returns:
- new
NexusApplicationBuilder
- Throws:
NexusException
- if the application could not be created for any reason
-
newApplication
NexusApplicationBuilder newApplication(java.lang.String entryName,
NexusApplicationDefinition applicationDefinition)
throws NexusException
Creates a new application,
wrapping an NXsubentry
with the given name.
- Parameters:
applicationDefinition
- application definition enumeration constant
- Returns:
- new
NexusApplicationBuilder
- Throws:
NexusException
- if the application could not be created for any reason
-
getDataNode
DataNode getDataNode(java.lang.String relativePath)
throws NexusException
Returns the data node with the given path relative to the wrapped NXentryImpl
- Parameters:
relativePath
-
- Returns:
- data node the data node at the given relative path
- Throws:
NexusException
- if no such node exists, or the node at the given relative
path is a data node
-
validate
void validate()
throws NexusValidationException
Validate any NXsubentry
s within this entry according to their
application definitions.
- Throws:
NexusValidationException
- if the entry is invalid
-
getEntryName
java.lang.String getEntryName()
Returns the name of the wrapped NXentry
within the root node
of the nexus file
- Returns:
- name of entry