Package com.kodexa.client
Class Document
- java.lang.Object
-
- com.kodexa.client.Document
-
-
Field Summary
Fields Modifier and Type Field Description static String
CURRENT_VERSION
-
Constructor Summary
Constructors Constructor Description Document()
Document(File kddbFile)
Document(InputStream kddbInputStream)
-
Method Summary
-
-
-
Field Detail
-
CURRENT_VERSION
public static final String CURRENT_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Document
public Document()
-
Document
public Document(InputStream kddbInputStream)
-
-
Method Detail
-
getNodeCountByType
public long getNodeCountByType(String type)
-
getTaggedNodes
public List<ContentNode> getTaggedNodes()
-
getNodeByUuid
public ContentNode getNodeByUuid(String uuid)
-
getTaggedNodeByTagUuid
public List<ContentNode> getTaggedNodeByTagUuid(String tagUuid)
-
fromJson
@Deprecated public static Document fromJson(String json)
Deprecated.Create a new instance of a Document from JSON string- Parameters:
json
- String representation of the document JSON- Returns:
- De-serialized Document
-
fromMsgPack
@Deprecated public static Document fromMsgPack(byte[] bytes)
Deprecated.Create a Document from a message packed (kdx) representation- Parameters:
bytes
- the bytes for the message packed document- Returns:
- An instance of a Document
-
fromMsgPack
@Deprecated public static Document fromMsgPack(InputStream is)
Deprecated.Create a Document from a message packed (kdx) representation- Parameters:
is
- Input stream containing the document- Returns:
- An instance of a Document
-
fromMsgPack
@Deprecated public static Document fromMsgPack(File file)
Deprecated.Create a Document from a message packed (kdx) representation- Parameters:
file
- file containing the document- Returns:
- An instance of a Document
-
getPersistanceLayer
protected SqlitePersistenceLayer getPersistanceLayer()
-
fromInputStream
public static Document fromInputStream(InputStream inputStream)
-
toBytes
public byte[] toBytes()
-
toInputStream
public org.apache.commons.lang3.tuple.ImmutablePair<InputStream,Long> toInputStream()
-
close
public void close()
-
addLabel
public Document addLabel(String label)
Add the given label to the document- Parameters:
label
- the label to add- Returns:
- the instance of the document
-
removeLabel
public Document removeLabel(String label)
Remove the given label to the document- Parameters:
label
- the label to remove- Returns:
- the instance of the document
-
toJson
@Deprecated public String toJson(boolean pretty)
Deprecated.Convert the document to JSON- Parameters:
pretty
- include spacing and new lines if true- Returns:
- JSON representation of document
-
toMsgPack
@Deprecated public byte[] toMsgPack()
Deprecated.Create a message pack representation of this document- Returns:
- Byte array of the document packed
-
toJson
@Deprecated public String toJson()
Deprecated.Create a JSON representation of this document- Returns:
- String containing the JSON representation
-
createContentNode
public ContentNode createContentNode(String type, String content)
-
getPersistenceLayer
public SqlitePersistenceLayer getPersistenceLayer()
-
getMetadata
public Map<String,Object> getMetadata()
-
getSource
public SourceMetadata getSource()
-
getContentNode
public ContentNode getContentNode()
-
isVirtual
public boolean isVirtual()
-
getTaxonomies
public List<String> getTaxonomies()
-
getClasses
public List<ContentClassification> getClasses()
-
getVersion
public String getVersion()
-
setPersistenceLayer
public void setPersistenceLayer(SqlitePersistenceLayer persistenceLayer)
-
setMetadata
public void setMetadata(Map<String,Object> metadata)
-
setSource
public void setSource(SourceMetadata source)
-
setContentNode
public void setContentNode(ContentNode contentNode)
-
setVirtual
public void setVirtual(boolean virtual)
-
setTaxonomies
public void setTaxonomies(List<String> taxonomies)
-
setClasses
public void setClasses(List<ContentClassification> classes)
-
setVersion
public void setVersion(String version)
-
-