public class KVPDoc extends java.lang.Object implements ProcessableDocument
Modifier and Type | Class and Description |
---|---|
static class |
KVPDoc.KVDirective |
static class |
KVPDoc.KVMeta |
static class |
KVPDoc.KVPart |
ProcessableDocument.Operation
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
directives |
java.util.List<KVPDoc.KVMeta> |
metas |
java.util.List<DocumentPart> |
parts |
ProcessableDocument.Operation |
processingFlag |
java.lang.String |
source |
java.lang.String |
uri |
Constructor and Description |
---|
KVPDoc() |
KVPDoc(java.lang.String source,
java.lang.String uri) |
Modifier and Type | Method and Description |
---|---|
void |
addCustomDirective(java.lang.String key,
java.lang.String value)
Add a custom document-level directive
|
void |
addMeta(java.lang.String name,
java.lang.String value)
Add a new meta for the document.
|
void |
addPart(DocumentPart part)
Add a part.
|
DocumentPart |
addPart(java.lang.String name)
Create a new part inside document and returns it.
|
DocumentPart |
addPart(java.lang.String name,
byte[] content)
Create a new part inside document and returns it.
|
DocumentPart |
addPart(java.lang.String name,
java.nio.ByteBuffer content)
Create a new part inside document and returns it.
|
void |
checkMeta(int idx,
java.lang.String name,
java.lang.String value) |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getCustomDirectives()
Document-level directives
|
java.lang.String |
getFirstMetaValue(java.lang.String name)
Get the first value for the metas with a given name.
|
java.util.List<Meta> |
getMetaList() |
java.lang.Iterable<? extends Meta> |
getMetas()
Get all metas of this document.
|
java.lang.Iterable<? extends Meta> |
getMetas(java.util.Collection<java.lang.String> names)
Get the metas of this document with one of the given names.
|
java.lang.Iterable<? extends Meta> |
getMetas(java.lang.String name)
Get the metas of this document with a given name.
|
java.lang.Iterable<? extends Meta> |
getMetas(java.lang.String[] names)
Get the metas of this document with one of the given names.
|
java.lang.Iterable<java.lang.String> |
getMetaValues(java.lang.String name)
Get the values for the metas with a given name.
|
DocumentPart |
getPart(java.lang.String name)
Get the Binary Part with the given name.
|
java.lang.Iterable<? extends DocumentPart> |
getParts()
Get the Binary Parts associated to the document.
|
ProcessableDocument.Operation |
getProcessingFlag()
Get the global processing flag of the document.
|
java.lang.String |
getSource()
Get the source that generated this document
|
java.lang.String |
getURI()
Get the URI of the Document.
|
int |
nbParts()
Get the number of parts
|
void |
removeCustomDirective(java.lang.String key)
Remove all custom document-level directives associated to this key
|
void |
removeMetas(java.util.Collection<java.lang.String> names)
Remove all metas with one of the given name.
|
void |
removeMetas(java.lang.String name)
Remove all metas with a given name.
|
void |
removeMetas(java.lang.String[] names)
Remove all metas with one of the given name.
|
void |
removePart(java.lang.String name)
Remove the part from the document.
|
void |
setProcessingFlag(ProcessableDocument.Operation op)
Set the global processing flag of the document.
|
public java.util.List<DocumentPart> parts
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> directives
public java.util.List<KVPDoc.KVMeta> metas
public ProcessableDocument.Operation processingFlag
public java.lang.String source
public java.lang.String uri
public KVPDoc()
public KVPDoc(java.lang.String source, java.lang.String uri)
public void addCustomDirective(java.lang.String key, java.lang.String value)
ProcessableDocument
addCustomDirective
in interface ProcessableDocument
public void removeCustomDirective(java.lang.String key)
ProcessableDocument
removeCustomDirective
in interface ProcessableDocument
public void addMeta(java.lang.String name, java.lang.String value)
ProcessableDocument
addMeta
in interface ProcessableDocument
public void addPart(DocumentPart part) throws java.lang.IllegalArgumentException
ProcessableDocument
addPart
in interface ProcessableDocument
java.lang.IllegalArgumentException
- a part with the same name already existspublic DocumentPart addPart(java.lang.String name) throws java.lang.IllegalArgumentException
ProcessableDocument
addPart
in interface ProcessableDocument
name
- the part's namejava.lang.IllegalArgumentException
- a part with the same name already existspublic DocumentPart addPart(java.lang.String name, byte[] content) throws java.lang.IllegalArgumentException
ProcessableDocument
addPart
in interface ProcessableDocument
name
- the part's namecontent
- the part's contentjava.lang.IllegalArgumentException
- a part with the same name already existspublic DocumentPart addPart(java.lang.String name, java.nio.ByteBuffer content) throws java.lang.IllegalArgumentException
ProcessableDocument
addPart
in interface ProcessableDocument
name
- the part namejava.lang.IllegalArgumentException
- a part with the same name already existspublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCustomDirectives()
ProcessableDocument
getCustomDirectives
in interface ProcessableDocument
public java.lang.Iterable<java.lang.String> getMetaValues(java.lang.String name)
ProcessableDocument
getMetaValues
in interface ProcessableDocument
public java.lang.String getFirstMetaValue(java.lang.String name)
ProcessableDocument
getFirstMetaValue
in interface ProcessableDocument
public java.lang.Iterable<? extends Meta> getMetas()
ProcessableDocument
getMetas
in interface ProcessableDocument
public java.lang.Iterable<? extends Meta> getMetas(java.lang.String name)
ProcessableDocument
getMetas
in interface ProcessableDocument
public java.lang.Iterable<? extends Meta> getMetas(java.lang.String[] names)
ProcessableDocument
getMetas
in interface ProcessableDocument
public java.lang.Iterable<? extends Meta> getMetas(java.util.Collection<java.lang.String> names)
ProcessableDocument
getMetas
in interface ProcessableDocument
public java.lang.Iterable<? extends DocumentPart> getParts()
ProcessableDocument
getParts
in interface ProcessableDocument
public DocumentPart getPart(java.lang.String name)
ProcessableDocument
getPart
in interface ProcessableDocument
public ProcessableDocument.Operation getProcessingFlag()
ProcessableDocument
getProcessingFlag
in interface ProcessableDocument
public java.lang.String getSource()
ProcessableDocument
getSource
in interface ProcessableDocument
public java.lang.String getURI()
ProcessableDocument
getURI
in interface ProcessableDocument
public int nbParts()
ProcessableDocument
nbParts
in interface ProcessableDocument
public void removeMetas(java.lang.String name)
ProcessableDocument
removeMetas
in interface ProcessableDocument
public void removeMetas(java.lang.String[] names)
ProcessableDocument
removeMetas
in interface ProcessableDocument
public void removeMetas(java.util.Collection<java.lang.String> names)
ProcessableDocument
removeMetas
in interface ProcessableDocument
public void removePart(java.lang.String name)
ProcessableDocument
removePart
in interface ProcessableDocument
public void setProcessingFlag(ProcessableDocument.Operation op)
ProcessableDocument
setProcessingFlag
in interface ProcessableDocument
public java.util.List<Meta> getMetaList()
public void checkMeta(int idx, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
Copyright © 2013 Dassault Systèmes, All Rights Reserved.