public interface SchematicEntry extends Cloneable
SchematicEntryLookup| Modifier and Type | Interface and Description |
|---|---|
static interface |
SchematicEntry.FieldName |
| Modifier and Type | Method and Description |
|---|---|
Document |
asDocument()
|
EditableDocument |
editDocumentContent()
Get an
editable document, when the content is a document. |
EditableDocument |
editMetadata()
Get an
editable metadata document. |
Object |
getContent()
Return this value's content.
|
Binary |
getContentAsBinary()
Get this value's content, if it is a Binary object.
|
Document |
getContentAsDocument()
Get this value's content, if it is a Document object.
|
String |
getContentType()
Get the media type describing the content.
|
Document |
getMetadata()
Get the metadata associated with this value.
|
boolean |
hasBinaryContent()
Return
true if the getContent() method would return a Binary (or getContentAsBinary() would
return a non-null value). |
boolean |
hasDocumentContent()
Return
true if the getContent() method would return a Document (or getContentAsDocument()
would return a non-null value). |
void |
setContent(Binary content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied
Binary data described by the supplied content type. |
void |
setContent(Document content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied Document and set the content type to be "
application/json". |
Document getMetadata()
String getContentType()
Object getContent()
Document or Binary.
Note that this method will return a non-null value only if the hasDocumentContent() method
returns true.Document object, or null if there is no contentDocument getContentAsDocument()
hasDocumentContent() returns true, and is therefore equivalent to the following:
return hasDocumentContent() ? (Document)getContent() : null;
Binary getContentAsBinary()
hasDocumentContent() returns false, and is therefore equivalent to the following:
return hasDocumentContent() ? (Binary)getContent() : null;
boolean hasDocumentContent()
true if the getContent() method would return a Document (or getContentAsDocument()
would return a non-null value).
This is equivalent to the following:
return getContent() instanceof Document;
true if the content is a Document, or false otherwiseboolean hasBinaryContent()
true if the getContent() method would return a Binary (or getContentAsBinary() would
return a non-null value).
This is equivalent to the following:
return getContent() instanceof Binary;
true if the content is a Binary value, or false otherwisevoid setContent(Document content, Document metadata, String defaultContentType)
application/json".content - the Document representing the JSON content; may not be nullmetadata - the Document representing the metadata; may be nulldefaultContentType - the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON, Schematic.ContentTypes.JSON_SCHEMA ,
or Schematic.ContentTypes.BSON; may not be nullvoid setContent(Binary content, Document metadata, String defaultContentType)
Binary data described by the supplied content type.content - the Binary representation of the content; may not be nullmetadata - the Document representing the metadata; may be nulldefaultContentType - the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON, Schematic.ContentTypes.JSON_SCHEMA ,
or Schematic.ContentTypes.BSON; may not be nullEditableDocument editMetadata()
editable metadata document. The client is expected to make these edits within the context
of a transaction, and the edits will be saved when the transaction is committed.editDocumentContent()EditableDocument editDocumentContent()
editable document, when the content is a document. The client
is expected to make these edits within the context of a transaction, and the edits will be saved when the transaction is
committed.editMetadata()Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.