it.unimi.di.mg4j.document.tika
Class TikaField

java.lang.Object
  extended by it.unimi.di.mg4j.document.tika.TikaField
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GreedyTikaField

public class TikaField
extends Object
implements Serializable

A Tika field represented inside MG4J.

See Also:
Serialized Form

Constructor Summary
TikaField()
          Creates a new Tika field corresponding to the Tika content: its Tika name is null and its MG4J name text.
TikaField(String tikaName)
          Creates a new Tika field with given Tika name and the same MG4J name.
TikaField(String mg4jName, String tikaName)
          Creates a new Tika field with given Tika name and given MG4J name.
 
Method Summary
 String contentFromMetadata(org.apache.tika.metadata.Metadata metadata)
          Gets the content of this Tika field from the given metadata.
 DocumentFactory.FieldType getType()
          The type of this field (currently only DocumentFactory.FieldType.TEXT is supported).
 boolean isBody()
          Returns true if this field represents the Tika content.
 String mg4jName()
          The MG4J name of this field.
 String tikaName()
          The Tika name of this field (null for the Tika content).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TikaField

public TikaField()
Creates a new Tika field corresponding to the Tika content: its Tika name is null and its MG4J name text.


TikaField

public TikaField(String tikaName)
Creates a new Tika field with given Tika name and the same MG4J name.

Parameters:
tikaName - the Tika name of the field, which will be used also as MG4J name.

TikaField

public TikaField(String mg4jName,
                 String tikaName)
Creates a new Tika field with given Tika name and given MG4J name.

Parameters:
mg4jName - the MG4J name of the field.
tikaName - the Tika name of the field.
Method Detail

mg4jName

public String mg4jName()
The MG4J name of this field.

Returns:
the MG4J name.

tikaName

public String tikaName()
The Tika name of this field (null for the Tika content).

Returns:
the Tika name.

contentFromMetadata

public String contentFromMetadata(org.apache.tika.metadata.Metadata metadata)
Gets the content of this Tika field from the given metadata.

Parameters:
metadata - the metadata.
Returns:
the content of this Tika field.

getType

public DocumentFactory.FieldType getType()
The type of this field (currently only DocumentFactory.FieldType.TEXT is supported).

Returns:
the type of this field.

isBody

public boolean isBody()
Returns true if this field represents the Tika content.

Returns:
true iff this field is the Tika content.