本文整理了Java中org.nuxeo.ecm.core.api.model.Property.isScalar()
方法的一些代码示例,展示了Property.isScalar()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.isScalar()
方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.model.Property
类名称:Property
方法名:isScalar
[英]Tests whether this property is of a scalar type.
[中]测试此属性是否为标量类型。
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
/**
* @since 7.1
*/
private List<ConstraintViolation> validateSimpleTypeProperty(Schema schema, List<PathNode> path, Property prop,
boolean dirtyOnly) {
Field field = prop.getField();
assert field.getType().isSimpleType() || prop.isScalar();
List<ConstraintViolation> violations = new ArrayList<>();
Serializable value = prop.getValue();
Object defaultValue = field.getDefaultValue();
// check nullity constraint only if field doesn't have a default value (phantom case)
if (prop.isPhantom() && defaultValue == null || value == null) {
if (!field.isNillable()) {
addNotNullViolation(violations, schema, path);
}
} else {
violations.addAll(validateSimpleTypeField(schema, path, field, value));
}
return violations;
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api
if (property.isScalar()) {
throw new PropertyNotFoundException(path.toString(),
"segment " + segment + " points to a scalar property");
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-io
protected void writeProperty(JsonGenerator jg, Property prop) throws IOException {
if (prop.isScalar()) {
writeScalarProperty(jg, prop);
} else if (prop.isList()) {
writeListProperty(jg, prop);
} else if (prop instanceof BlobProperty) { // a blob
writeBlobProperty(jg, (BlobProperty) prop);
} else if (prop.isComplex()) {
writeComplexProperty(jg, prop);
} else if (prop.isPhantom()) {
jg.writeNull();
}
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-io
case DOUBLE:
case BOOLEAN:
if (input.isScalar()) {
return input.getValue();
if (input.isScalar()) {
if (AvroConstants.AVRO_LOGICTYPE_TIMESTAMP_MILLIS.equals(getLogicalType(schema))) {
GregorianCalendar cal = (GregorianCalendar) input.getValue();
代码示例来源:origin: org.nuxeo.ecm.webengine/nuxeo-webengine-core
static void fillDocumentProperty(Property p, String key, Object[] ar) throws PropertyException {
if (ar == null || ar.length == 0) {
p.remove();
} else if (p.isScalar()) {
p.setValue(ar[0]);
} else if (p.isList()) {
代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core
/**
* Converts the value of the given core property to JSON.
*
* @param fieldNameWriter the field name writer is used to write the field name depending on writer configuration,
* this parameter also allows us to handle different cases: field with prefix, field under complex
* property, or nothing for arrays and lists
*/
protected void writeProperty(JsonGenerator jg, Property prop, PropertyConsumer fieldNameWriter)
throws PropertyException, IOException {
if (prop.isScalar()) {
writeScalarProperty(jg, prop, fieldNameWriter);
} else if (prop.isList()) {
writeListProperty(jg, prop, fieldNameWriter);
} else {
if (prop.isPhantom()) {
if (writeNull) {
fieldNameWriter.accept(jg, prop);
jg.writeNull();
}
} else if (prop instanceof BlobProperty) { // a blob
writeBlobProperty(jg, prop, fieldNameWriter);
} else { // a complex property
writeMapProperty(jg, (ComplexProperty) prop, fieldNameWriter);
}
}
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-io
protected Property readProperty(Property parent, Field field, JsonNode jn) throws IOException {
Property property = PropertyFactory.createProperty(parent, field, 0);
if (jn.isNull()) {
property.setValue(null);
} else if (property.isScalar()) {
fillScalarProperty(property, jn);
} else if (property.isList()) {
fillListProperty(property, jn);
} else {
if (!(property instanceof BlobProperty)) {
fillComplexProperty(property, jn);
} else {
Blob blob = readEntity(Blob.class, Blob.class, jn);
property.setValue(blob);
}
}
return property;
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-rendering
public TemplateModel wrap(Property property) throws TemplateModelException {
try {
if (property.isScalar()) {
Object value = property.getValue();
if (value == null) {
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-rendering
} else if (obj instanceof Property) {
Property p = (Property) obj;
if (p.isScalar()) {
return new PropertyWrapper(this).wrap(p);
} else if (p.isList()) {
内容来源于网络,如有侵权,请联系作者删除!