generated.docs.javadoc.org.eclipse.dawnsci.nexus.builder.appdef.impl.PredeterminedLinksApplicationDataBuilder.html Maven / Gradle / Ivy
PredeterminedLinksApplicationDataBuilder (h5jan API)
org.eclipse.dawnsci.nexus.builder.appdef.impl
Class PredeterminedLinksApplicationDataBuilder
- java.lang.Object
-
- org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
-
- org.eclipse.dawnsci.nexus.builder.appdef.impl.PredeterminedLinksApplicationDataBuilder
-
- All Implemented Interfaces:
- NexusDataBuilder
public class PredeterminedLinksApplicationDataBuilder
extends AbstractNexusDataBuilder
implements NexusDataBuilder
A data builder, wrapping an NXdata
base class instance, within an application definition where
the application definition has predetermined links for the fields within the NxData base class instance
to locations within the main NXsubentry
base class instance.
This class should only be used where by a class that implements NexusApplicationBuilder
for an application definition where the NeXus application definition specifies links for the
locations. NXtomo is an example of this.
when its NexusApplicationBuilder.newData()
method is invoked. It should then add
the appropriate links using the addLink(String, DataNode)
method of this class.
-
-
Field Summary
-
Fields inherited from class org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
entryBuilder, nxData
-
Fields inherited from interface org.eclipse.dawnsci.nexus.builder.data.NexusDataBuilder
ATTR_NAME_AXES, ATTR_NAME_LONG_NAME, ATTR_NAME_SIGNAL, ATTR_NAME_TARGET, ATTR_SUFFIX_INDICES, NO_DEFAULT_AXIS_PLACEHOLDER
-
Constructor Summary
Constructors
Constructor and Description
PredeterminedLinksApplicationDataBuilder(NXdata nxData)
Creates a new PredeterminedLinksApplicationDataBuilder
wrapping the given
NXdata
.
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
<N extends NXobject>
void
addAxisDevice(AxisDataDevice<N> dataDeviceModel)
Adds the data fields of the given device to the wrapped NXdata
group.
<N extends NXobject>
void
addAxisDevice(NexusObjectProvider<N> dataDevice,
java.lang.Integer defaultAxisDimension,
int... dimensionMappings)
Adds the data fields of the given device to the wrapped NXdata
group.
protected void
addLink(java.lang.String name,
DataNode dataNode)
Adds a field to the wrapped NXdata
linking to the given data node.
<N extends NXobject>
void
setPrimaryDevice(PrimaryDataDevice<N> primaryDeviceModel)
Sets the given device as the primary device of the wrapped NXdata
group.
-
Methods inherited from class org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
addAxisDevice, getNxData, setPrimaryDevice
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.dawnsci.nexus.builder.data.NexusDataBuilder
addAxisDevice, getNxData, setPrimaryDevice
-
-
Constructor Detail
-
PredeterminedLinksApplicationDataBuilder
public PredeterminedLinksApplicationDataBuilder(NXdata nxData)
Creates a new PredeterminedLinksApplicationDataBuilder
wrapping the given
NXdata
.
- Parameters:
nxData
- NXdata
to wrap.
-
Method Detail
-
addLink
protected void addLink(java.lang.String name,
DataNode dataNode)
throws NexusException
Adds a field to the wrapped NXdata
linking to the given data node.
- Parameters:
name
- name of field with in the NXdata
dataNode
- data node to link to
- Throws:
NexusException
-
setPrimaryDevice
public <N extends NXobject> void setPrimaryDevice(PrimaryDataDevice<N> primaryDeviceModel)
throws NexusException
Description copied from interface: NexusDataBuilder
Sets the given device as the primary device of the wrapped NXdata
group. The given DataDevice
object wraps a
NexusObjectProvider
and provides methods for configuring how the
DataNode
s for the device should be added to the NXdata
group.
- Specified by:
setPrimaryDevice
in interface NexusDataBuilder
- Parameters:
primaryDeviceModel
- a DataDevice
wrapping the NexusObjectProvider
that provides the NXobject
whose fields should be
added to the NXdata
- Throws:
NexusException
- if the device could not be added for any reason
-
addAxisDevice
public <N extends NXobject> void addAxisDevice(NexusObjectProvider<N> dataDevice,
java.lang.Integer defaultAxisDimension,
int... dimensionMappings)
throws NexusException
Description copied from interface: NexusDataBuilder
Adds the data fields of the given device to the wrapped NXdata
group. The fields do add are determined by
NexusObjectProvider.getAxisDataFieldNames()
.
Additionally the field with the name as returned by
NexusObjectProvider.getDefaultAxisDataFieldName()
, or by
NexusObjectProvider.getPrimaryDataFieldName()
if the
former is null
is set as the default axis of the main data
field of the NXdata
for the dimension with the given index (e.g.
the value of the @axes
attribute at that index is set to the
name of this field).
The dimension mappings for each field are set to those given. The
possible exception is that if the field that default axis dimension
applies to has a rank of 1 then this single dimension will be mapped to
the dimension of the given index of the main dataset.
- Specified by:
addAxisDevice
in interface NexusDataBuilder
- Parameters:
dataDevice
- data device
defaultAxisDimension
- the index of the axis of the main data field of the wrapped
NXdata
for which this device provides a default axis
value
dimensionMappings
- dimension mappings between the data field(s) of the device
and the @signal
field of the NXdata
group
- Throws:
NexusException
- if the device could not be added for any reason
-
addAxisDevice
public <N extends NXobject> void addAxisDevice(AxisDataDevice<N> dataDeviceModel)
throws NexusException
Description copied from interface: NexusDataBuilder
Adds the data fields of the given device to the wrapped NXdata
group. The given DataDevice
object wraps a
NexusObjectProvider
and provides methods for configuring how the
DataNode
s for the device should be added to the NXdata
- Specified by:
addAxisDevice
in interface NexusDataBuilder
- Parameters:
dataDeviceModel
- a DataDevice
wrapping the NexusObjectProvider
that provides the NXobject
whose fields should be
added to the NXdata
- Throws:
NexusException
- if the device could not be added for any reason