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 isnull
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
Modifier and Type Method Description 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 onlyDocumentFactory.FieldType.TEXT
is supported).boolean
isBody()
Returnstrue
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).
-
-
-
Constructor Detail
-
TikaField
public TikaField()
Creates a new Tika field corresponding to the Tika content: its Tika name isnull
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.
-
-
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 onlyDocumentFactory.FieldType.TEXT
is supported).- Returns:
- the type of this field.
-
isBody
public boolean isBody()
Returnstrue
if this field represents the Tika content.- Returns:
true
iff this field is the Tika content.
-
-