Class NoContentTransformer

  • All Implemented Interfaces:
    IXMLConfigurable, IImporterHandler, IDocumentTransformer

    public class NoContentTransformer
    extends AbstractDocumentTransformer
    implements IXMLConfigurable

    Get rid of the content stream and optionally store it as text into a metadata field instead.

    Storing content in an existing field

    If a toField with the same name already exists for a document, the value will be added to the end of the existing value list. It is possible to change this default behavior by supplying a PropertySetter.

    This class can be used both as a pre-parsing or post-parsing handler. To store the content in a field, make sure pre-parsing is of a text content-types.

    XML configuration usage:

    
    <handler
        class="com.norconex.importer.handler.transformer.impl.NoContentTransformer"
        toField="(Optionally store content into a field.)">
      <!-- multiple "restrictTo" tags allowed (only one needs to match) -->
      <restrictTo>
        <fieldMatcher>(field-matching expression)</fieldMatcher>
        <valueMatcher>(value-matching expression)</valueMatcher>
      </restrictTo>
    </handler>

    XML usage example:

    
    <handler
        class="NoContentTransformer"/>

    The above example removes the content of all documents (leaving you with metadata only).

    Since:
    3.0.0
    Author:
    Pascal Essiembre