本文整理了Java中org.modeshape.schematic.document.Document.isEmpty()
方法的一些代码示例,展示了Document.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.isEmpty()
方法的具体详情如下:
包路径:org.modeshape.schematic.document.Document
类名称:Document
方法名:isEmpty
[英]Return whether this document contains no fields and is therefore empty.
[中]返回此文档是否不包含字段,因此是否为空。
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Determine whether there are indexes defined in this configuration.
*
* @return true if there are no indexes, or false otherwise
*/
public boolean isEmpty() {
return indexes == null ? true : indexes.isEmpty();
}
代码示例来源:origin: ModeShape/modeshape
/**
* Determine whether there are indexes defined in this configuration.
*
* @return true if there are no indexes, or false otherwise
*/
public boolean isEmpty() {
return indexes == null ? true : indexes.isEmpty();
}
代码示例来源:origin: ModeShape/modeshape
/**
* Determine if document optimization is enabled. At this time, optimization is DISABLED by default and must be enabled by
* defining the "{@value FieldName#OPTIMIZATION_CHILD_COUNT_TARGET}" and "
* {@value FieldName#OPTIMIZATION_CHILD_COUNT_TOLERANCE}" fields.
*
* @return true if enabled, or false otherwise
*/
public boolean isEnabled() {
return !this.optimization.isEmpty() && getChildCountTarget() != Integer.MAX_VALUE;
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Determine if document optimization is enabled. At this time, optimization is DISABLED by default and must be enabled by
* defining the "{@value FieldName#OPTIMIZATION_CHILD_COUNT_TARGET}" and "
* {@value FieldName#OPTIMIZATION_CHILD_COUNT_TOLERANCE}" fields.
*
* @return true if enabled, or false otherwise
*/
public boolean isEnabled() {
return !this.optimization.isEmpty() && getChildCountTarget() != Integer.MAX_VALUE;
}
代码示例来源:origin: ModeShape/modeshape
/**
* Utility method to replace all system property variables found within the specified document.
*
* @param doc the document; may not be null
* @return the modified document if system property variables were found, or the <code>doc</code> instance if no such
* variables were found
*/
protected static Document replaceSystemPropertyVariables( Document doc ) {
if (doc.isEmpty()) return doc;
Document modified = doc.withVariablesReplacedWithSystemProperties();
if (modified == doc) return doc;
// Otherwise, we changed some values. Note that the system properties can only be used in
// string values, whereas the schema may expect non-string values. Therefore, we need to validate
// the document against the schema and possibly perform some conversions of values ...
return SCHEMA_LIBRARY.convertValues(modified, JSON_SCHEMA_URI);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
protected Bucket( BucketId id, Document bucketDoc, DocumentTranslator translator ) {
assert id != null;
assert bucketDoc != null;
this.id = id;
this.nameFactory = translator.getNameFactory();
this.stringValueFactory = translator.getStringFactory();
if (bucketDoc.isEmpty()) {
this.childNamesByKey = Collections.emptyMap();
this.childKeysByName = Collections.emptyMap();
} else {
int size = bucketDoc.size();
this.childNamesByKey = new LinkedHashMap<>(size);
this.childKeysByName = new HashMap<>(size);
for (Map.Entry<String, ?> entry : bucketDoc.toMap().entrySet()) {
NodeKey nodeKey = new NodeKey(entry.getKey());
String name = entry.getValue().toString();
childNamesByKey.put(nodeKey, name);
childKeysByName.put(name, nodeKey);
}
}
}
代码示例来源:origin: ModeShape/modeshape
protected Bucket( BucketId id, Document bucketDoc, DocumentTranslator translator ) {
assert id != null;
assert bucketDoc != null;
this.id = id;
this.nameFactory = translator.getNameFactory();
this.stringValueFactory = translator.getStringFactory();
if (bucketDoc.isEmpty()) {
this.childNamesByKey = Collections.emptyMap();
this.childKeysByName = Collections.emptyMap();
} else {
int size = bucketDoc.size();
this.childNamesByKey = new LinkedHashMap<>(size);
this.childKeysByName = new HashMap<>(size);
for (Map.Entry<String, ?> entry : bucketDoc.toMap().entrySet()) {
NodeKey nodeKey = new NodeKey(entry.getKey());
String name = entry.getValue().toString();
childNamesByKey.put(nodeKey, name);
childKeysByName.put(name, nodeKey);
}
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Utility method to replace all system property variables found within the specified document.
*
* @param doc the document; may not be null
* @return the modified document if system property variables were found, or the <code>doc</code> instance if no such
* variables were found
*/
protected static Document replaceSystemPropertyVariables( Document doc ) {
if (doc.isEmpty()) return doc;
Document modified = doc.withVariablesReplacedWithSystemProperties();
if (modified == doc) return doc;
// Otherwise, we changed some values. Note that the system properties can only be used in
// string values, whereas the schema may expect non-string values. Therefore, we need to validate
// the document against the schema and possibly perform some conversions of values ...
return SCHEMA_LIBRARY.convertValues(modified, JSON_SCHEMA_URI);
}
代码示例来源:origin: org.modeshape/modeshape-schematic
@Override
protected void doSetAllValues( Document values ) {
if (values != null && !values.isEmpty()) {
for (Field field : values.fields()) {
doSetValue(field.getName(), field.getValue());
}
}
}
代码示例来源:origin: ModeShape/modeshape
@Override
protected void doSetAllValues( Document values ) {
if (values != null && !values.isEmpty()) {
for (Field field : values.fields()) {
doSetValue(field.getName(), field.getValue());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!