示例#1
0
  /** Validate unnamed group of type NXentry. */
  private void validateGroup_NXentry(final NXsubentry group) throws NexusValidationException {
    // validate that the group is not null
    validateGroupNotNull(null, NXentry.class, group);

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

    // validate field 'definition' of unknown type.
    final IDataset definition = group.getDefinition();
    validateFieldNotNull("definition", definition);
    validateFieldEnumeration("definition", definition, "NXSPE", "NXspe");
    // validate attribute 'version' of field 'definition'
    final Attribute definition_attr_version = group.getAttribute("version");
    validateAttributeNotNull("version", definition_attr_version);

    // validate child group 'NXSPE_info' of type NXcollection
    validateGroup_NXentry_NXSPE_info(group.getCollection());

    // validate child group 'data' of type NXdata
    validateGroup_NXentry_data(group.getData());

    // validate unnamed child group of type NXinstrument (possibly multiple)
    final Map<String, NXinstrument> allInstrument = group.getAllInstrument();
    for (final NXinstrument instrument : allInstrument.values()) {
      validateGroup_NXentry_NXinstrument(instrument);
    }

    // validate unnamed child group of type NXsample (possibly multiple)
    final Map<String, NXsample> allSample = group.getAllSample();
    for (final NXsample sample : allSample.values()) {
      validateGroup_NXentry_NXsample(sample);
    }
  }
  /** Validate group 'entry' of type NXentry. */
  private void validateGroup_entry(final NXsubentry group) throws NexusValidationException {
    // validate that the group is not null
    validateGroupNotNull("entry", NXentry.class, group);

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

    // validate field 'start_time' of type NX_DATE_TIME.
    final IDataset start_time = group.getStart_time();
    validateFieldNotNull("start_time", start_time);
    validateFieldType("start_time", start_time, NX_DATE_TIME);

    // validate field 'definition' of unknown type.
    final IDataset definition = group.getDefinition();
    validateFieldNotNull("definition", definition);
    validateFieldEnumeration("definition", definition, "NXtofraw");

    // validate field 'duration' of type NX_FLOAT.
    final IDataset duration = group.getDuration();
    validateFieldNotNull("duration", duration);
    validateFieldType("duration", duration, NX_FLOAT);
    validateFieldUnits("duration", duration, NX_TIME);

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

    // validate field 'pre_sample_flightpath' of type NX_FLOAT.
    final IDataset pre_sample_flightpath = group.getPre_sample_flightpath();
    validateFieldNotNull("pre_sample_flightpath", pre_sample_flightpath);
    validateFieldType("pre_sample_flightpath", pre_sample_flightpath, NX_FLOAT);
    validateFieldUnits("pre_sample_flightpath", pre_sample_flightpath, NX_LENGTH);

    // validate child group 'user' of type NXuser
    validateGroup_entry_user(group.getUser());

    // validate child group 'instrument' of type NXinstrument
    validateGroup_entry_instrument(group.getInstrument());

    // validate unnamed child group of type NXsample (possibly multiple)
    final Map<String, NXsample> allSample = group.getAllSample();
    for (final NXsample sample : allSample.values()) {
      validateGroup_entry_NXsample(sample);
    }

    // validate unnamed child group of type NXmonitor (possibly multiple)
    final Map<String, NXmonitor> allMonitor = group.getAllMonitor();
    for (final NXmonitor monitor : allMonitor.values()) {
      validateGroup_entry_NXmonitor(monitor);
    }

    // validate child group 'data' of type NXdata
    validateGroup_entry_data(group.getData());
  }