Beispiel #1
0
  private void processMetaProperty(String property) {
    if (property != null) {

      MetaUtils.validateProperties(
          property,
          metaPropertySet,
          prefixSet,
          path,
          parser.getLineNumber(),
          parser.getColumnNumber(),
          report,
          true);
    }
  }
Beispiel #2
0
  private void processMetaScheme(String scheme) {
    if (scheme != null) {

      MetaUtils.validateProperties(
          scheme,
          null,
          prefixSet,
          path,
          parser.getLineNumber(),
          parser.getColumnNumber(),
          report,
          true);
    }
  }
Beispiel #3
0
  private void processLinkRel(String rel) {
    if (rel != null) {

      MetaUtils.validateProperties(
          rel,
          linkRelSet,
          prefixSet,
          path,
          parser.getLineNumber(),
          parser.getColumnNumber(),
          report,
          false);
    }
  }
Beispiel #4
0
  private void processItemrefProperties(String property) {
    if (property == null) {
      return;
    }

    int propertiesNumber =
        MetaUtils.validateProperties(
                property,
                itemrefSet,
                prefixSet,
                path,
                parser.getLineNumber(),
                parser.getColumnNumber(),
                report,
                false)
            .size();

    if (propertiesNumber == 2) {
      report.message(
          MessageId.OPF_011,
          new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
    }
  }
Beispiel #5
0
  private void processItemProperties(String property, String mimeType) {
    if (property == null) {
      return;
    }

    Set<String> properties =
        MetaUtils.validateProperties(
            property,
            itemPropertySet,
            prefixSet,
            path,
            parser.getLineNumber(),
            parser.getColumnNumber(),
            report,
            false);
    mimeType = mimeType.trim();
    for (String propertyValue : properties) {
      boolean match = false;
      String expectedType = itemPropertyTypeMap.get(propertyValue);
      String expectedTypeArray[] = expectedType.split(" ");

      for (String expectedTypeItem : expectedTypeArray) {
        if (expectedTypeItem.equals(mimeType)) {
          match = true;
          break;
        }
      }
      if (!match) {
        report.message(
            MessageId.OPF_012,
            new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
            propertyValue,
            mimeType);
      }
    }
  }