/** * Sets the value of the annotation. * * @param fieldValue the value to set * @throws UnsupportedOperationException if the annotation type does not allow this annotation to have values. */ public void setFieldValue(FieldValue fieldValue) { if (fieldValue == null) { value = null; return; } DataType type = getType().getDataType(); if (type != null && type.isValueCompatible(fieldValue)) { this.value = fieldValue; } else { String typeName = (type == null) ? "null" : type.getValueClass().getName(); throw new IllegalArgumentException("Argument is of wrong type, must be of type " + typeName + ", was " + fieldValue.getClass().getName()); } }
private void buildConfig(AnnotationType type, DocumentmanagerConfig.Annotationtype.Builder atb) { atb. id(type.getId()). name(type.getName()); if (type.getDataType() != null) { atb.datatype(type.getDataType().getId()); } if ( ! type.getInheritedTypes().isEmpty()) { for (AnnotationType inherited : type.getInheritedTypes()) { atb.inherits(new DocumentmanagerConfig.Annotationtype.Inherits.Builder().id(inherited.getId())); } } } private void buildConfig(Collection<AnnotationType> types, DocumentmanagerConfig.Builder builder) {
private void buildConfig(AnnotationType annotation, DocumenttypesConfig.Documenttype.Annotationtype.Builder builder) { builder. id(annotation.getId()). name(annotation.getName()); DataType dt = annotation.getDataType(); if (dt != null) { builder.datatype(dt.getId()); } for (AnnotationType inherited : annotation.getInheritedTypes()) { builder.inherits(new DocumenttypesConfig.Documenttype.Annotationtype.Inherits.Builder().id(inherited.getId())); } }
if (dataTypeId != type.getDataType().getId()) { FieldValue value = type.getDataType().createFieldValue(); value.deserialize(this); annotation.setFieldValue(value);
if (dataTypeId != type.getDataType().getId()) { FieldValue value = type.getDataType().createFieldValue(); value.deserialize(this); annotation.setFieldValue(value);
annotationInheritance.put(annotation, sa.getInherits()); if (annotation.getDataType() == null) { if (sa.getSdDocType() != null) { StructDataType s = handleStruct(dt, sa.getSdDocType());
buf.putInt(annotation.getType().getDataType().getId()); annotation.getFieldValue().serialize(this);
buf.putInt(annotation.getType().getDataType().getId()); annotation.getFieldValue().serialize(this);