@SuppressWarnings("unchecked") @Override protected E readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException { if(entityType == EntityType.CLASS) { return (E) inputStream.readClassIRI(); } else if(entityType == EntityType.OBJECT_PROPERTY) { return (E) inputStream.readObjectPropertyIRI(); } else if(entityType == EntityType.ANNOTATION_PROPERTY) { return (E) inputStream.readAnnotationPropertyIRI(); } else if(entityType == EntityType.DATA_PROPERTY) { return (E) inputStream.readDataPropertyIRI(); } else if(entityType == EntityType.DATATYPE) { return (E) inputStream.readDatatypeIRI(); } else if(entityType == EntityType.NAMED_INDIVIDUAL) { return (E) inputStream.readIndividualIRI(); } IRI iri = inputStream.readIRI(); return inputStream.getDataFactory().getOWLEntity(entityType, iri); }
@Override public EntityType<?> getEntityType() { return EntityType.DATA_PROPERTY; }
@Override public boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
@Override public EntityType<?> getEntityType() { return EntityType.DATATYPE; }
@Override public EntityType<?> getEntityType() { return EntityType.CLASS; }
public OWLEntitySerializer(EntityType<E> entityType) { this.entityType = entityType; }