Esempio n. 1
0
  /** Validate group 'sample' of type NXsample. */
  private void validateGroup_entry_sample(final NXsample group) throws Exception {
    // validate that the group is not null
    validateGroupNotNull("sample", NXsample.class, group);
    clearLocalGroupDimensionPlaceholderValues();

    // validate field 'name' of unknown type.
    final IDataset name = group.getName();
    validateFieldNotNull("name)", name);

    // validate field 'rotation_angle' of type NX_FLOAT.
    final IDataset rotation_angle = group.getRotation_angle();
    validateFieldNotNull("rotation_angle)", rotation_angle);
    validateFieldType("rotation_angle)", rotation_angle, NX_FLOAT);
    validateFieldUnits("rotation_angle", rotation_angle, NX_ANGLE);
    validateFieldRank("rotation_angle", rotation_angle, 1);
    validateFieldDimensions("rotation_angle", rotation_angle, null, "NP");
  }
Esempio n. 2
0
  /** Validate unnamed group of type NXsample. */
  private void validateGroup_NXentry_NXsample(final NXsample group)
      throws NexusValidationException {
    // validate that the group is not null
    validateGroupNotNull(null, NXsample.class, group);
    clearLocalGroupDimensionPlaceholderValues();

    // validate field 'rotation_angle' of type NX_NUMBER.
    final IDataset rotation_angle = group.getRotation_angle();
    validateFieldNotNull("rotation_angle", rotation_angle);
    validateFieldType("rotation_angle", rotation_angle, NX_NUMBER);
    validateFieldUnits("rotation_angle", rotation_angle, NX_ANGLE);

    // validate field 'seblock' of type NX_CHAR. Note: field not defined in base class.
    final IDataset seblock = group.getDataset("seblock");
    validateFieldNotNull("seblock", seblock);
    validateFieldType("seblock", seblock, NX_CHAR);

    // validate field 'temperature' of type NX_NUMBER.
    final IDataset temperature = group.getTemperature();
    validateFieldNotNull("temperature", temperature);
    validateFieldType("temperature", temperature, NX_NUMBER);
    validateFieldUnits("temperature", temperature, NX_TEMPERATURE);
    validateFieldDimensions("temperature", temperature, "NXsample", "n_Temp");
  }