Package org.gitana.platform.client.document

# Class DocumentImpl

java.lang.Object
org.gitana.platform.support.GitanaObjectImpl
org.gitana.platform.client.document.DocumentImpl

All Implemented Interfaces:
  `Serializable`, `Document`, `TitleDescription`, `org.gitana.platform.GitanaObject`, `org.gitana.platform.JSONable`

Direct Known Subclasses:
  `AbstractClusterDocumentImpl`, `AbstractDataStoreImpl`, `AbstractPlatformDocumentImpl`

public class DocumentImpl extends org.gitana.platform.support.GitanaObjectImpl implements Document
Wraps a JSON response from the Gitana server.

Author:
  uzi
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.gitana.platform.support.GitanaObjectImpl

`serialVersionUID`

### Fields inherited from interface org.gitana.platform.client.document.Document

`FIELD_ID, SYSTEM, SYSTEM_CREATED_BY, SYSTEM_CREATED_ON, SYSTEM_MODIFIED_BY, SYSTEM_MODIFIED_ON`

### Fields inherited from interface org.gitana.platform.client.support.TitleDescription

`FIELD_DESCRIPTION, FIELD_TITLE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`DocumentImpl(com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)`

## Method Summary

Modifier and Type
Method
Description
`Calendar`
`dateCreated()`
`Calendar`
`dateModified()`
`String`
`getCreatedBy()`
`String`
`getDescription()`
`String`
`getId()`
Gets the id of the document.
`String`
`getModifiedBy()`
`com.fasterxml.jackson.databind.node.ObjectNode`
`getSystemObject()`
`String`
`getTitle()`
`boolean`
`isSaved()`
`protected com.fasterxml.jackson.databind.node.ObjectNode`
`mergeProperties(com.fasterxml.jackson.databind.node.ObjectNode original, com.fasterxml.jackson.databind.node.ObjectNode incoming)`
`protected void`
`mergePropertyIfExists(com.fasterxml.jackson.databind.node.ObjectNode source, com.fasterxml.jackson.databind.node.ObjectNode target, String propertyName)`
`void`
`reload(com.fasterxml.jackson.databind.node.ObjectNode source)`
Reloads the contents of this document with that of the given json
`void`
`reload(Document document)`
Reloads the node from a persisted document (which represents the node).
`void`
`setDescription(String description)`
Sets the description
`void`
`setId(String id)`
Sets the id of the document.
`void`
`setSaved(boolean isSaved)`
Marks the object as having been persisted (written to disk).
`void`
`setTitle(String title)`
Sets the title

### Methods inherited from class org.gitana.platform.support.GitanaObjectImpl

`_objectGetFloat, _objectGetInt, _objectGetLong, _objectGetObject, _objectGetString, _objectSet, get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, putObject, remove, set, toJSON, toJSONString, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.gitana.platform.GitanaObject

`get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, remove, set`

### Methods inherited from interface org.gitana.platform.JSONable

`toJSON, toJSONString`

## Constructor Details

### DocumentImpl

protected DocumentImpl(com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)

## Method Details

### getId

public String getId()
Description copied from interface: `Document`
Gets the id of the document.

Specified by:
  `getId` in interface `Document`
Returns:

### setId

public void setId(String id)
Description copied from interface: `Document`
Sets the id of the document.

Specified by:
  `setId` in interface `Document`
Parameters:
  `id` -

### getTitle

public String getTitle()

Specified by:
  `getTitle` in interface `TitleDescription`
Returns:
  the title

### setTitle

public void setTitle(String title)
Description copied from interface: `TitleDescription`
Sets the title

Specified by:
  `setTitle` in interface `TitleDescription`
Parameters:
  `title` -

### getDescription

public String getDescription()

Specified by:
  `getDescription` in interface `TitleDescription`
Returns:
  the description

### setDescription

public void setDescription(String description)
Description copied from interface: `TitleDescription`
Sets the description

Specified by:
  `setDescription` in interface `TitleDescription`
Parameters:
  `description` -

### reload

public void reload(Document document)
Description copied from interface: `Document`
Reloads the node from a persisted document (which represents the node).

Specified by:
  `reload` in interface `Document`
Parameters:
  `document` -

### reload

public void reload(com.fasterxml.jackson.databind.node.ObjectNode source)
Description copied from interface: `Document`
Reloads the contents of this document with that of the given json

Specified by:
  `reload` in interface `Document`
Parameters:
  `source` -

### mergeProperties

protected com.fasterxml.jackson.databind.node.ObjectNode mergeProperties(com.fasterxml.jackson.databind.node.ObjectNode original, com.fasterxml.jackson.databind.node.ObjectNode incoming)

### mergePropertyIfExists

protected void mergePropertyIfExists(com.fasterxml.jackson.databind.node.ObjectNode source, com.fasterxml.jackson.databind.node.ObjectNode target, String propertyName)

### isSaved

public boolean isSaved()

Specified by:
  `isSaved` in interface `Document`
Returns:
  whether the document has been persisted

### setSaved

public void setSaved(boolean isSaved)
Description copied from interface: `Document`
Marks the object as having been persisted (written to disk). True indicates the object has been written into the data store. False indicates that the object is in-memory only.

Specified by:
  `setSaved` in interface `Document`
Parameters:
  `isSaved` -

### getSystemObject

public com.fasterxml.jackson.databind.node.ObjectNode getSystemObject()

Specified by:
  `getSystemObject` in interface `Document`

### dateModified

public Calendar dateModified()

Specified by:
  `dateModified` in interface `Document`

### dateCreated

public Calendar dateCreated()

Specified by:
  `dateCreated` in interface `Document`

### getCreatedBy

public String getCreatedBy()

Specified by:
  `getCreatedBy` in interface `Document`

### getModifiedBy

public String getModifiedBy()

Specified by:
  `getModifiedBy` in interface `Document`