Skip to content

Package: AnnotationPropertyAttributes

AnnotationPropertyAttributes

nameinstructionbranchcomplexitylinemethod
AnnotationPropertyAttributes(FieldMappingValidator)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
resolve(Field, MetamodelBuilder, Class)
M: 4 C: 51
93%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 12
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
5: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
6: * version.
7: * <p>
8: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
10: * details. You should have received a copy of the GNU General Public License along with this program. If not, see
11: * <http://www.gnu.org/licenses/>.
12: */
13: package cz.cvut.kbss.jopa.model.metamodel;
14:
15: import cz.cvut.kbss.jopa.model.IRI;
16: import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty;
17:
18: import java.lang.reflect.Field;
19:
20: class AnnotationPropertyAttributes extends PropertyAttributes {
21:
22: AnnotationPropertyAttributes(FieldMappingValidator validator) {
23: super(validator);
24: }
25:
26: @Override
27: void resolve(Field field, MetamodelBuilder metamodelBuilder, Class<?> fieldValueCls) {
28: super.resolve(field, metamodelBuilder, fieldValueCls);
29: final OWLAnnotationProperty oap = field.getAnnotation(OWLAnnotationProperty.class);
30:• assert oap != null;
31:
32: this.persistentAttributeType = Attribute.PersistentAttributeType.ANNOTATION;
33: this.iri = IRI.create(typeBuilderContext.resolveNamespace(oap.iri()));
34: this.fetchType = oap.fetch();
35: this.type = BasicTypeImpl.get(fieldValueCls);
36: this.lexicalForm = oap.lexicalForm();
37: this.simpleLiteral = oap.simpleLiteral();
38: this.language = resolveLanguage(fieldValueCls);
39: validator.validateAnnotationPropertyField(field, oap);
40: }
41: }