示例#1
0
  /** Determines if this is a property that should be analyzed by text processing tools. */
  protected boolean isTextProperty(Property property) {
    if (property == null) {
      return false;
    }

    if (property.getName().equals(LumifyProperties.RAW.getPropertyName())) {
      return false;
    }

    String mimeType =
        (String) property.getMetadata().get(LumifyProperties.MIME_TYPE.getPropertyName());
    return !(mimeType == null || !mimeType.startsWith("text"));
  }
  @Override
  public boolean isHandled(Element element, Property property) {
    if (property == null) {
      return false;
    }

    if (property.getName().equals(LumifyProperties.RAW.getPropertyName())) {
      return false;
    }

    String mimeType =
        (String) property.getMetadata().get(LumifyProperties.MIME_TYPE.getPropertyName());
    return !(mimeType == null || !mimeType.startsWith("text"));
  }