Refine search
/** * Check for null and throw NullPointerException if null. * * @param object reference to check * @param <T> reference type * @return the input reference if not null * @throws NullPointerException if object is null */ public static <T> T checkNotNull(@Nullable T object) { return checkNotNull(object, () -> "this variable cannot be null"); }
@Override public OWLDataPropertyAssertionAxiom getOWLDataPropertyAssertionAxiom( OWLDataPropertyExpression property, OWLIndividual subject, OWLLiteral object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLDataPropertyAssertionAxiomImpl(subject, property, object, annotations); }
/** * @param ontology ontology * @param axiom axiom * @param cls cls */ public UseOfUndeclaredClass(OWLOntology ontology, @Nullable OWLAxiom axiom, OWLClass cls) { super(ontology, axiom, checkNotNull(cls)); }
@Override public OWLNegativeDataPropertyAssertionAxiom getOWLNegativeDataPropertyAssertionAxiom( OWLDataPropertyExpression property, OWLIndividual subject, OWLLiteral object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLNegativeDataPropertyAssertionAxiomImpl(subject, property, object, annotations); }
/** * @param ontology ontology * @param axiom axiom * @param prop prop */ public UseOfUndeclaredObjectProperty(OWLOntology ontology, @Nullable OWLAxiom axiom, OWLObjectProperty prop) { super(ontology, axiom, checkNotNull(prop)); }
@Override public OWLAnnotationAssertionAxiom getOWLAnnotationAssertionAxiom( OWLAnnotationProperty property, OWLAnnotationSubject subject, OWLAnnotationValue value, Collection<OWLAnnotation> annotations) { checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(value, VALUE_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLAnnotationAssertionAxiomImpl(subject, property, value, annotations); }
/** * @param ontology ontology * @param axiom axiom * @param classExpression classExpression */ public UseOfIllegalClassExpression(OWLOntology ontology, @Nullable OWLAxiom axiom, OWLClassExpression classExpression) { super(ontology, axiom, checkNotNull(classExpression)); }
@Override public OWLObjectPropertyAssertionAxiom getOWLObjectPropertyAssertionAxiom( OWLObjectPropertyExpression property, OWLIndividual individual, OWLIndividual object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(individual, INDIVIDUAL_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLObjectPropertyAssertionAxiomImpl(individual, property, object, annotations); }
/** * Check for null and throw NullPointerException if null. * * @param object reference to check * @param <T> reference type * @return the input reference if not null * @throws NullPointerException if object is null */ public static <T> T checkNotNull(@Nullable T object) { return checkNotNull(object, () -> "this variable cannot be null"); }
@Override public OWLAnnotationAssertionAxiom getOWLAnnotationAssertionAxiom( OWLAnnotationProperty property, OWLAnnotationSubject subject, OWLAnnotationValue value, Collection<OWLAnnotation> annotations) { checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(value, VALUE_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLAnnotationAssertionAxiomImpl(subject, property, value, annotations); }
/** * @param namespace namespace * @return prefix for namespace, or null */ @Nullable public String getPrefixForNamespace(String namespace) { return namespacePrefixMap.get(checkNotNull(namespace, "namespace cannot be null")); }
@Override public OWLNegativeObjectPropertyAssertionAxiom getOWLNegativeObjectPropertyAssertionAxiom( OWLObjectPropertyExpression property, OWLIndividual subject, OWLIndividual object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLNegativeObjectPropertyAssertionAxiomImpl(subject, property, object, annotations); }
@Override @Nullable public IRI getDocumentIRI(IRI ontologyIRI) { checkNotNull(ontologyIRI, "ontologyIRI cannot be null"); return iriMap.get(ontologyIRI); } }
@Override public OWLObjectPropertyAssertionAxiom getOWLObjectPropertyAssertionAxiom( OWLObjectPropertyExpression property, OWLIndividual individual, OWLIndividual object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(individual, INDIVIDUAL_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLObjectPropertyAssertionAxiomImpl(individual, property, object, annotations); }
@Override public void endElement(@Nullable String uri, @Nullable String localName, @Nullable String qName) throws SAXException { verifyNotNull(state) .endElement(checkNotNull(uri), checkNotNull(localName), checkNotNull(qName)); baseIRI = baseIRIs.remove(0); language = languages.remove(0); }
@Override public OWLNegativeObjectPropertyAssertionAxiom getOWLNegativeObjectPropertyAssertionAxiom( OWLObjectPropertyExpression property, OWLIndividual subject, OWLIndividual object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLNegativeObjectPropertyAssertionAxiomImpl(subject, property, object, annotations); }
@Override public void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException { OntologyRootElementHandler handler = handlerMap.get(uri + localName); if (handler != null) { IRI ontologyIRI = handler.handle(checkNotNull(attributes)); if (ontologyIRI != null && currentFile == null) { currentFile = ontologyIRI; } throw new SAXException(); } }
@Override public OWLDataPropertyAssertionAxiom getOWLDataPropertyAssertionAxiom( OWLDataPropertyExpression property, OWLIndividual subject, OWLLiteral object, Collection<OWLAnnotation> annotations) { checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNull(object, OBJECT_CANNOT_BE_NULL); checkNotNull(subject, SUBJECT_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLDataPropertyAssertionAxiomImpl(subject, property, object, annotations); }
private static double getPriority(@Nullable Object p) { HasPriority priority = checkNotNull(p).getClass().getAnnotation(HasPriority.class); if (priority != null) { return priority.value(); } // if the object does not have a priority annotation, only use // it last return Double.MAX_VALUE; }
@Override public OWLAnnotationPropertyRangeAxiom getOWLAnnotationPropertyRangeAxiom( OWLAnnotationProperty prop, IRI range, Collection<OWLAnnotation> annotations) { checkNotNull(prop, PROPERTY_CANNOT_BE_NULL); checkNotNull(range, RANGE_CANNOT_BE_NULL); checkAnnotations(annotations); return new OWLAnnotationPropertyRangeAxiomImpl(prop, range, annotations); }