public class DocumentFactory extends Object
EditableDocument
instancesModifier and Type | Field and Description |
---|---|
protected static DocumentValueFactory |
DEFAULT_FACTORY |
Constructor and Description |
---|
DocumentFactory() |
Modifier and Type | Method and Description |
---|---|
static EditableArray |
newArray()
Create a new, empty editable array that can be used as a new array value in other documents.
|
static EditableArray |
newArray(Collection<?> values)
Create a new editable array that can be used as a new array value in other documents.
|
static EditableArray |
newArray(int initialCapacity)
Create a new, empty editable array that can be used as a new array value in other documents.
|
static EditableArray |
newArray(Object... values)
Create a new editable array that can be used as a new array value in other documents.
|
static EditableDocument |
newDocument()
Create a new editable document that can be used as a new document entry in a SchematicDb or as nested documents for other
documents.
|
static EditableDocument |
newDocument(Document original)
Create a new editable document that is a copy of the supplied document.
|
static EditableDocument |
newDocument(String name,
Object value)
Create a new editable document, initialized with a single field, that can be used as a new document entry in a SchematicDb
or as nested documents for other documents.
|
static EditableDocument |
newDocument(String name1,
Object value1,
String name2,
Object value2)
Create a new editable document, initialized with two fields, that can be used as a new document entry in a SchematicDb or
as nested documents for other documents.
|
static EditableDocument |
newDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3)
Create a new editable document, initialized with three fields, that can be used as a new document entry in a SchematicDb or
as nested documents for other documents.
|
static EditableDocument |
newDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3,
String name4,
Object value4)
Create a new editable document, initialized with four fields, that can be used as a new document entry in a SchematicDb or
as nested documents for other documents.
|
protected static DocumentValueFactory DEFAULT_FACTORY
public static EditableDocument newDocument(Document original)
original
- the original documentpublic static EditableDocument newDocument()
public static EditableDocument newDocument(String name, Object value)
name
- the name of the initial field in the resulting document; if null, the field will not be added to the returned
documentvalue
- the value of the initial field in the resulting documentpublic static EditableDocument newDocument(String name1, Object value1, String name2, Object value2)
name1
- the name of the first field in the resulting document; if null, the field will not be added to the returned
documentvalue1
- the value of the first field in the resulting documentname2
- the name of the second field in the resulting document; if null, the field will not be added to the returned
documentvalue2
- the value of the second field in the resulting documentpublic static EditableDocument newDocument(String name1, Object value1, String name2, Object value2, String name3, Object value3)
name1
- the name of the first field in the resulting document; if null, the field will not be added to the returned
documentvalue1
- the value of the first field in the resulting documentname2
- the name of the second field in the resulting document; if null, the field will not be added to the returned
documentvalue2
- the value of the second field in the resulting documentname3
- the name of the third field in the resulting document; if null, the field will not be added to the returned
documentvalue3
- the value of the third field in the resulting documentpublic static EditableDocument newDocument(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4)
name1
- the name of the first field in the resulting document; if null, the field will not be added to the returned
documentvalue1
- the value of the first field in the resulting documentname2
- the name of the second field in the resulting document; if null, the field will not be added to the returned
documentvalue2
- the value of the second field in the resulting documentname3
- the name of the third field in the resulting document; if null, the field will not be added to the returned
documentvalue3
- the value of the third field in the resulting documentname4
- the name of the fourth field in the resulting document; if null, the field will not be added to the returned
documentvalue4
- the value of the fourth field in the resulting documentpublic static EditableArray newArray()
public static EditableArray newArray(int initialCapacity)
initialCapacity
- the initial allocated capacity for the arraypublic static EditableArray newArray(Collection<?> values)
values
- the initial values for the arraypublic static EditableArray newArray(Object... values)
values
- the initial values for the arrayCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.