Exemple #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 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 attribute 'entry'
    final Attribute entry_attr = group.getAttribute("entry");
    validateAttributeNotNull("entry", entry_attr);

    // 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 'end_time' of type NX_DATE_TIME.
    final IDataset end_time = group.getEnd_time();
    validateFieldNotNull("end_time", end_time);
    validateFieldType("end_time", end_time, NX_DATE_TIME);

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

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

    // validate child group 'sample' of type NXsample
    validateGroup_NXentry_sample(group.getSample());

    // validate child group 'control' of type NXmonitor
    validateGroup_NXentry_control(group.getMonitor());

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