Class TikaField
- java.lang.Object
-
- it.unimi.di.big.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
Constructors Constructor Description TikaField()Creates a new Tika field corresponding to the Tika content: its Tika name isnulland 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
Modifier and Type Method Description StringcontentFromMetadata(org.apache.tika.metadata.Metadata metadata)Gets the content of this Tika field from the given metadata.DocumentFactory.FieldTypegetType()The type of this field (currently onlyDocumentFactory.FieldType.TEXTis supported).booleanisBody()Returnstrueif this field represents the Tika content.Stringmg4jName()The MG4J name of this field.StringtikaName()The Tika name of this field (nullfor the Tika content).
-
-
-
Constructor Detail
-
TikaField
public TikaField()
Creates a new Tika field corresponding to the Tika content: its Tika name isnulland 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.
-
-
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 (nullfor 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 onlyDocumentFactory.FieldType.TEXTis supported).- Returns:
- the type of this field.
-
isBody
public boolean isBody()
Returnstrueif this field represents the Tika content.- Returns:
trueiff this field is the Tika content.
-
-