本文整理了Java中org.modeshape.schematic.document.Document.getDocument()
方法的一些代码示例,展示了Document.getDocument()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.getDocument()
方法的具体详情如下:
包路径:org.modeshape.schematic.document.Document
类名称:Document
方法名:getDocument
[英]Get the document value in this document for the given field name.
[中]获取此文档中给定字段名的文档值。
代码示例来源:origin: ModeShape/modeshape
/**
* Returns the value of the CONTENT document from a given entry document.
*
* @param entryDocument a {@link Document} instance representing a schematic entry.
* @return a {@link Document} or {@code null} if there is no {@link org.modeshape.schematic.SchematicEntry.FieldName#CONTENT}
* document.
*/
static Document content(Document entryDocument) {
return entryDocument.getDocument(FieldName.CONTENT);
}
代码示例来源:origin: ModeShape/modeshape
public Document getPersistenceConfiguration() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
return null;
}
return storage.getDocument(FieldName.PERSISTENCE);
}
代码示例来源:origin: org.modeshape/modeshape-schematic
/**
* Returns the value of the CONTENT document from a given entry document.
*
* @param entryDocument a {@link Document} instance representing a schematic entry.
* @return a {@link Document} or {@code null} if there is no {@link org.modeshape.schematic.SchematicEntry.FieldName#CONTENT}
* document.
*/
static Document content(Document entryDocument) {
return entryDocument.getDocument(FieldName.CONTENT);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
public InitialContent( Document workspaces ) {
workspacesInitialContentFiles = new HashMap<String, String>();
if (workspaces != null) {
Document initialContent = workspaces.getDocument(FieldName.INITIAL_CONTENT);
if (initialContent != null) {
parseInitialContent(initialContent);
}
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Get the configuration for the garbage collection aspects of this repository.
*
* @return the garbage collection configuration; never null
*/
public GarbageCollection getGarbageCollection() {
return new GarbageCollection(doc.getDocument(FieldName.GARBAGE_COLLECTION));
}
代码示例来源:origin: ModeShape/modeshape
/**
* Get the configuration for the monitoring-related aspects of this repository.
*
* @return the monitoring configuration; never null
*/
public MonitoringSystem getMonitoring() {
return new MonitoringSystem(doc.getDocument(FieldName.MONITORING));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
public boolean isCreatingWorkspacesAllowed() {
Document workspaces = doc.getDocument(FieldName.WORKSPACES);
if (workspaces != null) {
return workspaces.getBoolean(FieldName.ALLOW_CREATION, Default.ALLOW_CREATION);
}
return Default.ALLOW_CREATION;
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Get the configuration for the monitoring-related aspects of this repository.
*
* @return the monitoring configuration; never null
*/
public MonitoringSystem getMonitoring() {
return new MonitoringSystem(doc.getDocument(FieldName.MONITORING));
}
代码示例来源:origin: ModeShape/modeshape
public int getWorkspaceCacheSize() {
Document storage = doc.getDocument(FieldName.WORKSPACES);
if (storage != null) {
return storage.getInteger(FieldName.WORKSPACE_CACHE_SIZE, Default.WORKSPACE_CACHE_SIZE);
}
return Default.WORKSPACE_CACHE_SIZE;
}
代码示例来源:origin: ModeShape/modeshape
public boolean isCreatingWorkspacesAllowed() {
Document workspaces = doc.getDocument(FieldName.WORKSPACES);
if (workspaces != null) {
return workspaces.getBoolean(FieldName.ALLOW_CREATION, Default.ALLOW_CREATION);
}
return Default.ALLOW_CREATION;
}
代码示例来源:origin: ModeShape/modeshape
/**
* Get the name of the workspace that should be used for sessions where the client does not specify the name of the workspace.
*
* @return the default workspace name; never null
*/
public String getDefaultWorkspaceName() {
Document workspaces = doc.getDocument(FieldName.WORKSPACES);
if (workspaces != null) {
return workspaces.getString(FieldName.DEFAULT, Default.DEFAULT);
}
return Default.DEFAULT;
}
代码示例来源:origin: ModeShape/modeshape
/**
* Get the configuration for the document optimization for this repository.
*
* @return the document optimization configuration; never null
*/
public DocumentOptimization getDocumentOptimization() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
public BinaryStorage getBinaryStorage() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new BinaryStorage(storage.getDocument(FieldName.BINARY_STORAGE));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Returns the initial content configuration for this repository configuration
*
* @return a {@code non-null} {@link InitialContent}
*/
public InitialContent getInitialContent() {
return new InitialContent(doc.getDocument(FieldName.WORKSPACES));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Returns the reindexing configuration.
*
* @return a {@link org.modeshape.jcr.RepositoryConfiguration.Reindexing} instance, never {@code null}.
*/
public Reindexing getReindexing() {
return new Reindexing(doc.getDocument(FieldName.REINDEXING));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Get the configuration for the document optimization for this repository.
*
* @return the document optimization configuration; never null
*/
public DocumentOptimization getDocumentOptimization() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION));
}
代码示例来源:origin: ModeShape/modeshape
public BinaryStorage getBinaryStorage() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new BinaryStorage(storage.getDocument(FieldName.BINARY_STORAGE));
}
代码示例来源:origin: ModeShape/modeshape
/**
* Get the configuration for the garbage collection aspects of this repository.
*
* @return the garbage collection configuration; never null
*/
public GarbageCollection getGarbageCollection() {
return new GarbageCollection(doc.getDocument(FieldName.GARBAGE_COLLECTION));
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
public ChildReferencesInfo getChildReferencesInfo( Document document ) {
// Now look at the 'childrenInfo' document for info about the next block ...
Document childrenInfo = document.getDocument(CHILDREN_INFO);
if (childrenInfo != null) {
long totalSize = childrenInfo.getLong(COUNT, 0L);
long blockSize = childrenInfo.getLong(BLOCK_SIZE, 0L);
String nextBlockKey = childrenInfo.getString(NEXT_BLOCK);
String lastBlockKey = childrenInfo.getString(LAST_BLOCK, nextBlockKey);
return new ChildReferencesInfo(totalSize, blockSize, nextBlockKey, lastBlockKey);
}
return null;
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldParseDocumentWithNestedDocument() throws Exception {
bson = (Document)parser("{ \"foo\" : 32 , \"nested\" : { \"bar\" : \"baz\", \"bom\" : true }}").parseValue();
assertField("foo", 32);
bson = bson.getDocument("nested");
assertField("bar", "baz");
assertField("bom", true);
}
内容来源于网络,如有侵权,请联系作者删除!